CCA
|
Base for DTOs that contain double values or have setters/getters for double values. More...
#include <ContainingDoubles.h>
Public Member Functions | |
ContainingDoubles () | |
Constructor with empty initialization. | |
ContainingDoubles (double value) | |
Constructor from single value. | |
ContainingDoubles (unsigned int dimension, double value) | |
Constructor from dimension and value. | |
ContainingDoubles (const nemo::RealVector &values) | |
Constructor Initializes DTO with specified double values. | |
ContainingDoubles (const ContainingDoubles &values) | |
Copy Constructor. | |
virtual | ~ContainingDoubles () |
Destructor. | |
virtual unsigned int | getDimension () const |
Get dimension / number of values. | |
virtual double | asDouble (unsigned int index) const |
Returns single value as double in the default representation of this DTO. | |
virtual nemo::RealVector | asDoubleVector () const |
Returns single value as double. | |
virtual void | setValues (const nemo::RealVector &values) |
virtual void | setValue (double value) |
virtual void | setValue (unsigned int index, double value) |
template<class DTOType > | |
void | merge (const std::vector< boost::shared_ptr< DTOType > > &inputDTOs) |
Merging several low-dimensional DTOs into this DTO. | |
template<class DTOType > | |
std::vector< boost::shared_ptr < DTOType > > | split () const |
Split this DTO into several one-dimensional DTOs. | |
template<class DTOType > | |
std::vector< boost::shared_ptr < DTOType > > | split (nemo::IntVector sizes) const |
Split this DTO into several one-dimensional DTOs. | |
Public Attributes | |
nemo::RealVector | _values |
Detailed Description
Base for DTOs that contain double values or have setters/getters for double values.
Definition at line 85 of file ContainingDoubles.h.
Constructor & Destructor Documentation
cca::ContainingDoubles::ContainingDoubles | ( | ) | [inline] |
Constructor with empty initialization.
Definition at line 91 of file ContainingDoubles.h.
cca::ContainingDoubles::ContainingDoubles | ( | double | value | ) | [inline] |
Constructor from single value.
Result is a one-dimensional DTO.
- Parameters:
-
value Initial value
Definition at line 101 of file ContainingDoubles.h.
cca::ContainingDoubles::ContainingDoubles | ( | unsigned int | dimension, |
double | value | ||
) | [inline] |
Constructor from dimension and value.
Result is a DTO of given dimension filled with the given value.
- Parameters:
-
dimension Dimension of the DTO value Initial values for all dimensions
Definition at line 114 of file ContainingDoubles.h.
cca::ContainingDoubles::ContainingDoubles | ( | const nemo::RealVector & | values | ) | [inline] |
Constructor Initializes DTO with specified double values.
Definition at line 122 of file ContainingDoubles.h.
cca::ContainingDoubles::ContainingDoubles | ( | const ContainingDoubles & | values | ) | [inline] |
Copy Constructor.
Definition at line 129 of file ContainingDoubles.h.
virtual cca::ContainingDoubles::~ContainingDoubles | ( | ) | [inline, virtual] |
Destructor.
Definition at line 136 of file ContainingDoubles.h.
Member Function Documentation
virtual double cca::ContainingDoubles::asDouble | ( | unsigned int | index | ) | const [inline, virtual] |
Returns single value as double in the default representation of this DTO.
You should use this method only if you know exactly what you are doing. Use the more specific getters instead.
- Parameters:
-
index Index of the joint value
- Returns:
- Actual value in default representation.
Definition at line 157 of file ContainingDoubles.h.
Referenced by cca::DebugDTO::print().
virtual nemo::RealVector cca::ContainingDoubles::asDoubleVector | ( | ) | const [inline, virtual] |
Returns single value as double.
You should use this method only if you know exactly what you are doing. Use the more specific getters instead.
- Returns:
- Actual values in default representation.
Definition at line 170 of file ContainingDoubles.h.
virtual unsigned int cca::ContainingDoubles::getDimension | ( | ) | const [inline, virtual] |
Get dimension / number of values.
- Returns:
- Number of contained values
Definition at line 144 of file ContainingDoubles.h.
Referenced by cca::DebugDTO::print().
void cca::ContainingDoubles::merge | ( | const std::vector< boost::shared_ptr< DTOType > > & | inputDTOs | ) | [inline] |
Merging several low-dimensional DTOs into this DTO.
- Todo:
- Type safety checks? Right now I can merge arbitrary ContaingDoubles DTOs
- Template Parameters:
-
DTOType Type of input DTOs (automatically inferred from inputs if left blank)
- Parameters:
-
inputDTOs Vector of ContainingDouble DTOs, that should be merged (in-place)
Definition at line 215 of file ContainingDoubles.h.
virtual void cca::ContainingDoubles::setValue | ( | double | value | ) | [inline, virtual] |
Definition at line 186 of file ContainingDoubles.h.
virtual void cca::ContainingDoubles::setValue | ( | unsigned int | index, |
double | value | ||
) | [inline, virtual] |
Definition at line 194 of file ContainingDoubles.h.
virtual void cca::ContainingDoubles::setValues | ( | const nemo::RealVector & | values | ) | [inline, virtual] |
Definition at line 174 of file ContainingDoubles.h.
std::vector<boost::shared_ptr<DTOType> > cca::ContainingDoubles::split | ( | ) | const [inline] |
Split this DTO into several one-dimensional DTOs.
- Todo:
- Type safety checks? Right now I can merge arbitrary ContaingDoubles DTOs
- Template Parameters:
-
DTOType Type of input and return DTOs
- Returns:
- Vector of one-dimensional DTOs
Definition at line 252 of file ContainingDoubles.h.
std::vector<boost::shared_ptr<DTOType> > cca::ContainingDoubles::split | ( | nemo::IntVector | sizes | ) | const [inline] |
Split this DTO into several one-dimensional DTOs.
- Todo:
- Type safety checks? Right now I can merge arbitrary ContaingDoubles DTOs
- Template Parameters:
-
DTOType Type of input and return DTOs
- Parameters:
-
sizes Integer array specifying the sizes chunks to split into. Sum of sizes needs to match input dimension.
- Returns:
- Vector of one-dimensional DTOs
Definition at line 279 of file ContainingDoubles.h.
Member Data Documentation
nemo::RealVector cca::ContainingDoubles::_values |
Definition at line 315 of file ContainingDoubles.h.
The documentation for this class was generated from the following file:
- cca/dto/ContainingDoubles.h