CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
oMatrix.hh
Go to the documentation of this file.
1 /*
2 This file is part of CASToR.
3 
4  CASToR is free software: you can redistribute it and/or modify it under the
5  terms of the GNU General Public License as published by the Free Software
6  Foundation, either version 3 of the License, or (at your option) any later
7  version.
8 
9  CASToR is distributed in the hope that it will be useful, but WITHOUT ANY
10  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12  details.
13 
14  You should have received a copy of the GNU General Public License along with
15  CASToR (in file GNU_GPL.TXT). If not, see <http://www.gnu.org/licenses/>.
16 
17 Copyright 2017-2018 all CASToR contributors listed below:
18 
19  --> current contributors: Thibaut MERLIN, Simon STUTE, Didier BENOIT, Claude COMTAT, Marina FILIPOVIC, Mael MILLARDET
20  --> past contributors: Valentin VIELZEUF
21 
22 This is CASToR version 2.0.
23 */
24 
31 #ifndef OMATRIX_HH
32 #define OMATRIX_HH 1
33 
34 #include "gVariables.hh"
35 #include "sOutputManager.hh"
36 
42 class oMatrix
43 {
44  // Constructor & Destructor
45  public:
50  oMatrix();
55  ~oMatrix();
62  oMatrix(uint16_t nl, uint16_t nc);
63 
64 
65  // -------------------------------------------------------------------
66  // Public member functions
67  public:
74  void Allocate(uint16_t nl, uint16_t nc);
83  int SetMatriceElt(uint16_t l, uint16_t c, FLTNB a_val);
91  FLTNB GetMatriceElt(uint16_t l,uint16_t c);
96  FLTNB** GetMtx() {return m2p_Mat; }
105  int Multiplication(oMatrix *ap_Mtx, oMatrix *ap_MtxResult);
112  int Transpose(oMatrix *a_MtxResult);
122  int Inverse(oMatrix *ap_MtxResult);
129  int SetXRotMtx(FLTNB ang);
130 
137  int SetYRotMtx(FLTNB ang);
138 
145  int SetZRotMtx(FLTNB ang);
146 
147 
152  void Describe();
153 
154  // -------------------------------------------------------------------
155  // Data members. (Nb lines/colons set public in order to optimize Multiplication function)
156  public:
157  uint16_t m_lin;
158  uint16_t m_col;
159  private:
161 };
162 
163 #endif
This header file is mainly used to declare some macro definitions and all includes needed from the st...
int Inverse(oMatrix *ap_MtxResult)
Inverse the matrix on which the function is called An error is returned if the matrix is not square...
Definition: oMatrix.cc:286
#define FLTNB
Definition: gVariables.hh:81
FLTNB GetMatriceElt(uint16_t l, uint16_t c)
Definition: oMatrix.cc:166
~oMatrix()
oMatrix destructor. Free memory of the oMatrix object.
Definition: oMatrix.cc:81
FLTNB ** GetMtx()
Definition: oMatrix.hh:96
oMatrix()
oMatrix constructor. Initialize the member variables to their default values.
Definition: oMatrix.cc:41
int SetMatriceElt(uint16_t l, uint16_t c, FLTNB a_val)
Set the matrix element corresponding to the argument indices with the provided value.
Definition: oMatrix.cc:139
uint16_t m_lin
Definition: oMatrix.hh:157
void Describe()
Display the element of the matrix.
Definition: oMatrix.cc:473
uint16_t m_col
Definition: oMatrix.hh:158
int SetZRotMtx(FLTNB ang)
Set a (3,3) Z-axis rotation matrix using the provided angle.
Definition: oMatrix.cc:441
Declaration of class sOutputManager.
int SetXRotMtx(FLTNB ang)
Set a (3,3) X-axis rotation matrix using the provided angle.
Definition: oMatrix.cc:373
int SetYRotMtx(FLTNB ang)
Set a (3,3) Y-axis rotation matrix using the provided angle.
Definition: oMatrix.cc:407
Structure designed for basic matrices operations.
Definition: oMatrix.hh:42
int Multiplication(oMatrix *ap_Mtx, oMatrix *ap_MtxResult)
Multiply the member matrix with the matrix provided in 1st parameter Return the result in the matric ...
Definition: oMatrix.cc:185
FLTNB ** m2p_Mat
Definition: oMatrix.hh:160
int Transpose(oMatrix *a_MtxResult)
Transpose the elements of the matrix.
Definition: oMatrix.cc:229
void Allocate(uint16_t nl, uint16_t nc)
Instanciate a Matrix structure with the number of lines and colons provided in parameters.
Definition: oMatrix.cc:101