libeblearn
ebl::mstate< Tstate > Class Template Reference

#include <ebl_states.h>

Inheritance diagram for ebl::mstate< Tstate >:
svector

List of all members.

Public Member Functions

 mstate ()
 Empty constructor.
 mstate (const mstate< Tstate > &other, intg dims, intg nstates=-1)
 mstate (const mstate< Tstate > &other)
 Construct an mstate with the exact same elements as ms.
virtual ~mstate ()
 Destructor.
virtual void clear_x ()
 Clears x field of all states.
virtual void clear_dx ()
 Clears dx field of all states.
virtual void clear_ddx ()
 Clears ddx field of all states.
virtual void copy (mstate< Tstate > &cpy)
 Copy mstate 'cpy' into internal buffers.
template<typename T >
void copy (midx< T > &cpy)
 Copy matrices 'cpy' into internal 'x' buffers.
template<typename T >
midx< T > copy ()
 Returns a matrix pointing to internal 'x' buffers.
virtual mstate< Tstate > narrow (intg size, intg offset)
 Returns an mstate of size 'size' starting at 'offset' in current vector.
virtual mstate< Tstate > narrow (int dimension, intg size, intg offset)
 Not implemented.
virtual mstate< Tstate > narrow (midxdim &regions)
 Narrows this multi-state given multiple input 'regions'.
virtual mstate< Tstate > narrow_max (mfidxdim &regions)
template<class T >
void get_midx (mfidxdim &regions, midx< T > &all)
template<class T >
void get_max_midx (mfidxdim &regions, midx< T > &all)
template<class T >
void get_padded_midx (mfidxdim &regions, midx< T > &all)
virtual void resize (mstate< Tstate > &s2, uint nmax=0)
template<class Tstate2 >
void resize (mstate< Tstate2 > &other)
virtual idxdim & get_idxdim0 ()
 Returns dimensions of first state.

Protected Attributes

svector< Tstate >::iterator it

Detailed Description

template<class Tstate>
class ebl::mstate< Tstate >

A class that stores multiple states. Use regular STL vector accessors to access states.


Constructor & Destructor Documentation

template<class Tstate>
ebl::mstate< Tstate >::mstate ( const mstate< Tstate > &  other,
intg  dims,
intg  nstates = -1 
)

This constructor initializes the same number of states as 'other', with the same number of dimensions for each state, and sets all these dimensions to 'dims'.

Parameters:
nstatesIf >= 0, limit the number of states to 'nstates', otherwise allocate the same number of states as 'ms'.

Member Function Documentation

template<class Tstate >
template<class T >
void ebl::mstate< Tstate >::get_max_midx ( mfidxdim &  regions,
midx< T > &  all 
)

Narrows this multi-state's x buffer given multiple input 'regions' to the maximum possible region (output may be smaller than requested regions) and puts result in multi-idx 'all'.

template<class Tstate >
template<class T >
void ebl::mstate< Tstate >::get_midx ( mfidxdim &  regions,
midx< T > &  all 
)

Narrows this multi-state's x buffer given multiple input 'regions' and puts result in multi-idx 'all'.

template<class Tstate >
template<class T >
void ebl::mstate< Tstate >::get_padded_midx ( mfidxdim &  regions,
midx< T > &  all 
)

Narrows this multi-state's x buffer given multiple input 'regions' and pad areas that do not overlap, then puts result in multi-idx 'all'.

template<class Tstate >
mstate< Tstate > ebl::mstate< Tstate >::narrow_max ( mfidxdim &  regions) [virtual]

Narrows this multi-state given multiple input 'regions' to the maximum possible region (output may be smaller than requested regions).

template<class Tstate>
void ebl::mstate< Tstate >::resize ( mstate< Tstate > &  s2,
uint  nmax = 0 
) [virtual]

Resize to have the same number of states with the same dimensions as s2.

Parameters:
nmaxIf > 0, limit the number of states to min(s2.size(), nmax).
template<class Tstate >
template<class Tstate2 >
void ebl::mstate< Tstate >::resize ( mstate< Tstate2 > &  other)

Resizes this mstate given another 'other' mstate. This makes sure this mstate has the same number of states as 'other', and that each state has the same order as in 'other'. It otherwise allocates the correct number of states of the correct orders but with dimensions of size 1. This does not resize each state to the same dimension sizes as 'other'.


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