Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Annotation of /trunk/gadget/formulamatrix.h
[mareframe] / trunk / gadget / formulamatrix.h Repository:
ViewVC logotype

Annotation of /trunk/gadget/formulamatrix.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef formulamatrix_h
2 :     #define formulamatrix_h
3 :    
4 :     #include "intvector.h"
5 :     #include "formulavector.h"
6 :    
7 :     /**
8 :     * \class FormulaMatrix
9 :     * \brief This class implements a dynamic vector of FormulaVector values
10 :     */
11 :     class FormulaMatrix {
12 :     public:
13 :     /**
14 :     * \brief This is the default FormulaMatrix constructor
15 :     */
16 :     FormulaMatrix() { nrow = 0; v = 0; };
17 :     /**
18 :     * \brief This is the FormulaMatrix constructor for a specified size
19 :     * \param nr is the size of the vector to be created
20 :     * \param nc is the length of each row to be created (ie. the size of the FormulaVector to be created for each row)
21 :     * \param initial is the initial value for all the entries of the vector
22 :     */
23 :     FormulaMatrix(int nr, int nc, Formula initial);
24 :     /**
25 :     * \brief This is the FormulaMatrix constructor for a specified size
26 :     * \param nr is the size of the vector to be created
27 :     * \param nc is the length of each row to be created (ie. the size of the FormulaVector to be created for each row)
28 :     * \param initial is the initial value for all the entries of the vector
29 :     */
30 :     FormulaMatrix(int nr, int nc, double initial);
31 :     /**
32 :     * \brief This is the FormulaMatrix destructor
33 :     * \note This will free all the memory allocated to all the elements of the vector
34 :     */
35 :     ~FormulaMatrix();
36 :     /**
37 :     * \brief This will return the number of columns in row i of the vector
38 :     * \param i is the row of the vector to have the number of columns counted
39 :     * \return the number of columns in row i of the vector
40 :     * \note This is the number of entries in the FormulaVector that is entry i of the FormulaMatrix
41 :     */
42 :     int Ncol(int i = 0) const { return v[i]->Size(); };
43 :     /**
44 :     * \brief This will return the number of rows of the vector
45 :     * \return the number of rows of the vector
46 :     */
47 :     int Nrow() const { return nrow; };
48 :     /**
49 :     * \brief This will return the value of an element of the vector
50 :     * \param pos is the element of the vector to be returned
51 :     * \return the value of the specified element
52 :     */
53 :     FormulaVector& operator [] (int pos) { return *v[pos]; };
54 :     /**
55 :     * \brief This will return the value of an element of the vector
56 :     * \param pos is the element of the vector to be returned
57 :     * \return the value of the specified element
58 :     */
59 :     const FormulaVector& operator [] (int pos) const { return *v[pos]; };
60 :     /**
61 :     * \brief This will add new entries to the vector
62 :     * \param add is the number of new entries to the vector
63 :     * \param length is the number of entries to the FormulaVector that is created
64 :     * \param value is the value that will be entered for the new entries
65 :     */
66 :     void AddRows(int add, int length, Formula value);
67 :     /**
68 :     * \brief This will add new entries to the vector
69 :     * \param add is the number of new entries to the vector
70 :     * \param length is the number of entries to the FormulaVector that is created
71 :     * \param value is the value that will be entered for the new entries
72 :     */
73 :     void AddRows(int add, int length, double value);
74 :     /**
75 :     * \brief This function will inform Keeper of the values of the stored Formula
76 :     * \param keeper is the Keeper for the current model
77 :     */
78 :     void Inform(Keeper* keeper);
79 :     protected:
80 :     /**
81 :     * \brief This is number of rows of the vector
82 :     */
83 :     int nrow;
84 :     /**
85 :     * \brief This is the vector of FormulaVector values
86 :     */
87 :     FormulaVector** v;
88 :     };
89 :    
90 :     #endif

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge