#include <array.hh>
Public Types | |
typedef std::vector< T >::reference | mutable_result |
typedef T | result |
Returned value types. | |
Public Member Functions | |
void | append (const T &val) |
Append a new value in the function. | |
void | init_ (unsigned n) |
Initialize an empty function. | |
mutable_result | operator() (unsigned i) |
Read-Write access to the ith value. | |
result | operator() (unsigned i) const |
Const access to the ith value. | |
void | reserve (unsigned n) |
Pre-allocate space. | |
void | resize (unsigned n, const T &val) |
Set the function size to n and initialize the value with val . | |
void | resize (unsigned n) |
Set the function size to n . | |
unsigned | size () const |
Return the number of values. | |
const std::vector< T > & | std_vector () const |
Return the underlying std::vector. | |
array (const std::vector< T > &from) | |
Used in from_to(). | |
array (const util::array< T > &from) | |
Used in from_to(). | |
array (unsigned n, const T &val) | |
Constructs a function with nvalues and val as default value. | |
array (unsigned n) | |
Constructs a function with nvalues . | |
array () | |
Constructors. | |
Protected Attributes | |
std::vector< T > | v_ |
Definition at line 93 of file fun/i2v/array.hh.
typedef std::vector<T>::reference mln::fun::i2v::array< T >::mutable_result |
Definition at line 101 of file fun/i2v/array.hh.
typedef T mln::fun::i2v::array< T >::result |
mln::fun::i2v::array< T >::array | ( | ) | [inline] |
mln::fun::i2v::array< T >::array | ( | unsigned | n | ) | [inline] |
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.
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.
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.
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_.
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_().
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_.
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_.
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_.
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_.
void mln::fun::i2v::array< T >::resize | ( | unsigned | n | ) | [inline] |
Set the function size to n
.
Definition at line 286 of file fun/i2v/array.hh.
References mln::fun::i2v::array< T >::v_.
Referenced by mln::labeling::colorize(), mln::convert::over_load::from_to_(), mln::accu::label_used< L >::init(), and mln::accu::label_used< L >::take().
unsigned mln::fun::i2v::array< T >::size | ( | ) | const [inline] |
Return the number of values.
Definition at line 310 of file fun/i2v/array.hh.
References mln::fun::i2v::array< T >::v_.
Referenced by mln::labeling::colorize(), mln::convert::over_load::from_to_(), mln::init_(), mln::value::lut_vec< S, T >::lut_vec(), mln::fun::i2v::operator<<(), mln::labeling::pack(), mln::labeling::pack_inplace(), and mln::accu::label_used< L >::take().
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().
std::vector<T> mln::fun::i2v::array< T >::v_ [protected] |
Definition at line 150 of file fun/i2v/array.hh.
Referenced by mln::fun::i2v::array< T >::append(), mln::fun::i2v::array< T >::init_(), mln::fun::i2v::array< T >::operator()(), mln::fun::i2v::array< T >::reserve(), mln::fun::i2v::array< T >::resize(), mln::fun::i2v::array< T >::size(), and mln::fun::i2v::array< T >::std_vector().