KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Friends | List of all members
kjb::Weight_array< D > Class Template Reference

Forward declarations. More...

#include <prob_weight_array.h>

Public Types

typedef Weight_array< DSelf_t
 
typedef double Val_type
 
typedef boost::array< Val_type, DData_type
 
typedef boost::array< bool, DFilter
 
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_tnormalize ()
 normalize the weights More...
 
Self_toperator+= (const Self_t &right)
 shift values More...
 
Self_toperator*= (const Self_t &right)
 rescale the weights element-wise More...
 
Self_toperator/= (const Self_t &right)
 rescale the weights by division element-wise More...
 
Self_toperator+= (const Val_type &offset)
 shift values by a constant More...
 
Self_toperator*= (const Val_type &scale)
 rescale the weights by a constant More...
 
Self_toperator/= (const Val_type &scale)
 divide the weights by a constant More...
 
Self_toperator*= (const Filter &filter)
 zero out some weights by multiplying by a bool array More...
 
const Val_typeoperator[] (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...
 

Detailed Description

template<size_t D>
class kjb::Weight_array< D >

Forward declarations.

Member Typedef Documentation

template<size_t D>
typedef Data_type::const_iterator kjb::Weight_array< D >::const_iterator
template<size_t D>
typedef boost::array<Val_type, D> kjb::Weight_array< D >::Data_type
template<size_t D>
typedef boost::array<bool, D> kjb::Weight_array< D >::Filter
template<size_t D>
typedef Data_type::iterator kjb::Weight_array< D >::iterator
template<size_t D>
typedef Weight_array<D> kjb::Weight_array< D >::Self_t
template<size_t D>
typedef double kjb::Weight_array< D >::Val_type

Constructor & Destructor Documentation

template<size_t D>
kjb::Weight_array< D >::Weight_array ( )
inline

construct an empty Weight_array

template<size_t D>
kjb::Weight_array< D >::Weight_array ( const Data_type values)
inline

construct a Weight_array from a value array

template<size_t D>
template<typename InputIter >
kjb::Weight_array< D >::Weight_array ( InputIter  start,
InputIter  end 
)
inline

Member Function Documentation

template<size_t D>
const_iterator kjb::Weight_array< D >::begin ( ) const
inline

get a const_iterator to the first value

useful for passing to algorithms like copy, transform, etc.

template<size_t D>
iterator kjb::Weight_array< D >::begin ( )
inline

get an iterator to the first value

useful for passing to algorithms like copy, transform, etc.

template<size_t D>
const_iterator kjb::Weight_array< D >::cbegin ( ) const
inline

get a const_iterator to the first value

template<size_t D>
const_iterator kjb::Weight_array< D >::cend ( ) const
inline

get a const_iterator to the last value

template<size_t D>
const_iterator kjb::Weight_array< D >::end ( ) const
inline

get a const_iterator to the last value

useful for passing to algorithms like copy, transform, etc.

template<size_t D>
iterator kjb::Weight_array< D >::end ( )
inline

get an iterator to the last value

useful for passing to algorithms like copy, transform, etc.

template<size_t D>
Weight_array< D > & kjb::Weight_array< D >::normalize ( )

normalize the weights

template<size_t D>
Weight_array< D > & kjb::Weight_array< D >::operator*= ( const Self_t right)

rescale the weights element-wise

template<size_t D>
Self_t& kjb::Weight_array< D >::operator*= ( const Val_type scale)

rescale the weights by a constant

template<size_t D>
Self_t& kjb::Weight_array< D >::operator*= ( const Filter filter)

zero out some weights by multiplying by a bool array

template<size_t D>
Weight_array< D > & kjb::Weight_array< D >::operator+= ( const Self_t right)

shift values

template<size_t D>
Self_t& kjb::Weight_array< D >::operator+= ( const Val_type offset)

shift values by a constant

template<size_t D>
Weight_array< D > & kjb::Weight_array< D >::operator/= ( const Self_t right)

rescale the weights by division element-wise

template<size_t D>
Self_t& kjb::Weight_array< D >::operator/= ( const Val_type scale)

divide the weights by a constant

template<size_t D>
const Weight_array< D >::Val_type & kjb::Weight_array< D >::operator[] ( const size_t &  position) const

access value in position position.

Returns
const reference to value
template<size_t D>
Weight_array< D >::Val_type kjb::Weight_array< D >::total_mass ( ) const

get total mass

Member function definitions.

Friends And Related Function Documentation

template<size_t D>
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 
)
friend
template<size_t D>
bool operator!= ( const Self_t left,
const Self_t right 
)
friend

check if two weight arrays are unequal

template<size_t D>
template<size_t M>
std::ostream& operator<< ( std::ostream &  os,
const Weight_array< M > &  wa 
)
friend
template<size_t D>
bool operator== ( const Self_t left,
const Self_t right 
)
friend

check if two weight arrays are equal


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