libeblearn
ebl::bstate_idx< T > Class Template Reference

#include <ebl_states.h>

Inheritance diagram for ebl::bstate_idx< T >:
ebl::fstate_idx< T > ebl::state ebl::bbstate_idx< T > ebl::parameter< T, bstate_idx< T > > ebl::state_idxlooper< bstate_idx< T > > ebl::parameter< T, bbstate_idx< T > > ebl::state_idxlooper< bbstate_idx< T > >

List of all members.

Public Member Functions

 bstate_idx ()
 Constructs a bstate_idx of order 0.
 bstate_idx (intg s0)
 Constructs a bstate_idx of order 1.
 bstate_idx (intg s0, intg s1)
 Constructs a bstate_idx of order 2.
 bstate_idx (intg s0, intg s1, intg s2)
 Constructs a bstate_idx of order 3.
 bstate_idx (intg s0, intg s1, intg s2, intg s3, intg s4=-1, intg s5=-1, intg s6=-1, intg s7=-1)
 Constructor. A bstate_idx can have up to 8 dimensions.
 bstate_idx (const idxdim &d)
 Constructor. Use the order and dimensions contained in passed idxdim d.
 bstate_idx (intg n, bstate_idx< T > &fs)
 bstate_idx (parameter< T, bstate_idx< T > > *st)
 bstate_idx (parameter< T, bstate_idx< T > > *st, intg s0)
 bstate_idx (parameter< T, bstate_idx< T > > *st, intg s0, intg s1)
 bstate_idx (parameter< T, bstate_idx< T > > *st, intg s0, intg s1, intg s2)
 bstate_idx (parameter< T, bstate_idx< T > > *st, intg s0, intg s1, intg s2, intg s3, intg s4=-1, intg s5=-1, intg s6=-1, intg s7=-1)
 bstate_idx (parameter< T, bstate_idx< T > > *st, const idxdim &d)
 bstate_idx (const idx< T > &x, const idx< T > &dx)
virtual void clear ()
 clear x and dx.
virtual void clear_dx ()
 clear gradients dx
virtual void update_gd (gd_param &arg)
 update with gradient descent
virtual void resize (intg s0=-1, intg s1=-1, intg s2=-1, intg s3=-1, intg s4=-1, intg s5=-1, intg s6=-1, intg s7=-1)
 resize. The order cannot be changed with this.
virtual void resize (const idxdim &d)
 resize with dimensions contained in an idxdim. order cannot be changed.
virtual void resize1 (intg dimn, intg size)
virtual void resize_as (bstate_idx &s)
virtual void resize_as_but1 (bstate_idx< T > &s, intg fixed_dim)
bstate_idx< T > select (int dimension, intg slice_index)
bstate_idx< T > narrow (int dimension, intg size, intg offset)
bstate_idx< T > make_copy ()
 make a new copy of self
virtual bstate_idx< T > & operator= (const bstate_idx< T > &other)
virtual void copy (bstate_idx< T > &cpy)
 Copy state 'cpy' into internal buffers.
virtual void pretty ()
 Prints idx metadata.
virtual void print ()
 Prints all elements.

Detailed Description

template<typename T>
class ebl::bstate_idx< T >

A class that stores a vector/tensor state.


Constructor & Destructor Documentation

template<typename T >
ebl::bstate_idx< T >::bstate_idx ( )

Constructs a bstate_idx of order 0.

constructors from specific dimensions

template<typename T>
ebl::bstate_idx< T >::bstate_idx ( intg  n,
bstate_idx< T > &  fs 
)

This constructor initializes each buffer to the same order as 'ms.x' but sets all dimensions to 'n'.

template<typename T>
ebl::bstate_idx< T >::bstate_idx ( parameter< T, bstate_idx< T > > *  st)

constructors from specific dimensions using a bparameter Constructs a bstate_idx of order 0, by appending the bstate_idx into the same Srg as the bparameter passed as argument. This is useful for allocating multiple bstate_idx inside a bparameter. If st is null, it is just ignore and behaves as regular constructor.

template<typename T>
ebl::bstate_idx< T >::bstate_idx ( parameter< T, bstate_idx< T > > *  st,
intg  s0 
)

Constructs a bstate_idx of order 1, by appending the bstate_idx into the same Srg as the bparameter passed as argument. This is useful for allocating multiple bstate_idx inside a bparameter. If st is null, it is just ignore and behaves as regular constructor.

template<typename T>
ebl::bstate_idx< T >::bstate_idx ( parameter< T, bstate_idx< T > > *  st,
intg  s0,
intg  s1 
)

Constructs a bstate_idx of order 2, by appending the bstate_idx into the same Srg as the bparameter passed as argument. This is useful for allocating multiple bstate_idx inside a bparameter. If st is null, it is just ignore and behaves as regular constructor.

template<typename T>
ebl::bstate_idx< T >::bstate_idx ( parameter< T, bstate_idx< T > > *  st,
intg  s0,
intg  s1,
intg  s2 
)

Constructs a bstate_idx of order 3, by appending the bstate_idx into the same Srg as the bparameter passed as argument. This is useful for allocating multiple bstate_idx inside a bparameter. If st is null, it is just ignore and behaves as regular constructor.

template<typename T>
ebl::bstate_idx< T >::bstate_idx ( parameter< T, bstate_idx< T > > *  st,
intg  s0,
intg  s1,
intg  s2,
intg  s3,
intg  s4 = -1,
intg  s5 = -1,
intg  s6 = -1,
intg  s7 = -1 
)

Constructs a bstate_idx of order up to 8, by appending the bstate_idx into the same Srg as the bparameter passed as argument. This is useful for allocating multiple bstate_idx inside a bparameter. If st is null, it is just ignore and behaves as regular constructor.

template<typename T>
ebl::bstate_idx< T >::bstate_idx ( parameter< T, bstate_idx< T > > *  st,
const idxdim &  d 
)

Constructs a bstate_idx using the order and dimensions contained in passed idxdim d, by appending the bstate_idx into the same Srg as the bparameter passed as argument. This is useful for allocating multiple bstate_idx inside a bparameter. If st is null, it is just ignore and behaves as regular constructor.

template<typename T>
ebl::bstate_idx< T >::bstate_idx ( const idx< T > &  x,
const idx< T > &  dx 
)

constructors from other bstate_idx Constructs a bstate_idx from a bstate_idx's 3 internal idx Note: the data pointed to by idxs is not copied, we only create new idx pointing to the same data.


Member Function Documentation

template<typename T >
void ebl::bstate_idx< T >::clear ( ) [virtual]

clear x and dx.

clear methods

Reimplemented from ebl::fstate_idx< T >.

Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.

template<typename T >
bstate_idx< T > ebl::bstate_idx< T >::make_copy ( )

make a new copy of self

copy methods

Reimplemented from ebl::fstate_idx< T >.

Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.

template<typename T >
bstate_idx< T > ebl::bstate_idx< T >::narrow ( int  dimension,
intg  size,
intg  offset 
)

Same as idx::narrow(), applied to internal buffers. This returns a state_idx pointing to the same data as current state, but pointing to a slice of it.

Parameters:
dimensionThe dimension to slice.
slice_indexThe size of the slize to return.
offsetThe offset to start slicing.

Reimplemented from ebl::fstate_idx< T >.

Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.

template<typename T>
bstate_idx< T > & ebl::bstate_idx< T >::operator= ( const bstate_idx< T > &  other) [virtual]

Assignment operator, involves assignment of internal idx (avoid using this in critical loops).

template<typename T >
void ebl::bstate_idx< T >::pretty ( ) [virtual]

Prints idx metadata.

info printing methods

Reimplemented from ebl::fstate_idx< T >.

Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.

template<typename T >
void ebl::bstate_idx< T >::resize ( intg  s0 = -1,
intg  s1 = -1,
intg  s2 = -1,
intg  s3 = -1,
intg  s4 = -1,
intg  s5 = -1,
intg  s6 = -1,
intg  s7 = -1 
) [virtual]

resize. The order cannot be changed with this.

resize methods

Reimplemented from ebl::fstate_idx< T >.

Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.

template<typename T >
void ebl::bstate_idx< T >::resize1 ( intg  dimn,
intg  size 
) [virtual]

resize one dimension <dimn> with size <size>. The order cannot be changed.

Reimplemented from ebl::fstate_idx< T >.

Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.

template<typename T >
void ebl::bstate_idx< T >::resize_as ( bstate_idx< T > &  s) [virtual]

resizes this bstate_idx with same sizes a <s>. Both bstate_idx are required to have the same order.

template<typename T>
void ebl::bstate_idx< T >::resize_as_but1 ( bstate_idx< T > &  s,
intg  fixed_dim 
) [virtual]

same as resize_as but leave dimension <fixed_dim> untouched. Both bstate_idx are required to have the same order.

template<typename T >
bstate_idx< T > ebl::bstate_idx< T >::select ( int  dimension,
intg  slice_index 
)

slicing methods Same as idx::select(), applied to internal buffers. This returns a state_idx pointing to the same data as current state, but pointing to a slice of it.

Parameters:
dimensionThe dimension to slice.
slice_indexThe slice to return.

slicing methods

Reimplemented from ebl::fstate_idx< T >.

Reimplemented in ebl::bbstate_idx< T >, ebl::bbstate_idx< Tdata >, ebl::bbstate_idx< Tds2 >, and ebl::bbstate_idx< Tnet >.


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