00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef LOCA_PARAMETER_VECTOR_H
00043 #define LOCA_PARAMETER_VECTOR_H
00044
00045 #include "NOX_Common.H"
00046
00047
00048 namespace LOCA {
00049 class GlobalData;
00050 }
00051
00052 namespace LOCA {
00053
00061 class ParameterVector {
00062
00063 public:
00064
00066 ParameterVector();
00067
00069 ParameterVector(const ParameterVector& source);
00070
00072 ParameterVector* clone() const;
00073
00075 ~ParameterVector();
00076
00078 int addParameter(string label, double value = 0.0);
00079
00081 bool init(double value);
00082
00084 bool scale(double value);
00085
00087 bool scale(const ParameterVector& p);
00088
00090 bool update(double alpha, const ParameterVector& alphaVector, double b);
00091
00093 ParameterVector& operator=(const ParameterVector& y);
00094
00096 double& operator[] (unsigned int i);
00097
00099 const double& operator[] (unsigned int i) const;
00100
00102 void setValue(unsigned int i, double value);
00103
00105 void setValue(string label, double value);
00106
00108 double getValue(unsigned int i) const;
00109
00111 double getValue(string label) const;
00112
00114 int getIndex(string label) const;
00115
00117 double* getDoubleArrayPointer();
00118
00120 bool isParameter(string label) const;
00121
00123 string getLabel(unsigned int i) const;
00124
00126 int length() const;
00127
00129 void print(ostream& stream) const;
00130
00132 const vector<double>& getValuesVector() const;
00133
00135 const vector<string>& getNamesVector() const;
00136
00137 protected:
00138
00140 vector<double> x;
00141
00143 vector<string> l;
00144
00145 };
00146 }
00147
00149 ostream& operator<<(ostream& stream, const LOCA::ParameterVector& p);
00150
00151 #endif