1 : |
agomez |
1 |
#ifndef doublematrixptrmatrix_h
|
2 : |
|
|
#define doublematrixptrmatrix_h
|
3 : |
|
|
|
4 : |
|
|
#include "intvector.h" |
5 : |
|
|
#include "doublematrixptrvector.h" |
6 : |
|
|
|
7 : |
|
|
class DoubleMatrix;
|
8 : |
|
|
|
9 : |
|
|
/**
|
10 : |
|
|
* \class DoubleMatrixPtrMatrix
|
11 : |
|
|
* \brief This class implements a dynamic vector of DoubleMatrixPtrVector values
|
12 : |
|
|
*/
|
13 : |
|
|
class DoubleMatrixPtrMatrix {
|
14 : |
|
|
public:
|
15 : |
|
|
/**
|
16 : |
|
|
* \brief This is the default DoubleMatrixPtrMatrix constructor
|
17 : |
|
|
*/
|
18 : |
|
|
DoubleMatrixPtrMatrix() { nrow = 0; v = 0; };
|
19 : |
|
|
/**
|
20 : |
|
|
* \brief This is the DoubleMatrixPtrMatrix destructor
|
21 : |
|
|
* \note This will free all the memory allocated to all the elements of the vector
|
22 : |
|
|
*/
|
23 : |
|
|
~DoubleMatrixPtrMatrix();
|
24 : |
|
|
/**
|
25 : |
|
|
* \brief This will return the number of columns in row i of the vector
|
26 : |
|
|
* \param i is the row of the vector to have the number of columns counted
|
27 : |
|
|
* \return the number of columns in row i of the vector
|
28 : |
|
|
* \note This is the number of entries in the DoubleMatrixPtrVector that is entry i of the DoubleMatrixPtrMatrix
|
29 : |
|
|
*/
|
30 : |
|
|
int Ncol(int i = 0) const { return v[i]->Size(); };
|
31 : |
|
|
/**
|
32 : |
|
|
* \brief This will return the number of rows of the vector
|
33 : |
|
|
* \return the number of rows of the vector
|
34 : |
|
|
*/
|
35 : |
|
|
int Nrow() const { return nrow; };
|
36 : |
|
|
/**
|
37 : |
|
|
* \brief This will return the value of an element of the vector
|
38 : |
|
|
* \param pos is the element of the vector to be returned
|
39 : |
|
|
* \return the value of the specified element
|
40 : |
|
|
*/
|
41 : |
|
|
DoubleMatrixPtrVector& operator [] (int pos) { return *v[pos]; };
|
42 : |
|
|
/**
|
43 : |
|
|
* \brief This will return the value of an element of the vector
|
44 : |
|
|
* \param pos is the element of the vector to be returned
|
45 : |
|
|
* \return the value of the specified element
|
46 : |
|
|
*/
|
47 : |
|
|
const DoubleMatrixPtrVector& operator [] (int pos) const { return *v[pos]; };
|
48 : |
|
|
/**
|
49 : |
|
|
* \brief This will add one new empty entry to the vector
|
50 : |
|
|
* \note The new element of the vector will be created, and set to zero
|
51 : |
|
|
*/
|
52 : |
|
|
void resize();
|
53 : |
|
|
/**
|
54 : |
|
|
* \brief This will delete an entry from the vector
|
55 : |
|
|
* \param pos is the element of the vector to be deleted
|
56 : |
|
|
* \note This will free the memory allocated to the deleted element of the vector
|
57 : |
|
|
*/
|
58 : |
|
|
void Delete(int pos);
|
59 : |
|
|
protected:
|
60 : |
|
|
/**
|
61 : |
|
|
* \brief This is number of rows of the vector
|
62 : |
|
|
*/
|
63 : |
|
|
int nrow;
|
64 : |
|
|
/**
|
65 : |
|
|
* \brief This is the vector of DoubleMatrixPtrVector values
|
66 : |
|
|
*/
|
67 : |
|
|
DoubleMatrixPtrVector** v;
|
68 : |
|
|
};
|
69 : |
|
|
|
70 : |
|
|
#endif
|