KJB
|
Forward declarations. More...
#include <prob_weight_array.h>
Public Types | |
typedef Weight_array< D > | Self_t |
typedef double | Val_type |
typedef boost::array< Val_type, D > | Data_type |
typedef boost::array< bool, D > | Filter |
typedef Data_type::iterator | iterator |
typedef Data_type::const_iterator | const_iterator |
Public Member Functions | |
Weight_array () | |
construct an empty Weight_array More... | |
Weight_array (const Data_type &values) | |
construct a Weight_array from a value array More... | |
template<typename InputIter > | |
Weight_array (InputIter start, InputIter end) | |
const_iterator | cbegin () const |
get a const_iterator to the first value More... | |
const_iterator | cend () const |
get a const_iterator to the last value More... | |
const_iterator | begin () const |
get a const_iterator to the first value More... | |
const_iterator | end () const |
get a const_iterator to the last value More... | |
iterator | begin () |
get an iterator to the first value More... | |
iterator | end () |
get an iterator to the last value More... | |
Val_type | total_mass () const |
get total mass More... | |
Self_t & | normalize () |
normalize the weights More... | |
Self_t & | operator+= (const Self_t &right) |
shift values More... | |
Self_t & | operator*= (const Self_t &right) |
rescale the weights element-wise More... | |
Self_t & | operator/= (const Self_t &right) |
rescale the weights by division element-wise More... | |
Self_t & | operator+= (const Val_type &offset) |
shift values by a constant More... | |
Self_t & | operator*= (const Val_type &scale) |
rescale the weights by a constant More... | |
Self_t & | operator/= (const Val_type &scale) |
divide the weights by a constant More... | |
Self_t & | operator*= (const Filter &filter) |
zero out some weights by multiplying by a bool array More... | |
const Val_type & | operator[] (const size_t &position) const |
access value in position position. More... | |
Friends | |
template<size_t M, size_t K> | |
Weight_array< M > | convex_combination (const Weight_array< K > &weights, const boost::array< Weight_array< M >, K > &components) |
template<size_t M> | |
std::ostream & | operator<< (std::ostream &os, const Weight_array< M > &wa) |
bool | operator== (const Self_t &left, const Self_t &right) |
check if two weight arrays are equal More... | |
bool | operator!= (const Self_t &left, const Self_t &right) |
check if two weight arrays are unequal More... | |
Forward declarations.
typedef Data_type::const_iterator kjb::Weight_array< D >::const_iterator |
typedef boost::array<Val_type, D> kjb::Weight_array< D >::Data_type |
typedef boost::array<bool, D> kjb::Weight_array< D >::Filter |
typedef Data_type::iterator kjb::Weight_array< D >::iterator |
typedef Weight_array<D> kjb::Weight_array< D >::Self_t |
typedef double kjb::Weight_array< D >::Val_type |
|
inline |
construct an empty Weight_array
|
inline |
construct a Weight_array from a value array
|
inline |
|
inline |
get a const_iterator to the first value
useful for passing to algorithms like copy, transform, etc.
|
inline |
get an iterator to the first value
useful for passing to algorithms like copy, transform, etc.
|
inline |
get a const_iterator to the first value
|
inline |
get a const_iterator to the last value
|
inline |
get a const_iterator to the last value
useful for passing to algorithms like copy, transform, etc.
|
inline |
get an iterator to the last value
useful for passing to algorithms like copy, transform, etc.
Weight_array< D > & kjb::Weight_array< D >::normalize | ( | ) |
normalize the weights
Weight_array< D > & kjb::Weight_array< D >::operator*= | ( | const Self_t & | right | ) |
rescale the weights element-wise
Self_t& kjb::Weight_array< D >::operator*= | ( | const Val_type & | scale | ) |
rescale the weights by a constant
Self_t& kjb::Weight_array< D >::operator*= | ( | const Filter & | filter | ) |
zero out some weights by multiplying by a bool array
Weight_array< D > & kjb::Weight_array< D >::operator+= | ( | const Self_t & | right | ) |
shift values
Self_t& kjb::Weight_array< D >::operator+= | ( | const Val_type & | offset | ) |
shift values by a constant
Weight_array< D > & kjb::Weight_array< D >::operator/= | ( | const Self_t & | right | ) |
rescale the weights by division element-wise
Self_t& kjb::Weight_array< D >::operator/= | ( | const Val_type & | scale | ) |
divide the weights by a constant
const Weight_array< D >::Val_type & kjb::Weight_array< D >::operator[] | ( | const size_t & | position | ) | const |
access value in position position.
Weight_array< D >::Val_type kjb::Weight_array< D >::total_mass | ( | ) | const |
get total mass
Member function definitions.
|
friend |
check if two weight arrays are unequal
|
friend |
check if two weight arrays are equal