Peano
Loading...
Searching...
No Matches
MatrixScalarOperations.cpph
Go to the documentation of this file.
1template<int Rows, int Cols, typename Scalar>
3 Matrix<Rows,Cols,Scalar>& matrix,
4 const Scalar& scalar
5) {
6 #ifdef CompilerICC
7 #pragma ivdep
8 #endif
9 for (int i=0; i < Rows; i++) {
10 for (int j=0; j < Cols; j++) {
11 matrix(i,j) *= scalar;
12 }
13 }
14 return matrix;
15}
16
17
18
19template<int Rows, int Cols, typename Scalar>
22 const Scalar& scalar
23) {
24 Matrix<Rows,Cols,Scalar> result(matrix);
25 #ifdef CompilerICC
26 #pragma ivdep
27 #endif
28 for (int i=0; i < Rows; i++) {
29 for (int j=0; j < Cols; j++) {
30 result(i,j) = matrix(i,j)*scalar;
31 }
32 }
33 return result;
34}
35
36
37template<int Rows, int Cols, typename Scalar>
39 const Scalar& scalar,
41) {
42 return matrix * scalar;
43}
44
45
46template<int Rows, int Cols>
48 const double& scalar,
49 const tarch::la::Matrix<Rows,Cols,std::complex<double> >& matrix
50) {
51 return std::complex<double>( scalar ) * matrix;
52}
Static (i.e.
Definition Matrix.h:42
j
Definition euler.py:99
Matrix< Rows, Cols, Scalar > & operator*=(Matrix< Rows, Cols, Scalar > &matrix, const Scalar &scalar)
Matrix< Rows, Cols, Scalar > operator*(const Matrix< Rows, X, Scalar > &lhs, const Matrix< X, Cols, Scalar > &rhs)