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/lengthgroup.h
[mareframe] / trunk / gadget / lengthgroup.h Repository:
ViewVC logotype

Annotation of /trunk/gadget/lengthgroup.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (view) (download)

1 : agomez 1 #ifndef lengthgroup_h
2 :     #define lengthgroup_h
3 :    
4 :     #include "doublevector.h"
5 :    
6 :     /**
7 :     * \class LengthGroupDivision
8 :     * \brief This is the class used to store information about the length groups of the modelled stock population
9 :     */
10 :     class LengthGroupDivision {
11 :     public:
12 :     /**
13 :     * \brief This is the LengthGroupDivision constructor with evenly spaced length groups
14 :     * \param minlength is the minimum length of the smallest length group
15 :     * \param maxlength is the maximum length of the biggest length group
16 :     * \param dl is the step length for each length group
17 :     */
18 :     LengthGroupDivision(double minlength, double maxlength, double dl);
19 :     /**
20 :     * \brief This is the LengthGroupDivision constructor with length groups that are possibly not evenly spaced
21 :     * \param vec is the DoubleVector containing the end point of each length group
22 :     */
23 :     LengthGroupDivision(const DoubleVector& vec);
24 :     /**
25 :     * \brief This is the LengthGroupDivision constructor that creates a copy of an existing LengthGroupDivision
26 :     * \param lgrpdiv is the LengthGroupDivision to copy
27 :     */
28 :     LengthGroupDivision(const LengthGroupDivision& lgrpdiv);
29 :     /**
30 :     * \brief This is the default LengthGroupDivision destructor
31 :     */
32 :     ~LengthGroupDivision() {};
33 :     /**
34 :     * \brief This function will return the mean length of a specified length group
35 :     * \param i is the identifier of the length group
36 :     * \return the mean length of the length group
37 :     */
38 : ulcessvp 2 double meanLength(int i) const {
39 :     if (i >= size)
40 :     return meanlength[size - 1];
41 :     return meanlength[i];
42 :     };
43 : agomez 1 /**
44 :     * \brief This function will return the minimum length of a specified length group
45 :     * \param i is the identifier of the length group
46 :     * \return the minimum length of the length group
47 :     */
48 :     double minLength(int i) const;
49 :     /**
50 :     * \brief This function will return the maximum length of a specified length group
51 :     * \param i is the identifier of the length group
52 :     * \return the maximum length of the length group
53 :     */
54 :     double maxLength(int i) const;
55 :     /**
56 :     * \brief This function will return the minimum length of the smallest length group
57 :     * \return the minimum length
58 :     */
59 :     double minLength() const { return minlen; };
60 :     /**
61 :     * \brief This function will return the maximum length of the biggest length group
62 :     * \return the maximum length
63 :     */
64 :     double maxLength() const { return maxlen; };
65 :     /**
66 :     * \brief This function will return the step length of the length groups
67 :     * \return the step length
68 :     */
69 :     double dl() const { return Dl; };
70 :     /**
71 :     * \brief This function will return the total number of the length groups
72 :     * \return the number of length groups
73 :     */
74 :     int numLengthGroups() const { return size; };
75 :     /**
76 :     * \brief This function will return the identifier of a length group containing a specified length
77 :     * \param len is the length to find in the length group
78 :     * \return the identifier of the length group
79 :     */
80 :     int numLengthGroup(double len) const;
81 :     /**
82 :     * \brief This function will combine a second LengthGroupDivision with the current LengthGroupDivision
83 :     * \return 1 if the LengthGroupDivision has been combined sucessfully, 0 otherwise
84 :     */
85 :     int Combine(const LengthGroupDivision* const addition);
86 :     /**
87 :     * \brief This function will return the flag denoting whether an error has occured or not
88 :     * \return error
89 :     */
90 :     int Error() const { return error; }
91 :     /**
92 :     * \brief This function will print an error message about the LengthGroupDivision
93 :     */
94 :     void printError() const;
95 :     /**
96 :     * \brief This function will print the LengthGroupDivision information
97 :     * \param outfile is the ofstream that the information gets sent to
98 :     */
99 :     void Print(ofstream& outfile) const;
100 : ulcessvp 2
101 :     //FIXME
102 :     double* const meanlengthvecPow_initilize( int maxlengthgroupgrowth, double tmpPower) const;
103 : agomez 1 protected:
104 :     /**
105 :     * \brief This is the flag to denote whether an error has occured or not
106 :     */
107 :     int error;
108 :     /**
109 :     * \brief This is the size of the length group
110 :     */
111 :     int size;
112 :     /**
113 :     * \brief This is the step length for each length group
114 :     */
115 :     double Dl;
116 :     /**
117 :     * \brief This is the minimum length of the smallest length group
118 :     */
119 :     double minlen;
120 :     /**
121 :     * \brief This is the maximum length of the biggest length group
122 :     */
123 :     double maxlen;
124 :     /**
125 :     * \brief This is the DoubleVector of the mean lengths for each length group
126 :     */
127 :     DoubleVector meanlength;
128 :     /**
129 :     * \brief This is the DoubleVector of the minimum lengths for each length group
130 :     */
131 :     DoubleVector minlength;
132 : ulcessvp 2
133 : agomez 1 };
134 :    
135 :     /**
136 :     * \brief This is the function that will check whether one LengthGroupDivision has length groups that are finer than a second LengthGroupDivision, and print an error if this is not the case
137 :     * \param finer is the LengthGroupDivision that should be on a finer scale
138 :     * \param coarser is the LengthGroupDivision that should be on a coarser scale
139 :     * \return 1 if the structure of the LengthGroupDivision objects are compatible, 0 otherwise
140 :     */
141 :     extern int checkLengthGroupStructure(const LengthGroupDivision* finer,
142 :     const LengthGroupDivision* coarser);
143 :    
144 :     #endif

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

Powered By FusionForge