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 20 - (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 12 /**
101 :     * \brief This function initialize the meanLength vector
102 :     * \param maxlengthgroupgrowth max length of the meanLength vector
103 :     * \param tmpPower the power term of the length
104 :     */
105 : agomez 20 double* meanlengthvecPow_initilize( int maxlengthgroupgrowth, double tmpPower) const;
106 : agomez 1 protected:
107 :     /**
108 :     * \brief This is the flag to denote whether an error has occured or not
109 :     */
110 :     int error;
111 :     /**
112 :     * \brief This is the size of the length group
113 :     */
114 :     int size;
115 :     /**
116 :     * \brief This is the step length for each length group
117 :     */
118 :     double Dl;
119 :     /**
120 :     * \brief This is the minimum length of the smallest length group
121 :     */
122 :     double minlen;
123 :     /**
124 :     * \brief This is the maximum length of the biggest length group
125 :     */
126 :     double maxlen;
127 :     /**
128 :     * \brief This is the DoubleVector of the mean lengths for each length group
129 :     */
130 :     DoubleVector meanlength;
131 :     /**
132 :     * \brief This is the DoubleVector of the minimum lengths for each length group
133 :     */
134 :     DoubleVector minlength;
135 : ulcessvp 2
136 : agomez 1 };
137 :    
138 :     /**
139 :     * \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
140 :     * \param finer is the LengthGroupDivision that should be on a finer scale
141 :     * \param coarser is the LengthGroupDivision that should be on a coarser scale
142 :     * \return 1 if the structure of the LengthGroupDivision objects are compatible, 0 otherwise
143 :     */
144 :     extern int checkLengthGroupStructure(const LengthGroupDivision* finer,
145 :     const LengthGroupDivision* coarser);
146 :    
147 :     #endif

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

Powered By FusionForge