5#ifndef _TARCH_LA_MATRIX_H_
6#define _TARCH_LA_MATRIX_H_
7#include "tarch/TarchDefinitions.h"
11template <
int rows,
int cols,
class T>
class Matrix;
24 T _entries[rows][cols];
33 for (
int i = 0; i < rows; i++) {
34 for (
int j = 0; j < cols; j++) {
45#if (TARCH_DEBUG == TARCH_YES)
46 if (i < 0 || i > rows - 1) {
47 std::cout <<
"ERROR Matrix T& operator(): i out of range!" << std::endl;
50 if (j < 0 || j > cols - 1) {
51 std::cout <<
"ERROR Matrix T& operator(): j out of range!" << std::endl;
55 return _entries[i][j];
58#if (TARCH_DEBUG == TARCH_YES)
59 if (i < 0 || i > rows - 1) {
60 std::cout <<
"ERROR Matrix const T& operator(): i out of range!" << std::endl;
63 if (j < 0 || j > cols - 1) {
64 std::cout <<
"ERROR Matrix const T& operator(): j out of range!" << std::endl;
68 return _entries[i][j];
Matrix()
Two constructors, a default one and a constructor, which initializes all elemnet of the matrix with e...
Definition Matrix.h:31
T & operator()(int i, int j)
operator(i, j) gives back the the element (i, j)
Definition Matrix.h:44
Definition Configuration.h:11