pelib  2.0.0
pelib::AlgebraData Class Reference

#include <AlgebraData.hpp>

Inheritance diagram for pelib::AlgebraData:
[legend]

List of all members.

Public Types

enum  precision { leave, higher }

Public Member Functions

 AlgebraData (const std::string, precision=leave)
 AlgebraData (const AlgebraData &, precision=leave)
virtual const std::stringgetName () const
virtual void setName (const std::string)
virtual AlgebraDataclone () 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

Detailed Description

Base class of all data classes that a Algebra container can manipulate

Definition at line 34 of file AlgebraData.hpp.


Member Enumeration Documentation

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.

Enumerator:
leave 
higher 

Definition at line 41 of file AlgebraData.hpp.


Constructor & Destructor Documentation

Creates a new instance AlgebraData with name given as argument

Definition at line 36 of file AlgebraData.cpp.

Copy constructor

Definition at line 42 of file AlgebraData.cpp.


Member Function Documentation

virtual AlgebraData* pelib::AlgebraData::clone ( ) const [pure virtual]
template<class Value >
Value pelib::AlgebraData::fixPrecision ( const Value &  data,
std::streamsize  precision 
) [static]

Definition at line 77 of file AlgebraData.hpp.

template<>
float pelib::AlgebraData::fixPrecision ( const float data,
std::streamsize  precision 
)

Definition at line 68 of file AlgebraData.cpp.

template<>
double pelib::AlgebraData::fixPrecision ( const double &  data,
std::streamsize  precision 
)

Definition at line 88 of file AlgebraData.cpp.

template<>
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.

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.


Member Data Documentation

Stores the name of this element

Definition at line 71 of file AlgebraData.hpp.

Definition at line 72 of file AlgebraData.hpp.


The documentation for this class was generated from the following files: