libeblearn
|
#include <ebl_states.h>
Public Member Functions | |
bbstate_idx () | |
Constructs a bbstate_idx of order 0. | |
bbstate_idx (intg s0) | |
Constructs a bbstate_idx of order 1. | |
bbstate_idx (intg s0, intg s1) | |
Constructs a bbstate_idx of order 2. | |
bbstate_idx (intg s0, intg s1, intg s2) | |
Constructs a bbstate_idx of order 3. | |
bbstate_idx (intg s0, intg s1, intg s2, intg s3, intg s4=-1, intg s5=-1, intg s6=-1, intg s7=-1) | |
Constructor. A bbstate_idx can have up to 8 dimensions. | |
bbstate_idx (const idxdim &d) | |
Constructor. Use the order and dimensions contained in passed idxdim d. | |
bbstate_idx (intg n, bbstate_idx< T > &fs) | |
bbstate_idx (parameter< T, bbstate_idx< T > > *st) | |
bbstate_idx (parameter< T, bbstate_idx< T > > *st, intg s0) | |
bbstate_idx (parameter< T, bbstate_idx< T > > *st, intg s0, intg s1) | |
bbstate_idx (parameter< T, bbstate_idx< T > > *st, intg s0, intg s1, intg s2) | |
bbstate_idx (parameter< T, bbstate_idx< T > > *st, intg s0, intg s1, intg s2, intg s3, intg s4=-1, intg s5=-1, intg s6=-1, intg s7=-1) | |
bbstate_idx (parameter< T, bbstate_idx< T > > *st, const idxdim &d) | |
bbstate_idx (const idx< T > &x, const idx< T > &dx, const idx< T > &ddx) | |
virtual void | clear () |
clear x, dx and ddx | |
virtual void | clear_ddx () |
clear diag hessians ddx | |
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 (bbstate_idx &s) |
virtual void | resize_as_but1 (bbstate_idx< T > &s, intg fixed_dim) |
bbstate_idx< T > | select (int dimension, intg slice_index) |
bbstate_idx< T > | narrow (int dimension, intg size, intg offset) |
bbstate_idx< T > | make_copy () |
make a new copy of self | |
virtual bbstate_idx< T > & | operator= (const bbstate_idx< T > &other) |
virtual void | copy (bbstate_idx< T > &cpy) |
Copy state 'cpy' into internal buffers. | |
virtual void | pretty () |
Prints idx metadata. | |
virtual void | print () |
Prints all elements. |
A class that stores a vector/tensor state.
ebl::bbstate_idx< T >::bbstate_idx | ( | ) |
Constructs a bbstate_idx of order 0.
constructors from specific dimensions
ebl::bbstate_idx< T >::bbstate_idx | ( | intg | n, |
bbstate_idx< T > & | fs | ||
) |
This constructor initializes each buffer to the same order as 'ms.x' but sets all dimensions to 'n'.
ebl::bbstate_idx< T >::bbstate_idx | ( | parameter< T, bbstate_idx< T > > * | st | ) |
constructors from specific dimensions using a bbparameter Constructs a bbstate_idx of order 0, by appending the bbstate_idx into the same Srg as the bbparameter passed as argument. This is useful for allocating multiple bbstate_idx inside a bbparameter. If st is null, it is just ignore and behaves as regular constructor.
ebl::bbstate_idx< T >::bbstate_idx | ( | parameter< T, bbstate_idx< T > > * | st, |
intg | s0 | ||
) |
Constructs a bbstate_idx of order 1, by appending the bbstate_idx into the same Srg as the bbparameter passed as argument. This is useful for allocating multiple bbstate_idx inside a bbparameter. If st is null, it is just ignore and behaves as regular constructor.
ebl::bbstate_idx< T >::bbstate_idx | ( | parameter< T, bbstate_idx< T > > * | st, |
intg | s0, | ||
intg | s1 | ||
) |
Constructs a bbstate_idx of order 2, by appending the bbstate_idx into the same Srg as the bbparameter passed as argument. This is useful for allocating multiple bbstate_idx inside a bbparameter. If st is null, it is just ignore and behaves as regular constructor.
ebl::bbstate_idx< T >::bbstate_idx | ( | parameter< T, bbstate_idx< T > > * | st, |
intg | s0, | ||
intg | s1, | ||
intg | s2 | ||
) |
Constructs a bbstate_idx of order 3, by appending the bbstate_idx into the same Srg as the bbparameter passed as argument. This is useful for allocating multiple bbstate_idx inside a bbparameter. If st is null, it is just ignore and behaves as regular constructor.
ebl::bbstate_idx< T >::bbstate_idx | ( | parameter< T, bbstate_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 bbstate_idx of order up to 8, by appending the bbstate_idx into the same Srg as the bbparameter passed as argument. This is useful for allocating multiple bbstate_idx inside a bbparameter. If st is null, it is just ignore and behaves as regular constructor.
ebl::bbstate_idx< T >::bbstate_idx | ( | parameter< T, bbstate_idx< T > > * | st, |
const idxdim & | d | ||
) |
Constructs a bbstate_idx using the order and dimensions contained in passed idxdim d, by appending the bbstate_idx into the same Srg as the bbparameter passed as argument. This is useful for allocating multiple bbstate_idx inside a bbparameter. If st is null, it is just ignore and behaves as regular constructor.
ebl::bbstate_idx< T >::bbstate_idx | ( | const idx< T > & | x, |
const idx< T > & | dx, | ||
const idx< T > & | ddx | ||
) |
constructors from other bbstate_idx Constructs a bbstate_idx from a bbstate_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.
void ebl::bbstate_idx< T >::clear | ( | ) | [virtual] |
bbstate_idx< T > ebl::bbstate_idx< T >::make_copy | ( | ) |
bbstate_idx< T > ebl::bbstate_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.
dimension | The dimension to slice. |
slice_index | The size of the slize to return. |
offset | The offset to start slicing. |
Reimplemented from ebl::bstate_idx< T >.
bbstate_idx< T > & ebl::bbstate_idx< T >::operator= | ( | const bbstate_idx< T > & | other | ) | [virtual] |
Assignment operator, involves assignment of internal idx (avoid using this in critical loops).
void ebl::bbstate_idx< T >::pretty | ( | ) | [virtual] |
void ebl::bbstate_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::bstate_idx< T >.
void ebl::bbstate_idx< T >::resize1 | ( | intg | dimn, |
intg | size | ||
) | [virtual] |
resize one dimension <dimn> with size <size>. The order cannot be changed.
Reimplemented from ebl::bstate_idx< T >.
void ebl::bbstate_idx< T >::resize_as | ( | bbstate_idx< T > & | s | ) | [virtual] |
resizes this bbstate_idx with same sizes a <s>. Both bbstate_idx are required to have the same order.
void ebl::bbstate_idx< T >::resize_as_but1 | ( | bbstate_idx< T > & | s, |
intg | fixed_dim | ||
) | [virtual] |
same as resize_as but leave dimension <fixed_dim> untouched. Both bbstate_idx are required to have the same order.
bbstate_idx< T > ebl::bbstate_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.
dimension | The dimension to slice. |
slice_index | The slice to return. |
slicing methods
Reimplemented from ebl::bstate_idx< T >.