CMS 3D CMS Logo

MatrixMeschach.h
Go to the documentation of this file.
1 // COCOA class header file
2 //Id: MatrixMeschach.h
3 //CAT: Model
4 //
5 // Class for matrices
6 //
7 // History: v1.0
8 // Pedro Arce
9 
10 #ifndef _ALIMATRIX_HH
11 #define _ALIMATRIX_HH
12 
14 #include <vector>
15 #include <iostream>
16 
17 extern "C" {
18 #include <matrix.h>
19 #include <matrix2.h>
20 }
21 
22 // Meschach external (matrix.h) defines C++-incompatible macros
23 // which break other code (e.g. standard <limits>).
24 // Since these are not used here, undef them.
25 #undef max
26 #undef min
27 #undef catch
28 #undef Real
29 
31 public:
33  MatrixMeschach(ALIint NoCol, ALIint NoLin);
34  MatrixMeschach(const MatrixMeschach& mat);
36 
38  void transpose();
39  void inverse();
40  void Dump(const ALIstring& mtext);
41  void ostrDump(std::ostream& fout, const ALIstring& mtext);
42  void EliminateLines(ALIint lin_first, ALIint lin_last);
43  void EliminateColumns(ALIint lin_first, ALIint lin_last);
45 
47  void operator*=(const MatrixMeschach& mat);
48  void operator+=(const MatrixMeschach& mat);
49  void operator*=(const ALIdouble num);
50  ALIdouble operator()(int i, int j) const;
51 
52  //ACCESS PRIVATE DATA MEMBERS
53  ALIint NoLines() const { return _NoLines; }
54  ALIint NoColumns() const { return _NoColumns; }
55  void setNoColumns(ALIint ncol) { _NoColumns = ncol; }
56  void setNoLines(ALIint nlin) { _NoLines = nlin; }
57  const MAT* Mat() const { return _Mat; }
58  void setMat(MAT* mat) { _Mat = mat; }
59  MAT* MatNonConst() const { return _Mat; }
60 
61 private:
62  // private data members
65  // vector< ALIdouble> _data;
66  MAT* _Mat;
67 
68  void copy(const MatrixMeschach& mat);
69 };
70 
71 MatrixMeschach operator*(const MatrixMeschach& mat1, const MatrixMeschach& mat2);
72 MatrixMeschach operator+(const MatrixMeschach& mat1, const MatrixMeschach& mat2);
73 MatrixMeschach operator-(const MatrixMeschach& mat1, const MatrixMeschach& mat2);
74 MatrixMeschach operator*(const ALIdouble doub, const MatrixMeschach& mat);
75 MatrixMeschach operator*(const MatrixMeschach& mat, const ALIdouble doub);
76 
79 
80 #endif
void copy(const MatrixMeschach &mat)
ALIint NoLines() const
long double ALIdouble
Definition: CocoaGlobals.h:11
ALIdouble operator()(int i, int j) const
MatrixMeschach operator+(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
MatrixMeschach operator-(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
MatrixMeschach * MatrixByMatrix(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
int ALIint
Definition: CocoaGlobals.h:15
ALIint NoColumns() const
void EliminateLines(ALIint lin_first, ALIint lin_last)
void operator+=(const MatrixMeschach &mat)
const MAT * Mat() const
void SetCorrelation(ALIint i1, ALIint i2, ALIdouble corr)
void EliminateColumns(ALIint lin_first, ALIint lin_last)
JetCorrectorParameters corr
Definition: classes.h:5
MatrixMeschach ALIMatrix
MAT * MatNonConst() const
void ostrDump(std::ostream &fout, const ALIstring &mtext)
void AddData(ALIuint col, ALIuint lin, ALIdouble data)
void setNoColumns(ALIint ncol)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::string ALIstring
Definition: CocoaGlobals.h:9
col
Definition: cuy.py:1010
void operator*=(const MatrixMeschach &mat)
MatrixMeschach operator*(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
MatrixMeschach & operator=(const MatrixMeschach &mat)
void setNoLines(ALIint nlin)
void setMat(MAT *mat)
void Dump(const ALIstring &mtext)
unsigned int ALIuint
Definition: CocoaGlobals.h:17