#include <LOCA_Parameter_Vector.H>
Public Member Functions | |
ParameterVector () | |
Constructor. | |
ParameterVector (const ParameterVector &source) | |
Copy constructor. | |
ParameterVector * | clone () const |
Clone. | |
~ParameterVector () | |
Destructor. | |
int | addParameter (string label, double value=0.0) |
Adds a parameter to the list. Returns the index value assigned to the parameter. | |
bool | init (double value) |
Initialize the vector. Returns true if successful. | |
bool | scale (double value) |
Scales the entire vector by value. Returns true if successful. | |
bool | scale (const ParameterVector &p) |
Scales the vactor with another vector (element-wise multiply). Returns true if successful. | |
bool | update (double alpha, const ParameterVector &alphaVector, double b) |
Updates the parameter vector: this = alpha * alphaVector + b * this. Returns true if successful. | |
ParameterVector & | operator= (const ParameterVector &y) |
Set a parameter vector equal to another. This will erase any old parameters in the object. | |
double & | operator[] (unsigned int i) |
Return a reference to the i-th element. Will throw an error if index is out of range. | |
const double & | operator[] (unsigned int i) const |
Return a reference to the i-th element (no l-value type). Will throw an error if index is out of range. | |
void | setValue (unsigned int i, double value) |
Set the value of the parameter with index i. Will throw an error if index is out of range. | |
void | setValue (string label, double value) |
Set the value of the parameter with the corresponding label. Will throw an error if "label" is not valid. | |
double | getValue (unsigned int i) const |
Returns the value of the parameter with index i. Will throw an error if index is out of range. | |
double | getValue (string label) const |
Returns the value of the parameter with the corresponding label. Will throw an error if "label" is not valid. | |
int | getIndex (string label) const |
Returns the index of the parameter with the corresponding label. Returns a -1 if "label" is not found. | |
double * | getDoubleArrayPointer () |
Returns a pointer to a C-style array of the parameter values. | |
bool | isParameter (string label) const |
Returns true if the parameter string "label" corresponds to a parameter label in the object. | |
string | getLabel (unsigned int i) const |
Returns the label of the parameter with index i. | |
int | length () const |
Returns the length of parameter vector. | |
void | print (ostream &stream) const |
Prints the vector to cout. | |
const vector< double > & | getValuesVector () const |
Accessor to get the underlying stl vector with all parameter values. | |
const vector< string > & | getNamesVector () const |
Accessor to get the underlying stl vector with all parameter names. | |
Protected Attributes | |
vector< double > | x |
Parameter values. | |
vector< string > | l |
Parameter names. |
Definition at line 61 of file LOCA_Parameter_Vector.H.
LOCA::ParameterVector::ParameterVector | ( | ) |
LOCA::ParameterVector::ParameterVector | ( | const ParameterVector & | source | ) |
LOCA::ParameterVector::~ParameterVector | ( | ) |
LOCA::ParameterVector * LOCA::ParameterVector::clone | ( | ) | const |
int LOCA::ParameterVector::addParameter | ( | string | label, | |
double | value = 0.0 | |||
) |
Adds a parameter to the list. Returns the index value assigned to the parameter.
Definition at line 70 of file LOCA_Parameter_Vector.C.
Referenced by LOCA::Homotopy::DeflatedGroup::DeflatedGroup(), LOCA::Homotopy::Group::Group(), and LOCA::Epetra::ModelEvaluatorInterface::ModelEvaluatorInterface().
bool LOCA::ParameterVector::init | ( | double | value | ) |
Initialize the vector. Returns true if successful.
Definition at line 79 of file LOCA_Parameter_Vector.C.
References x.
bool LOCA::ParameterVector::scale | ( | double | value | ) |
Scales the entire vector by value. Returns true if successful.
Definition at line 87 of file LOCA_Parameter_Vector.C.
References x.
bool LOCA::ParameterVector::scale | ( | const ParameterVector & | p | ) |
Scales the vactor with another vector (element-wise multiply). Returns true if successful.
Definition at line 95 of file LOCA_Parameter_Vector.C.
References x.
bool LOCA::ParameterVector::update | ( | double | alpha, | |
const ParameterVector & | alphaVector, | |||
double | b | |||
) |
Updates the parameter vector: this = alpha * alphaVector + b * this. Returns true if successful.
Definition at line 107 of file LOCA_Parameter_Vector.C.
References x.
LOCA::ParameterVector & LOCA::ParameterVector::operator= | ( | const ParameterVector & | y | ) |
Set a parameter vector equal to another. This will erase any old parameters in the object.
Definition at line 122 of file LOCA_Parameter_Vector.C.
double & LOCA::ParameterVector::operator[] | ( | unsigned int | i | ) |
Return a reference to the i-th element. Will throw an error if index is out of range.
Definition at line 130 of file LOCA_Parameter_Vector.C.
References x.
const double & LOCA::ParameterVector::operator[] | ( | unsigned int | i | ) | const |
Return a reference to the i-th element (no l-value type). Will throw an error if index is out of range.
Definition at line 140 of file LOCA_Parameter_Vector.C.
References x.
void LOCA::ParameterVector::setValue | ( | unsigned int | i, | |
double | value | |||
) |
Set the value of the parameter with index i. Will throw an error if index is out of range.
Definition at line 150 of file LOCA_Parameter_Vector.C.
References x.
Referenced by LOCA::Thyra::Group::setParam(), LOCA::LAPACK::Group::setParam(), and LOCA::Epetra::Group::setParam().
void LOCA::ParameterVector::setValue | ( | string | label, | |
double | value | |||
) |
Set the value of the parameter with the corresponding label. Will throw an error if "label" is not valid.
Definition at line 162 of file LOCA_Parameter_Vector.C.
double LOCA::ParameterVector::getValue | ( | unsigned int | i | ) | const |
Returns the value of the parameter with index i. Will throw an error if index is out of range.
Definition at line 178 of file LOCA_Parameter_Vector.C.
References x.
Referenced by LOCA::Thyra::Group::getParam(), LOCA::LAPACK::Group::getParam(), LOCA::Homotopy::DeflatedGroup::getParam(), LOCA::Epetra::Group::getParam(), and LOCA::Homotopy::Group::setParams().
double LOCA::ParameterVector::getValue | ( | string | label | ) | const |
Returns the value of the parameter with the corresponding label. Will throw an error if "label" is not valid.
Definition at line 188 of file LOCA_Parameter_Vector.C.
int LOCA::ParameterVector::getIndex | ( | string | label | ) | const |
Returns the index of the parameter with the corresponding label. Returns a -1 if "label" is not found.
Definition at line 203 of file LOCA_Parameter_Vector.C.
Referenced by LOCA::Homotopy::DeflatedGroup::DeflatedGroup(), LOCA::TurningPoint::MooreSpence::ExtendedGroup::ExtendedGroup(), LOCA::TurningPoint::MinimallyAugmented::ExtendedGroup::ExtendedGroup(), LOCA::Pitchfork::MooreSpence::ExtendedGroup::ExtendedGroup(), LOCA::Pitchfork::MinimallyAugmented::ExtendedGroup::ExtendedGroup(), LOCA::Hopf::MooreSpence::ExtendedGroup::ExtendedGroup(), LOCA::Hopf::MinimallyAugmented::ExtendedGroup::ExtendedGroup(), LOCA::Homotopy::Group::Group(), LOCA::Stepper::reset(), LOCA::TurningPoint::MooreSpence::ExtendedGroup::setParam(), LOCA::Pitchfork::MooreSpence::ExtendedGroup::setParam(), LOCA::Pitchfork::MinimallyAugmented::ExtendedGroup::setParam(), LOCA::MultiContinuation::ConstrainedGroup::setParam(), LOCA::Hopf::MooreSpence::ExtendedGroup::setParam(), LOCA::Hopf::MinimallyAugmented::ExtendedGroup::setParam(), and LOCA::Homotopy::DeflatedGroup::setParam().
double * LOCA::ParameterVector::getDoubleArrayPointer | ( | ) |
Returns a pointer to a C-style array of the parameter values.
Definition at line 218 of file LOCA_Parameter_Vector.C.
References x.
Referenced by LOCA::Thyra::Group::Group().
bool LOCA::ParameterVector::isParameter | ( | string | label | ) | const |
Returns true if the parameter string "label" corresponds to a parameter label in the object.
Definition at line 224 of file LOCA_Parameter_Vector.C.
string LOCA::ParameterVector::getLabel | ( | unsigned int | i | ) | const |
Returns the label of the parameter with index i.
Definition at line 234 of file LOCA_Parameter_Vector.C.
References l.
Referenced by LOCA::MultiContinuation::ExtendedGroup::getContinuationParameterName(), and LOCA::MultiContinuation::ConstrainedGroup::printSolution().
int LOCA::ParameterVector::length | ( | ) | const |
Returns the length of parameter vector.
Definition at line 240 of file LOCA_Parameter_Vector.C.
References x.
Referenced by LOCA::Thyra::Group::computeDfDpMulti(), LOCA::Thyra::Group::Group(), LOCA::Epetra::ModelEvaluatorInterface::setParameters(), LOCA::Pitchfork::MinimallyAugmented::ExtendedGroup::setParams(), LOCA::MultiContinuation::ConstrainedGroup::setParams(), and LOCA::Hopf::MinimallyAugmented::ExtendedGroup::setParams().
void LOCA::ParameterVector::print | ( | ostream & | stream | ) | const |
const vector< double > & LOCA::ParameterVector::getValuesVector | ( | ) | const |
Accessor to get the underlying stl vector with all parameter values.
Definition at line 263 of file LOCA_Parameter_Vector.C.
References x.
const vector< string > & LOCA::ParameterVector::getNamesVector | ( | ) | const |
Accessor to get the underlying stl vector with all parameter names.
Definition at line 269 of file LOCA_Parameter_Vector.C.
References l.
vector<double> LOCA::ParameterVector::x [protected] |
Parameter values.
Definition at line 140 of file LOCA_Parameter_Vector.H.
Referenced by addParameter(), getDoubleArrayPointer(), getIndex(), getValue(), getValuesVector(), init(), isParameter(), length(), operator=(), operator[](), print(), scale(), setValue(), and update().
vector<string> LOCA::ParameterVector::l [protected] |
Parameter names.
Definition at line 143 of file LOCA_Parameter_Vector.H.
Referenced by addParameter(), getIndex(), getLabel(), getNamesVector(), getValue(), isParameter(), operator=(), print(), and setValue().