8template<
int Rows,
int Cols,
typename Scalar>
14 sizeof(Scalar)*Rows*Cols
20template<
int Rows,
int Cols,
typename Scalar>
26template<
int Rows,
int Cols,
typename Scalar>
28 for (
int i=0; i < Rows*Cols; i++) {
35template<
int Rows,
int Cols,
typename Scalar>
38 for (
typename std::initializer_list<Scalar>::const_iterator p = values.begin(); p!=values.end(); p++) {
45template<
int Rows,
int Cols,
typename Scalar>
51template<
int Rows,
int Cols,
typename Scalar>
57template<
int Rows,
int Cols,
typename Scalar>
63template<
int Rows,
int Cols,
typename Scalar>
65 std::ostringstream os;
67 for (
int i=0; i < Rows; i++) {
69 for (
int j=0; j < Cols; j++) {
85template<
int Rows,
int Cols,
typename Scalar>
87 std::ostringstream os;
89 os << std::setiosflags(std::ios::fixed) << std::setprecision(numberOfDigits);
90 for (
int i=0; i < Rows; i++) {
92 for (
int j=0; j < Cols; j++) {
111template<
int Rows,
int Cols,
typename Scalar>
112template <
typename NewScalarType>
115 for (
int i=0; i < Rows; i++) {
116 for (
int j=0; j < Cols; j++) {
std::string toString() const
std::string toPrettyString(int numberOfDigits=4) const
Scalar _values[Rows *Cols]
Values of the matrix components.
int cols() const
Returns the number of columns in the matrix.
Matrix()
Constructs a non-initialized matrix.
Scalar & operator()(int rowIndex, int colIndex)
Returns element at given row and column index (from 0..size-1).
int size() const
Returns the number of total elements in the matrix.
tarch::la::Matrix< Rows, Cols, NewScalarType > convertScalar() const
int rows() const
Returns the number of rows in the matrix.
Matrix< Rows, Cols, Scalar > buildMatrix(const Scalar *values)
Deep copy builder function.
Vector< Size, Scalar > abs(const Vector< Size, Scalar > &vector)
Computes the absolute component values of the vector, creating a temporary vector to hold the result.