1 #ifndef _theplu_yat_utility_blas_level3 2 #define _theplu_yat_utility_blas_level3 25 #include "BasicMatrix.h" 26 #include "BLAS_utility.h" 28 #include "expression/MatrixBinary.h" 29 #include "expression/MatrixProduct.h" 30 #include "expression/ScaledMatrix.h" 31 #include "expression/TransposedMatrix.h" 33 #include <gsl/gsl_blas.h> 34 #include <gsl/gsl_cblas.h> 35 #include <gsl/gsl_matrix.h> 55 template<
class Derived1,
class Derived2>
56 expression::MatrixBinary<Derived1, Derived2, expression::Plus>
59 return expression::MatrixBinary<Derived1, Derived2,
76 template<
class Derived1,
class Derived2>
77 expression::MatrixBinary<Derived1, Derived2, expression::Minus>
80 return expression::MatrixBinary<Derived1, Derived2,
94 template<
class Derived1,
class Derived2>
99 return expression::MatrixProduct<BasicMatrix<Derived1>,
115 expression::ScaledMatrix<T>
118 return expression::ScaledMatrix<T>(k, A);
133 expression::ScaledMatrix<T>
136 return expression::ScaledMatrix<T>(k, A);
148 expression::ScaledMatrix<T>
151 return expression::ScaledMatrix<T>(-1.0, m);
161 expression::ScaledMatrix<T>
165 const expression::ScaledMatrix<T>& sm =
166 static_cast<const expression::ScaledMatrix<T>&
>(A);
167 return expression::ScaledMatrix<T>(k*sm.factor(), sm.base());
177 expression::ScaledMatrix<T>
181 const expression::ScaledMatrix<T>& sm =
182 static_cast<const expression::ScaledMatrix<T>&
>(A);
183 return expression::ScaledMatrix<T>(k*sm.factor(), sm.base());
193 expression::ScaledMatrix<T>
196 const expression::ScaledMatrix<T>& sm =
197 static_cast<const expression::ScaledMatrix<T>&
>(A);
198 return expression::ScaledMatrix<T>(-sm.factor(), sm.base());
212 return expression::TransposedMatrix<T>(A);
expression::ScaledMatrix< T > operator-(const BasicMatrix< T > &m)
negation operator
Definition: BLAS_level3.h:149
expression::MatrixProduct< BasicMatrix< Derived1 >, BasicMatrix< Derived2 > > operator*(const BasicMatrix< Derived1 > &lhs, const BasicMatrix< Derived2 > &rhs)
Matrix multiplication operator.
Definition: BLAS_level3.h:96
expression::ScaledMatrix< T > operator*(const BasicMatrix< MatrixExpression< expression::ScaledMatrix< T > > > &A, double k)
Definition: BLAS_level3.h:162
The Department of Theoretical Physics namespace as we define it.
expression::MatrixBinary< Derived1, Derived2, expression::Minus > operator-(const BasicMatrix< Derived1 > &lhs, const BasicMatrix< Derived2 > &rhs)
Matrix subtraction operator.
Definition: BLAS_level3.h:78
size_t columns(void) const
Definition: BasicMatrix.h:67
Definition: BLAS_utility.h:31
size_t rows(void) const
Definition: BasicMatrix.h:61
An expression that can be converted to a Matrix.
Definition: MatrixExpression.h:46
Definition: BLAS_utility.h:30
expression::ScaledMatrix< T > operator*(double k, const BasicMatrix< T > &A)
Definition: BLAS_level3.h:134
expression::ScaledMatrix< T > operator*(const BasicMatrix< T > &A, double k)
Definition: BLAS_level3.h:116
Definition: BasicMatrix.h:38
expression::MatrixBinary< Derived1, Derived2, expression::Plus > operator+(const BasicMatrix< Derived1 > &lhs, const BasicMatrix< Derived2 > &rhs)
Matrix addition operator.
Definition: BLAS_level3.h:57
expression::TransposedMatrix< T > transpose(const BasicMatrix< T > &A)
transpose function
Definition: BLAS_level3.h:210
expression::ScaledMatrix< T > operator-(const BasicMatrix< MatrixExpression< expression::ScaledMatrix< T > > > &A)
Definition: BLAS_level3.h:194