C++QEDCore  2.100.2 (v2 Milestone 10 Development branch)
a framework for simulating open quantum dynamics – core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DimensionsBookkeeper< RANK, IS_CONST > Class Template Reference

Stores and manipulates dimensions of constructs over composite Hilbert spaces of arbitrary arity. More...

#include <DimensionsBookkeeper.h>

Public Types

typedef ExtTiny< RANK > Dimensions
 The dimensions as a static vector of size N_RANK.
 

Public Member Functions

 DimensionsBookkeeper (mpl::bool_< IS_CONST >=mpl::false_())
 Constructor usable only in the IS_CONST=false case. More...
 
 DimensionsBookkeeper (const Dimensions &dimensions)
 Standard constructor usable also in the IS_CONST=true case.
 
const DimensionsgetDimensions () const
 Get the Dimensions vector.
 
size_t getTotalDimension () const
 Get the total dimension of a system of arbitrary arity.
 
size_t getDimension (mpl::int_< RANK >=mpl::int_< 1 >()) const
 Get the (single) dimension for a unary system.
 
size_t getDimension (size_t i) const
 
void setDimensions (const Dimensions &dimensions)
 This will work only in the non-const case.
 

Static Public Attributes

static const int N_RANK =RANK
 Arity of the Hilbert space.
 
static const int DIMESIONS_BOOKKEEPER_RANK =RANK
 Ditto (to break ambiguity if a class is derived from another base featuring N_RANK).
 

Related Functions

(Note that these are not member functions.)

template<int RANK, bool IS_CONST1, bool IS_CONST2>
bool operator== (const DimensionsBookkeeper< RANK, IS_CONST1 > &d1, const DimensionsBookkeeper< RANK, IS_CONST2 > &d2)
 dimensionality comparison for types derived from DimensionsBookkeeper More...
 
template<int RANK, bool IS_CONST1, bool IS_CONST2>
bool operator!= (const DimensionsBookkeeper< RANK, IS_CONST1 > &d1, const DimensionsBookkeeper< RANK, IS_CONST2 > &d2)
 dimensionality comparison for types derived from DimensionsBookkeeper More...
 

Detailed Description

template<int RANK, bool IS_CONST>
class DimensionsBookkeeper< RANK, IS_CONST >

Stores and manipulates dimensions of constructs over composite Hilbert spaces of arbitrary arity.

It can be either constant or non-constant depending on the second template parameter.

Template Parameters
RANKarity of the Hilbert space
IS_CONSTGoverns the constness

Definition at line 28 of file DimensionsBookkeeper.h.

Constructor & Destructor Documentation

template<int RANK, bool IS_CONST>
DimensionsBookkeeper< RANK, IS_CONST >::DimensionsBookkeeper ( mpl::bool_< IS_CONST >  = mpl::false_())
inlineexplicit

Constructor usable only in the IS_CONST=false case.

The aim of the dummy argument with a default value – which creates a nonsensical function signature for IS_CONST=true – is that this constructor only compile for IS_CONST=false because it is only in the non-constant case that we allow default construction of the class.

Since from a template only such parts are compiled as are actually used, a client can use the class in the case IS_CONST=true without problems, getting a compile-time error only when trying to default-construct such an object.

Definition at line 44 of file DimensionsBookkeeper.h.

Friends And Related Function Documentation

template<int RANK, bool IS_CONST1, bool IS_CONST2>
bool operator!= ( const DimensionsBookkeeper< RANK, IS_CONST1 > &  d1,
const DimensionsBookkeeper< RANK, IS_CONST2 > &  d2 
)
related

dimensionality comparison for types derived from DimensionsBookkeeper

Definition at line 77 of file DimensionsBookkeeper.h.

template<int RANK, bool IS_CONST1, bool IS_CONST2>
bool operator== ( const DimensionsBookkeeper< RANK, IS_CONST1 > &  d1,
const DimensionsBookkeeper< RANK, IS_CONST2 > &  d2 
)
related

dimensionality comparison for types derived from DimensionsBookkeeper

Definition at line 69 of file DimensionsBookkeeper.h.


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