CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
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-2019 all CASToR contributors listed below:
18 
19  --> Didier BENOIT, Claude COMTAT, Marina FILIPOVIC, Thibaut MERLIN, Mael MILLARDET, Simon STUTE, Valentin VIELZEUF
20 
21 This is CASToR version 3.0.
22 */
23 
30 #ifndef OMATRIX_HH
31 #define OMATRIX_HH 1
32 
33 #include "gVariables.hh"
34 #include "sOutputManager.hh"
35 
41 class oMatrix
42 {
43  // Constructor & Destructor
44  public:
49  oMatrix();
54  ~oMatrix();
61  oMatrix(uint16_t nl, uint16_t nc);
62 
63 
64  // -------------------------------------------------------------------
65  // Public member functions
66  public:
73  void Allocate(uint16_t nl, uint16_t nc);
82  int SetMatriceElt(uint16_t l, uint16_t c, HPFLTNB a_val);
90  HPFLTNB GetMatriceElt(uint16_t l,uint16_t c);
95  HPFLTNB** GetMtx() {return m2p_Mat; }
104  int Multiplication(oMatrix *ap_Mtx, oMatrix *ap_MtxResult);
111  int Transpose(oMatrix *a_MtxResult);
121  int Inverse(oMatrix *ap_MtxResult);
128  int SetXRotMtx(HPFLTNB ang);
129 
136  int SetYRotMtx(HPFLTNB ang);
137 
144  int SetZRotMtx(HPFLTNB ang);
145 
146 
151  void Describe();
152 
153  // -------------------------------------------------------------------
154  // Data members. (Nb lines/colons set public in order to optimize Multiplication function)
155  public:
156  uint16_t m_lin;
157  uint16_t m_col;
158  private:
160 };
161 
162 #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:285
#define HPFLTNB
Definition: gVariables.hh:83
~oMatrix()
oMatrix destructor. Free memory of the oMatrix object.
Definition: oMatrix.cc:80
oMatrix()
oMatrix constructor. Initialize the member variables to their default values.
Definition: oMatrix.cc:40
uint16_t m_lin
Definition: oMatrix.hh:156
HPFLTNB ** GetMtx()
Definition: oMatrix.hh:95
HPFLTNB GetMatriceElt(uint16_t l, uint16_t c)
Definition: oMatrix.cc:165
void Describe()
Display the element of the matrix.
Definition: oMatrix.cc:472
uint16_t m_col
Definition: oMatrix.hh:157
Declaration of class sOutputManager.
HPFLTNB ** m2p_Mat
Definition: oMatrix.hh:159
Structure designed for basic matrices operations.
Definition: oMatrix.hh:41
int SetXRotMtx(HPFLTNB ang)
Set a (3,3) X-axis rotation matrix using the provided angle.
Definition: oMatrix.cc:372
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:184
int SetMatriceElt(uint16_t l, uint16_t c, HPFLTNB a_val)
Set the matrix element corresponding to the argument indices with the provided value.
Definition: oMatrix.cc:138
int SetZRotMtx(HPFLTNB ang)
Set a (3,3) Z-axis rotation matrix using the provided angle.
Definition: oMatrix.cc:440
int SetYRotMtx(HPFLTNB ang)
Set a (3,3) Y-axis rotation matrix using the provided angle.
Definition: oMatrix.cc:406
int Transpose(oMatrix *a_MtxResult)
Transpose the elements of the matrix.
Definition: oMatrix.cc:228
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:100