pelib
2.0.0
|
#include <AlgebraData.hpp>
Public Types | |
enum | precision { leave, higher } |
Public Member Functions | |
AlgebraData (const std::string, precision=leave) | |
AlgebraData (const AlgebraData &, precision=leave) | |
virtual const std::string & | getName () const |
virtual void | setName (const std::string) |
virtual AlgebraData * | clone () const =0 |
virtual void | merge (const AlgebraData *)=0 |
precision | getPrecision () const |
template<> | |
float | fixPrecision (const float &data, std::streamsize precision) |
template<> | |
double | fixPrecision (const double &data, std::streamsize precision) |
template<> | |
long double | fixPrecision (const long double &data, std::streamsize precision) |
Static Public Member Functions | |
template<class Value > | |
static Value | fixPrecision (const Value &data, std::streamsize precision) |
Protected Attributes | |
std::string | name |
precision | prec |
Base class of all data classes that a Algebra container can manipulate
Definition at line 34 of file AlgebraData.hpp.
If the data is a float or a double, instruct pelib to printf the value rounded up to the next higher last digit displayed or to leave it as it is. The latter is the default setting.
Definition at line 41 of file AlgebraData.hpp.
pelib::AlgebraData::AlgebraData | ( | const std::string | name, |
precision | prec = leave |
||
) |
Creates a new instance AlgebraData with name given as argument
Definition at line 36 of file AlgebraData.cpp.
pelib::AlgebraData::AlgebraData | ( | const AlgebraData & | data, |
precision | prec = leave |
||
) |
Copy constructor
Definition at line 42 of file AlgebraData.cpp.
virtual AlgebraData* pelib::AlgebraData::clone | ( | ) | const [pure virtual] |
Returns a copy of this element
Implements pelib::Data.
Implemented in pelib::Set< Value, Key >, pelib::Matrix< Col, Row, Value >, pelib::Vector< Key, Value >, and pelib::Scalar< Value >.
Value pelib::AlgebraData::fixPrecision | ( | const Value & | data, |
std::streamsize | precision | ||
) | [static] |
Definition at line 77 of file AlgebraData.hpp.
float pelib::AlgebraData::fixPrecision | ( | const float & | data, |
std::streamsize | precision | ||
) |
Definition at line 68 of file AlgebraData.cpp.
double pelib::AlgebraData::fixPrecision | ( | const double & | data, |
std::streamsize | precision | ||
) |
Definition at line 88 of file AlgebraData.cpp.
long double pelib::AlgebraData::fixPrecision | ( | const long double & | data, |
std::streamsize | precision | ||
) |
Definition at line 108 of file AlgebraData.cpp.
const std::string & pelib::AlgebraData::getName | ( | ) | const [virtual] |
Returns the name of this element
Definition at line 55 of file AlgebraData.cpp.
Definition at line 61 of file AlgebraData.cpp.
virtual void pelib::AlgebraData::merge | ( | const AlgebraData * | ) | [pure virtual] |
Merge data in this instance and instance given as argument, or replace it if merging is not possible
Implemented in pelib::Set< Value, Key >, pelib::Matrix< Col, Row, Value >, pelib::Vector< Key, Value >, and pelib::Scalar< Value >.
void pelib::AlgebraData::setName | ( | const std::string | name | ) | [virtual] |
Sets the name of this element
Definition at line 49 of file AlgebraData.cpp.
std::string pelib::AlgebraData::name [protected] |
Stores the name of this element
Definition at line 71 of file AlgebraData.hpp.
precision pelib::AlgebraData::prec [protected] |
Definition at line 72 of file AlgebraData.hpp.