4 #include "ester-config.h"
13 explicit matrix(
int nfil=1,
int ncol=1);
24 const double &
operator()(
int irow,
int icol)
const;
26 int read(
int nrow,
int ncol,FILE *fp,
char mode=
't');
27 int write(FILE *fp=stdout,
char mode=
't')
const;
28 void write_fmt(
const char *fmt,FILE *fp=stdout)
const;
72 const matrix block(
int irow1,
int irow2,
int icol1,
int icol2)
const;
73 const matrix block_step(
int irow1,
int irow2,
int drow,
int icol1,
int icol2,
int dcol)
const;
250 inline double &
operator[](
const std::string& key) {
return std::map<std::string,double>::operator[](key);}
251 inline const double &
operator[](
const std::string& key)
const {
return find(key)->second;};
289 inline matrix &
operator[](
const std::string& key) {
return std::map<std::string,matrix>::operator[](key);}
double sum()
Definition: matrix_map.cpp:169
double t0
Definition: matrix.h:348
matrix operator<=(const matrix &a) const
Definition: matrix.h:55
friend matrix log10(const matrix &)
Definition: mat_math.cpp:162
matrix_map m_map
Definition: matrix.h:322
matrix atan2(const matrix &, const matrix &)
Definition: mat_math.cpp:246
friend matrix_block_diag operator*(const matrix &, const matrix_block_diag &)
Definition: matrix.h:239
tiempo()
Definition: matrix.h:352
matrix_map & setrow(int irow, const matrix_map &)
Definition: matrix_map.cpp:99
matrix operator&&(const matrix &) const
Definition: matrix.cpp:851
double t
Definition: matrix.h:348
matrix operator*(const matrix &) const
Definition: matrix.cpp:449
int nb
Definition: matrix.h:204
const matrix & block(int i) const
Definition: matrix_block_diag.cpp:107
matrix & operator[](const std::string &key)
Definition: matrix.h:289
friend matrix vector(double x0, double x1, int n)
Definition: matrix.cpp:1404
matrix random_matrix(int nfil, int ncol)
Definition: matrix.cpp:1361
double max(const matrix &)
Definition: matrix.cpp:1416
matrix_map & setblock(int irow1, int irow2, int icol1, int icol2, const matrix_map &)
Definition: matrix_map.cpp:115
matrix sqrt(const matrix &)
Definition: mat_math.cpp:176
matrix log10(const matrix &)
Definition: mat_math.cpp:162
matrix & setblock_step(int irow1, int irow2, int drow, int icol1, int icol2, int dcol, const matrix &)
Definition: matrix.cpp:1222
matrix_block_diag(int nblocks=1)
Definition: matrix_block_diag.cpp:14
int nrows() const
Definition: matrix_block_diag.cpp:125
friend matrix operator,(const matrix &, const matrix_block_diag &)
Definition: matrix_block_diag.cpp:180
friend matrix atan(const matrix &)
Definition: mat_math.cpp:78
void write_fmt(const char *fmt, FILE *fp=stdout) const
Saves matrix to a file with a special format.
Definition: matrix.cpp:259
double operator()(int nfil, int ncol) const
Definition: matrix_block_diag.cpp:370
matrix tanh(const matrix &)
Definition: mat_math.cpp:120
double * data() const
Returns the pointer to the matrix data.
Definition: matrix.cpp:75
friend matrix sinh(const matrix &)
Definition: mat_math.cpp:106
The matrix class is used to facilitate the work with regular dense matrices.
Definition: matrix.h:9
double value()
Definition: matrix.h:356
matrix operator||(double n, const matrix &a)
Definition: matrix.h:152
matrix cosh(const matrix &)
Definition: mat_math.cpp:92
matrix_map & setblock_step(int irow1, int irow2, int drow, int icol1, int icol2, int dcol, const matrix_map &)
Definition: matrix_map.cpp:123
int isequal(const matrix &, const matrix &)
Definition: matrix.cpp:1537
friend double min(const matrix &)
Definition: matrix.cpp:1430
friend matrix ones(int nfil, int ncol)
Definition: matrix.cpp:1337
void zero(int nrows, int ncols)
Sets the matrix to the nrows x ncols zero matrix.
Definition: matrix.cpp:291
friend int isequal(const matrix &, const matrix &)
Definition: matrix.cpp:1537
const matrix_map block(int irow1, int irow2, int icol1, int icol2) const
Definition: matrix_map.cpp:81
The matrix_block_diag class is used to store block diagonal matrices.
Definition: matrix.h:202
matrix operator<(const matrix &a) const
Definition: matrix.h:51
matrix atan(const matrix &)
Definition: mat_math.cpp:78
int nc
Definition: matrix.h:11
const double & operator[](const std::string &key) const
Definition: matrix.h:251
matrix operator==(double n, const matrix &a)
Definition: matrix.h:145
matrix ceil(const matrix &)
Definition: mat_math.cpp:218
matrix fliplr() const
Definition: matrix.cpp:1299
friend matrix sqrt(const matrix &)
Definition: mat_math.cpp:176
friend matrix operator/(double, const matrix &)
Definition: matrix.cpp:541
matrix floor(const matrix &)
Definition: mat_math.cpp:204
int exist(const matrix &)
Definition: matrix.cpp:1527
friend matrix operator-(double, const matrix &)
Definition: matrix.cpp:411
double & operator[](const std::string &key)
Definition: matrix.h:250
double sum(const matrix &)
Definition: matrix.cpp:1444
matrix inv() const
Definition: mat_spec.cpp:59
matrix operator-(double, const matrix &)
Definition: matrix.cpp:411
matrix operator,(const matrix &) const
Definition: mat_spec.cpp:19
friend matrix exp(const matrix &)
Definition: mat_math.cpp:134
int read(int nrow, int ncol, FILE *fp, char mode='t')
Reads matrix data from a file.
Definition: matrix.cpp:215
matrix operator||(const matrix &) const
Definition: matrix.cpp:799
friend double sum(const matrix &)
Definition: matrix.cpp:1444
matrix flipud() const
Definition: matrix.cpp:1319
void values(double,...)
Sets the values of the matrix (given in column major order).
Definition: matrix.cpp:300
matrix ones(int nfil, int ncol)
Definition: matrix.cpp:1337
matrix cos(const matrix &)
Definition: mat_math.cpp:8
const matrix_map block_step(int irow1, int irow2, int drow, int icol1, int icol2, int dcol) const
Definition: matrix_map.cpp:90
int nf
Definition: matrix.h:11
matrix pow(const matrix &, const matrix &)
Definition: mat_math.cpp:293
double_map m_map
Definition: matrix.h:259
matrix operator!=(const matrix &) const
Definition: matrix.cpp:618
void start()
Definition: matrix.h:354
matrix log(const matrix &)
Definition: mat_math.cpp:148
const matrix col(int icol) const
Definition: matrix.cpp:1090
friend matrix floor(const matrix &)
Definition: mat_math.cpp:204
matrix sum()
Definition: matrix_map.cpp:159
friend matrix_block_diag eye(const matrix_block_diag &)
Definition: matrix_block_diag.cpp:393
matrix & operator/=(const matrix &)
Definition: matrix.cpp:981
create_double_map & operator()(const std::string &key, const double &val)
Definition: matrix.h:266
create_matrix_map(const std::string &key, const matrix &val)
Definition: matrix.h:324
friend matrix ceil(const matrix &)
Definition: mat_math.cpp:218
matrix sin(const matrix &)
Definition: mat_math.cpp:22
matrix_block_diag & set_nblocks(int nblocks)
Definition: matrix_block_diag.cpp:59
matrix operator*(double n, const matrix &a)
Definition: matrix.h:143
int ncols() const
Definition: matrix_block_diag.cpp:136
friend matrix log(const matrix &)
Definition: mat_math.cpp:148
friend matrix cos(const matrix &)
Definition: mat_math.cpp:8
double & operator()(int irow, int icol)
Access matrix's elements.
Definition: matrix.cpp:161
~matrix_block_diag()
Definition: matrix_block_diag.cpp:30
void swap(matrix &)
Swaps two matrices.
Definition: matrix.cpp:274
matrix_map & setcol(int icol, const matrix_map &)
Definition: matrix_map.cpp:107
friend matrix vector_t(double x0, double x1, int n)
Definition: matrix.cpp:1389
matrix operator>(const matrix &) const
Definition: matrix.cpp:669
matrix_map_elem operator()(int nfil, int ncol)
Definition: matrix_map.cpp:41
matrix & setblock(int irow1, int irow2, int icol1, int icol2, const matrix &)
Definition: matrix.cpp:1190
matrix & operator-=(const matrix &)
Definition: matrix.cpp:929
matrix concatenate(const matrix &a, int dir=0) const
Definition: matrix.cpp:1254
matrix & operator=(const matrix &)
Affectation operator.
Definition: matrix.cpp:148
const matrix block_step(int irow1, int irow2, int drow, int icol1, int icol2, int dcol) const
Definition: matrix.cpp:1162
matrix operator/(double, const matrix &)
Definition: matrix.cpp:541
matrix solve(matrix) const
Definition: mat_spec.cpp:33
matrix acos(const matrix &)
Definition: mat_math.cpp:50
friend matrix zeros(int nfil, int ncol)
Definition: matrix.cpp:1349
friend matrix eye(int n)
Definition: matrix.cpp:1375
matrix asin(const matrix &)
Definition: mat_math.cpp:64
matrix tan(const matrix &)
Definition: mat_math.cpp:36
matrix exp(const matrix &)
Definition: mat_math.cpp:134
const matrix & operator[](const std::string &key) const
Definition: matrix.h:290
matrix vector_t(double x0, double x1, int n)
Definition: matrix.cpp:1389
friend matrix tanh(const matrix &)
Definition: mat_math.cpp:120
matrix_map & operator-=(const matrix_map &d)
Definition: matrix_map.cpp:252
matrix operator!=(double n, const matrix &a)
Definition: matrix.h:146
friend matrix acos(const matrix &)
Definition: mat_math.cpp:50
double * p
Definition: matrix.h:10
matrix round(const matrix &)
Definition: mat_math.cpp:232
friend matrix sin(const matrix &)
Definition: mat_math.cpp:22
int active
Definition: matrix.h:351
matrix zeros(int nfil, int ncol)
Definition: matrix.cpp:1349
~matrix()
Destructor.
Definition: matrix.cpp:38
friend matrix tan(const matrix &)
Definition: mat_math.cpp:36
const matrix block(int irow1, int irow2, int icol1, int icol2) const
Definition: matrix.cpp:1134
const matrix_map col(int icol) const
Definition: matrix_map.cpp:72
matrix operator==(const matrix &) const
Definition: matrix.cpp:566
friend matrix abs(const matrix &)
Definition: mat_math.cpp:190
friend matrix round(const matrix &)
Definition: mat_math.cpp:232
friend matrix_block_diag operator-(const matrix_block_diag &)
Definition: matrix_block_diag.cpp:329
friend matrix atan2(const matrix &, const matrix &)
Definition: mat_math.cpp:246
matrix operator,(const matrix &, const matrix_block_diag &)
Definition: matrix_block_diag.cpp:180
int nrows() const
Returns the number of rows of the matrix.
Definition: matrix.cpp:62
matrix operator+(const matrix &) const
Performs matrix addition.
Definition: matrix.cpp:320
matrix operator<=(double n, const matrix &a)
Definition: matrix.h:149
matrix transpose() const
Definition: matrix.cpp:1281
matrix * m
Definition: matrix.h:203
create_double_map(const std::string &key, const double &val)
Definition: matrix.h:261
friend matrix cosh(const matrix &)
Definition: mat_math.cpp:92
double min(const matrix &)
Definition: matrix.cpp:1430
matrix_map & operator+=(const matrix_map &d)
Definition: matrix_map.cpp:239
const matrix row(int irow) const
Definition: matrix.cpp:1046
matrix vector(double x0, double x1, int n)
Definition: matrix.cpp:1404
friend int exist(const matrix &)
Definition: matrix.cpp:1527
friend matrix pow(const matrix &, const matrix &)
Definition: mat_math.cpp:293
int nblocks() const
Definition: matrix_block_diag.cpp:119
int write(FILE *fp=stdout, char mode='t') const
Saves matrix to a file.
Definition: matrix.cpp:233
matrix & redim(int nrow, int ncol)
Re-dimension the matrix.
Definition: matrix.cpp:122
matrix operator>(double n, const matrix &a)
Definition: matrix.h:148
create_matrix_map & operator()(const std::string &key, const matrix &val)
Definition: matrix.h:329
matrix_map_elem & operator=(const double_map &)
Definition: matrix_map.cpp:15
matrix abs(const matrix &)
Definition: mat_math.cpp:190
int ncols() const
Returns the columns of rows of the matrix.
Definition: matrix.cpp:69
matrix_map & operator*=(const double_map &d)
Definition: matrix_map.cpp:213
matrix_map operator*(double d) const
Definition: matrix_map.cpp:179
const matrix_map row(int irow) const
Definition: matrix_map.cpp:63
matrix_map & operator/=(const double_map &d)
Definition: matrix_map.cpp:226
friend double max(const matrix &)
Definition: matrix.cpp:1416
matrix_block_diag operator/(const matrix &) const
Definition: matrix_block_diag.cpp:225
matrix operator&&(double n, const matrix &a)
Definition: matrix.h:151
matrix & operator*=(const matrix &)
Definition: matrix.cpp:955
friend matrix random_matrix(int nfil, int ncol)
Definition: matrix.cpp:1361
matrix & operator+=(const matrix &)
Definition: matrix.cpp:903
friend matrix_block_diag operator+(const matrix_block_diag &)
Definition: matrix.h:241
friend double mean(const matrix &)
Definition: matrix.cpp:1457
double mean(const matrix &)
Definition: matrix.cpp:1457
matrix & dim(int nrow, int ncol)
Re-dimension the matrix.
Definition: matrix.cpp:85
matrix operator>=(double n, const matrix &a)
Definition: matrix.h:150
matrix row(int n) const
Definition: matrix_block_diag.cpp:341
matrix & setcol(int icol, const matrix &)
Definition: matrix.cpp:1110
matrix(int nfil=1, int ncol=1)
Default matrix constructor.
Definition: matrix.cpp:15
matrix & setrow(int irow, const matrix &)
Definition: matrix.cpp:1066
matrix operator<(double n, const matrix &a)
Definition: matrix.h:147
matrix operator+(double n, const matrix &a)
Definition: matrix.h:139
matrix sinh(const matrix &)
Definition: mat_math.cpp:106
matrix eye(int n)
Definition: matrix.cpp:1375
void stop()
Definition: matrix.h:355
friend matrix asin(const matrix &)
Definition: mat_math.cpp:64
timeval tim
Definition: matrix.h:349
matrix_block_diag transpose() const
Definition: matrix_block_diag.cpp:404
matrix_block_diag & operator=(const matrix_block_diag &)
Definition: matrix_block_diag.cpp:48
void reset()
Definition: matrix.h:353
matrix operator>=(const matrix &) const
Definition: matrix.cpp:734