#include <QuantityCluster.h>
Public Types | |
typedef ABQ | PQ |
the parent quantity type | |
typedef M< PQ, SU, DD > | V |
the stored quantity | |
typedef ST | StorageType |
the storage type | |
typedef unit::CheckUnit< unit::Unit< BT >, SU >::Check | Unit |
check the unit SU | |
Public Member Functions | |
QuantityVector (void) | |
default constructor | |
template<class NU, class DD1> | QuantityVector (const QuantityVector< M, PQ, NU, DD1 > &new_vector) |
copy constructor from different unit (conversion) | |
QuantityVector & | operator= (const QuantityVector &new_vector) |
assignment operator | |
template<class NU, class DD1> QuantityVector & | operator= (const QuantityVector< M, PQ, NU, DD1 > &new_vector) |
assignment operator | |
void | save (BSUtilities::xmlw::XmlStream &os) const |
save a QuantityVector to XML | |
void | load (const TiXmlHandle node) |
load a Vector from XML | |
bool | operator== (const QuantityVector< M, Quantity< DIM, BT, UL, DU, ST >, SU, DD > &vector) const |
equality | |
int | size (void) const |
return the number of elements | |
template<template< class, class, class > class Q1, class BT1, class DIM1, class UL1, class DU1, class SU1, class ST1, class DD1> void | push_back (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST1 >, SU1, DD1 > &new_quantity) |
add a new element at the end of the vector | |
template<template< class, class, class > class Q1, class BT1, class DIM1, class UL1, class DU1, class SU1, class ST1, class DD1> void | insert (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST1 >, SU1, DD1 > &new_quantity, const int index) |
add a new element to the vector at position index | |
template<template< class, class, class > class Q1, class BT1, class DIM1, class UL1, class DU1, class SU1, class ST1, class DD1> void | replace (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST1 >, SU1, DD1 > &new_quantity, const int index) |
replace an element in the vector at position index | |
void | erase (const int index) |
erase the element at position index | |
void | clear (void) |
clear all elements from vector | |
std::vector< ST > | values (void) |
return the vector of _values | |
V | value (const int index) const |
return the value located in the QuantityVector at index | |
V | operator[] (const int index) const |
return the value located in the QuantityVector at index | |
template<class NU> M< Quantity< DIM, BT, UL, DU, ST >, NU, typename DefaultDedimensionalizer< PQ, NU >::F > | value (const int index, const NU &unit) const |
return the value located in the QuantityVector at index in unit NU | |
V | max (void) const |
return maximum | |
template<class NU> M< Quantity< DIM, BT, UL, DU, ST >, NU, typename DefaultDedimensionalizer< PQ, NU >::F > | max (const NU &unit) const |
return maximum in unit NU | |
V | min (void) const |
return minimum | |
template<class NU> M< Quantity< DIM, BT, UL, DU, ST >, NU, typename DefaultDedimensionalizer< PQ, NU >::F > | min (const NU &unit) const |
return minimum in unit NU | |
Private Types | |
typedef dimension::Dimension< BSUtilities::Rational< RL_N, RL_D >, BSUtilities::Rational< RM_N, RM_D >, BSUtilities::Rational< RT_N, RT_D >, BSUtilities::Rational< RE_N, RE_D >, BSUtilities::Rational< RTE_N, RTE_D >, BSUtilities::Rational< RA_N, RA_D >, BSUtilities::Rational< RLU_N, RLU_D > > | DIM |
the dimension | |
typedef Loki::Typelist< DDH, DDT > | DDL |
the dedimensionalizer parameter type list type | |
typedef Loki::TL::TypeAt< DDL, 0 >::Result | DDP |
the parameters to the dedimensionalizing functor as a type | |
typedef Loki::Functor< R, DDL > | DD |
the dedimensionalizer type | |
typedef Quantity< DIM, BT, UL, DU, ST > | ABQ |
the abstract base quantity type | |
typedef Vector< Quantity< dimension::Dimension< BSUtilities::Rational< RL_N, RL_D >, BSUtilities::Rational< RM_N, RM_D >, BSUtilities::Rational< RT_N, RT_D >, BSUtilities::Rational< RE_N, RE_D >, BSUtilities::Rational< RTE_N, RTE_D >, BSUtilities::Rational< RA_N, RA_D >, BSUtilities::Rational< RLU_N, RLU_D > >, BT, UL, DU, ST > > | VEC |
the base quantity vector | |
typedef BSUtilities::IF< BSUtilities::SameType< DD, typename DefaultDedimensionalizer< PQ, SU >::F >::sameType, DedimReturn< PQ, SU >, V >::RET | DDR |
the return variable type of dedimensionalizer | |
Static Private Member Functions | |
DDR | defaultDedimensionalizer (DDP) |
the default dedimensionalizing function | |
Private Attributes | |
DD | _dedimensionalizer |
the (de)dimensionalizing functor object | |
std::vector< ST > | _values |
the storage vector | |
Static Private Attributes | |
const DD | _defaultDD |
the default dedimensionalizing functor |
specialization for PQ being a Quantity and DD being a Loki::Functor with a return type R and a Loki::Typelist as argument type list. the elements of the quantity vector are stored as a vector _values of objects of type ST.
Definition at line 144 of file QuantityCluster.h.
|
the abstract base quantity type the Quantity which is used as the abstract base class for the quantity type stored in the vector; Definition at line 197 of file QuantityCluster.h. |
|
the dedimensionalizer type
Definition at line 191 of file QuantityCluster.h. |
|
the dedimensionalizer parameter type list type
Definition at line 178 of file QuantityCluster.h. |
|
the parameters to the dedimensionalizing functor as a type a (possibly inhomogenous) collection of values to be given to the dedimensionalizing functor upon a call to redimensionalize the DedimensionalizedVariable; this is extracted from the DDL typelist, which should have a single element, which is again a Loki::Tuple, containing the individual parameters Definition at line 188 of file QuantityCluster.h. |
|
the return variable type of dedimensionalizer
Definition at line 237 of file QuantityCluster.h. |
|
the dimension make the dimension known as DIM Definition at line 175 of file QuantityCluster.h. |
|
the parent quantity type this is the quantity which is used to generate the stored quantity in template form as a parameter to the quantity mode; it is the same as the abstract base quantity; it is used by other classes, and MUST be public Definition at line 217 of file QuantityCluster.h. |
|
the storage type for external access Definition at line 228 of file QuantityCluster.h. |
|
check the unit SU
Definition at line 231 of file QuantityCluster.h. |
|
the stored quantity this is formed from the quantity mode M, the parent quantity, and the storage unit Definition at line 223 of file QuantityCluster.h. |
|
the base quantity vector
Definition at line 208 of file QuantityCluster.h. |
|
clear all elements from vector
Definition at line 500 of file QuantityCluster.h. |
|
the default dedimensionalizing function returns an unnamed object; used if no dedimensionalizer is given by the user; does not use any of the parameters in DDP, the returned object contains unity. Definition at line 244 of file QuantityCluster.h. |
|
erase the element at position index range checked; forwards to the std::vector erase function Definition at line 487 of file QuantityCluster.h. |
|
add a new element to the vector at position index this element can be a quantity based on the parent quantity PQ; its value is recalculated into the storage unit SU of the vector; range checked; uses std::vector function insert. Definition at line 440 of file QuantityCluster.h. |
|
load a Vector from XML uses TinyXml; an element is extracted from the TiXmlHandle, and checked for (1) non-null element pointer (2) the name of the element (must be a quantity vector) (3) the value of the MODE variable of the quantity Subsequently, the child nodes of the element are searched for data elements. If found, the data text is converted into the storage unit and appended to the values vector. ???????????? load Dedimensionalizer? ?????????????????????????? Definition at line 365 of file QuantityCluster.h. |
|
return maximum in unit NU calculate the maximum of the _values stored in the vector, convert into NU and return in an appropriate object The returned object type carries a default dedimensionalizer type. Definition at line 559 of file QuantityCluster.h. |
|
return maximum calculate the maximum of the _values stored in the vector and return it in an object of type V Definition at line 539 of file QuantityCluster.h. |
|
return minimum in unit NU calculate the minimum of the _values stored in the vector, convert into NU and return in an appropriate object Definition at line 584 of file QuantityCluster.h. |
|
return minimum calculate the minimum of the _values stored in the vector and return it in an object of type V Definition at line 565 of file QuantityCluster.h. |
|
assignment operator assign a QuantityVector of identical type except storage unit; the dedimensionalizer may be different, it is not copied; ????????????? no need to check against self assignment, since the two objects have different type, and must be different. Definition at line 310 of file QuantityCluster.h. |
|
assignment operator assign a QuantityVector of identical type Definition at line 290 of file QuantityCluster.h. |
|
equality compares the size of the two values vectors and their contents Definition at line 398 of file QuantityCluster.h. |
|
return the value located in the QuantityVector at index read access to one element in the QuantityVector; uses value (index). Definition at line 521 of file QuantityCluster.h. |
|
add a new element at the end of the vector this element can be a quantity based on the parent quantity PQ; its value is recalculated into the storage unit SU of the vector; it is appended at the end of the vector; uses std::vector push_back function. The dedimensionalizer types can be identical or different. Definition at line 422 of file QuantityCluster.h. |
|
copy constructor from different unit (conversion) reserves a std::vector<ST> of same size as the vector in the new_vector object, and fills it with the elements of new_vector converted to the storage unit of the present variable vector, SU; the conversion routine checks that NU is appropriate. The dedimensionalizer may be identical or different. Definition at line 277 of file QuantityCluster.h. |
|
default constructor
Definition at line 267 of file QuantityCluster.h. |
|
replace an element in the vector at position index this element can be a quantity based on the parent quantity PQ; its value is recalculated into the storage unit Unit of the vector; range checked; this is a function which is not available in std::vector. Definition at line 468 of file QuantityCluster.h. |
|
save a QuantityVector to XML write the relevant information of the Vector object to a stream in XML format; these are: (1) the quantity mode (i.e., Variable, etc.) (2) the name of the parent quantity (3) the name of the storage unit (4) the data itself Should we save the storage type? ???????????? save Dedimensionalizer? ?????????????????????????? Definition at line 339 of file QuantityCluster.h. |
|
return the number of elements The size function returns an integer which gives the number of elements in the vector. This is calculated using the STL vector function size(). Definition at line 410 of file QuantityCluster.h. |
|
return the value located in the QuantityVector at index in unit NU use value (index) and convert the result into NU; the conversion routine between variables checks that NU is available in the unit list. The returned object type carries a default dedimensionalizer type. Definition at line 532 of file QuantityCluster.h. |
|
return the value located in the QuantityVector at index alternative to operator[]; used by operator[]; range checked. Definition at line 510 of file QuantityCluster.h. |
|
return the vector of _values provides access to the value vector Definition at line 505 of file QuantityCluster.h. |
|
the (de)dimensionalizing functor object the _dedimensionalizer object is a functor which returns an object to be used to perform the dedimensionalization of an object of type V (by division) or the redimensionalization of the internally stored value into an object of type V. Thus, _dedimensionalizer stores the recipe how to (de)dimensionalize the value stored in the DedimensionalizedVariable object. Definition at line 260 of file QuantityCluster.h. |
|
the default dedimensionalizing functor initialized outside of class to defaultDedimensionalizer Definition at line 249 of file QuantityCluster.h. |
|
the storage vector
Definition at line 263 of file QuantityCluster.h. |