CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
18 extern "C" {
19  #include <matrix.h>
20  #include <matrix2.h>
21 }
22 
23 // Meschach external (matrix.h) defines C++-incompatible macros
24 // which break other code (e.g. standard <limits>).
25 // Since these are not used here, undef them.
26 #undef max
27 #undef min
28 #undef catch
29 #undef Real
30 
32 {
33 public:
34  MatrixMeschach( );
35  MatrixMeschach( ALIint NoCol, ALIint NoLin );
36  MatrixMeschach( const MatrixMeschach& mat );
38 
39  void AddData( ALIuint col, ALIuint lin, ALIdouble data );
40  void transpose();
41  void inverse();
42  void Dump( const ALIstring& mtext );
43  void ostrDump( std::ostream& fout, const ALIstring& mtext );
44  void EliminateLines( ALIint lin_first, ALIint lin_last );
45  void EliminateColumns( ALIint lin_first, ALIint lin_last );
47 
48 
50  void operator*=( const MatrixMeschach& mat );
51  void operator+=( const MatrixMeschach& mat );
52  void operator*=( const ALIdouble num );
53  ALIdouble operator () (int i, int j) const;
54 
55 //ACCESS PRIVATE DATA MEMBERS
56  ALIint NoLines() const{
57  return _NoLines;
58  }
59  ALIint NoColumns() const{
60  return _NoColumns;
61  }
62  void setNoColumns( ALIint ncol ){
63  _NoColumns = ncol;
64  }
65  void setNoLines( ALIint nlin ){
66  _NoLines = nlin;
67  }
68  const MAT* Mat() const{
69  return _Mat;
70  }
71  void setMat( MAT* mat){
72  _Mat = mat;
73  }
74  MAT* MatNonConst() const{
75  return _Mat;
76  }
77 
78 
79 private:
80  // private data members
83  // vector< ALIdouble> _data;
84  MAT* _Mat;
85 
86  void copy( const MatrixMeschach& mat);
87 
88 };
89 
90 MatrixMeschach operator*( const MatrixMeschach& mat1, const MatrixMeschach& mat2 );
91 MatrixMeschach operator+( const MatrixMeschach& mat1, const MatrixMeschach& mat2 );
92 MatrixMeschach operator-( const MatrixMeschach& mat1, const MatrixMeschach& mat2 );
93 MatrixMeschach operator*( const ALIdouble doub, const MatrixMeschach& mat );
94 MatrixMeschach operator*( const MatrixMeschach& mat, const ALIdouble doub );
95 
96 MatrixMeschach* MatrixByMatrix( const MatrixMeschach& mat1, const MatrixMeschach& mat2 );
98 
99 #endif
void copy(const MatrixMeschach &mat)
int i
Definition: DBlmapReader.cc:9
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)
int j
Definition: DBlmapReader.cc:9
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:82
std::string ALIstring
Definition: CocoaGlobals.h:9
void operator*=(const MatrixMeschach &mat)
MatrixMeschach operator*(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
MatrixMeschach & operator=(const MatrixMeschach &mat)
int col
Definition: cuy.py:1008
void setNoLines(ALIint nlin)
void setMat(MAT *mat)
void Dump(const ALIstring &mtext)
unsigned int ALIuint
Definition: CocoaGlobals.h:17