Milena (Olena)  User documentation 2.0a Id
 All Classes Namespaces Functions Variables Typedefs Enumerator Groups Pages
mln::value::float01 Class Reference

Class for floating values restricted to the interval [0..1] and discretized with n bits. More...

#include <float01.hh>

Inherits mln::value::Floating< E >.

Public Types

typedef std::pair< unsigned,
unsigned long > 
enc
 Encoding associated type.
 
typedef float equiv
 Equivalent associated type.
 

Public Member Functions

 float01 ()
 Ctor.
 
template<unsigned n>
 float01 (const float01_< n > &val)
 Ctor.
 
 float01 (unsigned nbits, float val)
 Ctor.
 
unsigned nbits () const
 Access to the encoding size.
 
 operator float () const
 Conversion to float.
 
float01set_nbits (unsigned nbits)
 Set the encoding size to nbits.
 
const float01 to_nbits (unsigned nbits) const
 Return an equivalent gray encoded on nbits bits.
 
float value () const
 Access to std type.
 
unsigned long value_ind () const
 Access to the position in the quantized interval.
 

Detailed Description

Class for floating values restricted to the interval [0..1] and discretized with n bits.

Definition at line 57 of file float01.hh.

Member Typedef Documentation

typedef std::pair<unsigned, unsigned long> mln::value::float01::enc

Encoding associated type.

Definition at line 62 of file float01.hh.

Equivalent associated type.

Definition at line 65 of file float01.hh.

Constructor & Destructor Documentation

mln::value::float01::float01 ( )
inline

Ctor.

Definition at line 152 of file float01.hh.

template<unsigned n>
mln::value::float01::float01 ( const float01_< n > &  val)
inline

Ctor.

Definition at line 159 of file float01.hh.

mln::value::float01::float01 ( unsigned  nbits,
float  val 
)
inline

Ctor.

Definition at line 166 of file float01.hh.

Member Function Documentation

unsigned mln::value::float01::nbits ( ) const
inline

Access to the encoding size.

Definition at line 187 of file float01.hh.

Referenced by set_nbits().

mln::value::float01::operator float ( ) const
inline

Conversion to float.

Definition at line 225 of file float01.hh.

float01 & mln::value::float01::set_nbits ( unsigned  nbits)
inline

Set the encoding size to nbits.

Definition at line 194 of file float01.hh.

References nbits().

Referenced by to_nbits().

const float01 mln::value::float01::to_nbits ( unsigned  nbits) const
inline

Return an equivalent gray encoded on nbits bits.

Definition at line 215 of file float01.hh.

References set_nbits().

float mln::value::float01::value ( ) const
inline

Access to std type.

Definition at line 173 of file float01.hh.

unsigned long mln::value::float01::value_ind ( ) const
inline

Access to the position in the quantized interval.

Definition at line 180 of file float01.hh.