source: pacpusframework/trunk/include/Pacpus/PacpusTools/matrice.h@ 70

Last change on this file since 70 was 70, checked in by Marek Kurdej, 11 years ago

Added: more documentation.

  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1// This file is part of the PACPUS framework distributed under the
2// CECILL-C License, Version 1.0.
3//
4/// @file
5/// @author Firstname Surname <firstname.surname@utc.fr>
6/// @date Month, Year
7/// @version $Id: matrice.h 70 2013-01-10 10:24:23Z kurdejma $
8/// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
9/// @brief Matrix algebra functions.
10///
11/// Detailed description.
12
13#ifndef MATRIX_H
14#define MATRIX_H
15
16typedef enum
17{
18 ONES,
19 ZEROS,
20 IDENTITY
21} t_m;
22
23/// Simple matrix.
24/// @todo Documentation
25class matrice
26{
27 typedef double *ligne;
28 ligne *lignes;
29 unsigned short int n; // Nombre de lignes (1erparamètre).
30 unsigned short int m; // Nombre de colonnes (2èmeparamètre).
31
32public:
33 /// Ctor
34 matrice();
35 /// Ctor
36 matrice(unsigned short int nl, unsigned short int nc);
37 /// Ctor
38 matrice(unsigned short int nl, unsigned short int nc,t_m type);
39 /// Copy ctor
40 matrice(const matrice &source); //constructeur par copie
41 /// Dtor
42 virtual ~matrice(void);
43
44 /// Allocates matrix data
45 /// @todo Rename
46 void Alloue(unsigned short int nl, unsigned short int nc);
47
48 /// Assignment operator for matrix operand
49 matrice &operator=(const matrice &m);//m=m1
50 /// Assignment operator for scalar operand
51 matrice &operator=(double x); //m=x
52 /// Conversion operator to double
53 /// @todo FIXME
54 operator double() const
55 {
56 return **lignes;
57 }
58
59 /// @todo Documentation
60 matrice &operator+=(const matrice &m); //m+=m1
61 /// @todo Documentation
62 matrice &operator-=(const matrice &m); //m-=m1
63
64 /// @todo Documentation
65 matrice operator+(const matrice &m1) const; //m=m1+m2
66 /// @todo Documentation
67 matrice operator-(const matrice &m1) const; //m=m1-m2
68 /// @todo Documentation
69 matrice operator*(const matrice &m1) const; //m=m1*m2
70
71 /// @todo Documentation
72 matrice &operator+=(double x); //m+=x
73 /// @todo Documentation
74 matrice &operator-=(double x); //m-=x
75
76 /// @todo Documentation
77 matrice operator+(double x)const; //m+x
78 /// @todo Documentation
79 matrice operator-(double x)const; //m-x
80 /// @todo Documentation
81 matrice operator*(double x)const; //m*x
82 /// @todo Documentation
83 matrice operator/(double x)const; //m/x
84
85 /// @todo Documentation
86 friend matrice operator+(double x,matrice m1) {return m1+x ;} // x+m ;
87 /// @todo Documentation
88 friend matrice operator-(double x,matrice m1) {return m1-x ;} // x-m ;
89 /// @todo Documentation
90 friend matrice operator*(double x,matrice m1) {return m1*x ;} // x*m ;
91
92 /// Matrix transpose.
93 matrice T();
94 /// Matrix inverse.
95 matrice I();
96
97 /// @todo Documentation
98 double &operator()(unsigned short int i, unsigned short int j); // ecriture m(i,j)=x
99 /// @todo Documentation
100 double operator()(unsigned short int i, unsigned short int j) const; //lecture x=m(i,j)
101 /// @todo Documentation
102 double &operator()(unsigned short int i); // ecriture m(i)=x
103 /// @todo Documentation
104 double operator()(unsigned short int i) const; //lecture x=m(i)
105
106 /// @todo Documentation
107 void print(const char *nom);
108};
109
110#endif // MATRIX_H
Note: See TracBrowser for help on using the repository browser.