xc
MExpressionMatrix.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. Pérez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //MExpressionMatrix.h
22 //Matrix of matrices of expressions (or by boxes)
23 #ifndef MEXPRESSIONMATRIX_H
24 #define MEXPRESSIONMATRIX_H
25 
26 #include "ExpressionMatrix.h"
27 #include "matrix_by_boxes.h"
28 
29 class MMatrix;
30 class ExprAlgebra;
31 
33 
35  {
36  void eval(void);
37  void eval(const char *palabra,const ExprAlgebra &a);
38  void eval(const char *palabra,const double &d);
39  public:
41  MExpressionMatrix(size_type n_rows,size_type cols) : m_expression_matrix(n_rows,cols) {}
42  MExpressionMatrix(size_type n_rows,size_type cols,const ExpressionMatrix &val)
43  : m_expression_matrix(n_rows,cols,val) {}
45  MExpressionMatrix& operator=(const MExpressionMatrix &m)
46  {
48  return *this;
49  }
50  bool Evaluable(void) const;
51  MExpressionMatrix Eval(void) const;
52  MExpressionMatrix Eval(const char *palabra,const ExprAlgebra &a);
53  MExpressionMatrix Eval(const char *palabra,const double &d);
54  MMatrix ToNum(void) const;
55  MMatrix ToNum(const char *palabra,const double &d) const;
56  MExpressionMatrix &operator*=(const ExpressionMatrix &m);
57  MExpressionMatrix &operator*=(const double &d);
58  MExpressionMatrix &operator*=(const MExpressionMatrix &m);
59 
60  friend MExpressionMatrix operator+(const MExpressionMatrix &m1,const MExpressionMatrix &m2);
61  friend MExpressionMatrix operator-(const MExpressionMatrix &m1,const MExpressionMatrix &m2);
62  friend MExpressionMatrix operator*(const MExpressionMatrix &m,const double &d)
63 ;
64  friend MExpressionMatrix operator*(const double &d,const MExpressionMatrix &m)
65  { return m*d; }
66  friend MExpressionMatrix operator*(const MExpressionMatrix &m1,const MExpressionMatrix &m2);
67  friend MExpressionMatrix operator*(const ExpressionMatrix &m,const MExpressionMatrix &mM);
68  friend MExpressionMatrix operator*(const MExpressionMatrix &mM, const ExpressionMatrix &m)
69  { return m*mM; }
70  };
71 
72 
73 #endif
Matrix made of boxes.
Definition: matrix_by_boxes.h:31
Definition: ExpressionMatrix.h:33
MatrixByBoxes & operator=(const MatrixByBoxes &m)
Assignment operator.
Definition: matrix_by_boxes.h:112
Expresión algebraica.
Definition: ExprAlgebra.h:32
Definition: MExpressionMatrix.h:34
Definition: MMatrix.h:33