Public Member Functions | Protected Attributes

mln::fun::i2v::array< T > Class Template Reference

#include <array.hh>

Inheritance diagram for mln::fun::i2v::array< T >:
Inheritance graph

List of all members.

Public Types

typedef T result
 Returned value types.
typedef std::vector< T >::reference mutable_result

Public Member Functions

void append (const T &val)
 Append a new value in the function.
void init_ (unsigned n)
 Initialize an empty function.
result operator() (unsigned i) const
 Const access to the ith value.
mutable_result operator() (unsigned i)
 Read-Write access to the ith value.
void reserve (unsigned n)
 Pre-allocate space.
void resize (unsigned n)
 Set the function size to n.
void resize (unsigned n, const T &val)
 Set the function size to n and initialize the value with val.
unsigned size () const
 Return the number of values.
const std::vector< T > & std_vector () const
 Return the underlying std::vector.

 array ()
 Constructors.
 array (unsigned n)
 Constructs a function with nvalues.
 array (unsigned n, const T &val)
 Constructs a function with nvalues and val as default value.
 array (const util::array< T > &from)
 Used in from_to().
 array (const std::vector< T > &from)
 Used in from_to().

Protected Attributes

std::vector< Tv_

Detailed Description

template<typename T>
class mln::fun::i2v::array< T >

Definition at line 93 of file fun/i2v/array.hh.


Member Typedef Documentation

template<typename T>
typedef std::vector<T>::reference mln::fun::i2v::array< T >::mutable_result

Definition at line 101 of file fun/i2v/array.hh.

template<typename T>
typedef T mln::fun::i2v::array< T >::result

Returned value types.

Definition at line 100 of file fun/i2v/array.hh.


Constructor & Destructor Documentation

template<typename T >
mln::fun::i2v::array< T >::array (  )  [inline]

Constructors.

Default.

Definition at line 241 of file fun/i2v/array.hh.

template<typename T >
mln::fun::i2v::array< T >::array ( unsigned  n  )  [inline]

Constructs a function with nvalues.

Definition at line 247 of file fun/i2v/array.hh.

template<typename T>
mln::fun::i2v::array< T >::array ( unsigned  n,
const T val 
) [inline]

Constructs a function with nvalues and val as default value.

Definition at line 254 of file fun/i2v/array.hh.

template<typename T>
mln::fun::i2v::array< T >::array ( const util::array< T > &  from  )  [inline]

Used in from_to().

Constructs that function from an util::array. Always prefer using from_to instead of this constructor.

Definition at line 261 of file fun/i2v/array.hh.

template<typename T>
mln::fun::i2v::array< T >::array ( const std::vector< T > &  from  )  [inline]

Used in from_to().

Constructs that function from an std::vector. Always prefer using from_to instead of this constructor.

Definition at line 269 of file fun/i2v/array.hh.


Member Function Documentation

template<typename T>
void mln::fun::i2v::array< T >::append ( const T val  )  [inline]

Append a new value in the function.

Definition at line 294 of file fun/i2v/array.hh.

References mln::fun::i2v::array< T >::v_.

template<typename T >
void mln::fun::i2v::array< T >::init_ ( unsigned  n  )  [inline]

Initialize an empty function.

Definition at line 336 of file fun/i2v/array.hh.

References mln::fun::i2v::array< T >::v_.

Referenced by mln::init_().

template<typename T >
array< T >::result mln::fun::i2v::array< T >::operator() ( unsigned  i  )  const [inline]

Const access to the ith value.

Definition at line 318 of file fun/i2v/array.hh.

References mln::fun::i2v::array< T >::v_.

template<typename T >
array< T >::mutable_result mln::fun::i2v::array< T >::operator() ( unsigned  i  )  [inline]

Read-Write access to the ith value.

Definition at line 327 of file fun/i2v/array.hh.

References mln::fun::i2v::array< T >::v_.

template<typename T >
void mln::fun::i2v::array< T >::reserve ( unsigned  n  )  [inline]

Pre-allocate space.

Definition at line 278 of file fun/i2v/array.hh.

References mln::fun::i2v::array< T >::v_.

template<typename T >
void mln::fun::i2v::array< T >::resize ( unsigned  n  )  [inline]
template<typename T>
void mln::fun::i2v::array< T >::resize ( unsigned  n,
const T val 
) [inline]

Set the function size to n and initialize the value with val.

Definition at line 302 of file fun/i2v/array.hh.

References mln::fun::i2v::array< T >::v_.

template<typename T >
unsigned mln::fun::i2v::array< T >::size (  )  const [inline]
template<typename T >
const std::vector< T > & mln::fun::i2v::array< T >::std_vector (  )  const [inline]

Return the underlying std::vector.

Definition at line 344 of file fun/i2v/array.hh.

References mln::fun::i2v::array< T >::v_.

Referenced by mln::value::lut_vec< S, T >::lut_vec().


Member Data Documentation

template<typename T>
std::vector<T> mln::fun::i2v::array< T >::v_ [protected]