]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/kernel/marMatrix.h
creaMaracasVisu Library
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / marMatrix.h
1 // marMatrix.h: interface for the marMatrix class.
2 //
3 //////////////////////////////////////////////////////////////////////
4
5 #include <iostream>
6 #include <stddef.h>
7 #include "marVector.h"
8
9 class marMatrix  
10 {
11 public:
12 /*==Constructeurs========================================*/
13         marMatrix(const marMatrix &m);
14         marMatrix(double * data,size_t size1=3,size_t size2=3);
15         marMatrix(size_t size1,size_t size2);
16 /*==Constructeurs========================================*/
17         virtual ~marMatrix();
18
19 /*==opérateurss========================================*/
20     friend std::ostream& operator<<(std::ostream& os, const marMatrix& m);
21  
22         marMatrix& operator=( const marMatrix& o );
23     marMatrix& operator=( double o );
24     marMatrix& operator=( double* o );
25
26     operator double*( ) const;
27
28     double& operator()( size_t i, size_t j );
29     const double& operator()( size_t i, size_t j ) const;
30
31     marMatrix operator+( const marMatrix& o );
32     marMatrix operator+( double o );
33     marMatrix operator+( double* o );
34
35         marMatrix operator-( const marMatrix& o );
36     marMatrix operator-( double o );
37     marMatrix operator-( double* o );
38
39         marMatrix operator*( const marMatrix& o );
40     marVector operator*( const marVector& o );
41     marMatrix operator*( double o );
42
43     bool operator==( const marMatrix& o ) const;
44     bool operator!=( const marMatrix& o ) const;
45
46 /*==MĂ©thodes========================================*/
47         size_t columns() const;
48         size_t rows() const;
49
50 /*==Attributs========================================*/
51 private:
52         bool shallowCopy; // true if _data is a shallow copy of original data (pointer copy)
53         size_t _size1;
54         size_t _size2;
55         double* _data;
56 };
57