$extrastylesheet
#include <mln/fun/i2v/array.hh>
Public Member Functions | |
void | append (const T &val) |
void | init_ (unsigned n) |
result | operator() (unsigned i) const |
mutable_result | operator() (unsigned i) |
void | reserve (unsigned n) |
void | resize (unsigned n) |
void | resize (unsigned n, const T &val) |
unsigned | size () const |
const std::vector< T > & | std_vector () const |
Constructors | |
array () | |
array (unsigned n) | |
array (unsigned n, const T &val) | |
array (const util::array< T > &from) | |
array (const std::vector< T > &from) |
Protected Attributes | |
std::vector< T > | v_ |
Public Types | |
Returned value types | |
typedef T | result |
typedef std::vector< T >::reference | mutable_result |
Definition at line 65 of file fun/i2v/array.hh.
mln::fun::i2v::array< T >::array | ( | ) |
Default.
mln::fun::i2v::array< T >::array | ( | unsigned | n | ) |
Constructs a function with nvalues
.
mln::fun::i2v::array< T >::array | ( | unsigned | n, |
const T & | val | ||
) |
Constructs a function with nvalues
and val
as default value.
mln::fun::i2v::array< T >::array | ( | const util::array< T > & | from | ) |
Used in from_to().
Constructs that function from an util::array. Always prefer using from_to instead of this constructor.
mln::fun::i2v::array< T >::array | ( | const std::vector< T > & | from | ) |
Used in from_to().
Constructs that function from an std::vector. Always prefer using from_to instead of this constructor.
void mln::fun::i2v::array< T >::append | ( | const T & | val | ) |
Append a new value in the function.
void mln::fun::i2v::array< T >::init_ | ( | unsigned | n | ) |
Initialize an empty function.
result mln::fun::i2v::array< T >::operator() | ( | unsigned | i | ) | const |
Const access to the ith value.
mutable_result mln::fun::i2v::array< T >::operator() | ( | unsigned | i | ) |
Read-Write access to the ith value.
void mln::fun::i2v::array< T >::reserve | ( | unsigned | n | ) |
Pre-allocate space.
void mln::fun::i2v::array< T >::resize | ( | unsigned | n | ) |
Set the function size to n
.
void mln::fun::i2v::array< T >::resize | ( | unsigned | n, |
const T & | val | ||
) |
Set the function size to n
and initialize the value with val
.
unsigned mln::fun::i2v::array< T >::size | ( | ) | const |
Return the number of values.
const std::vector<T>& mln::fun::i2v::array< T >::std_vector | ( | ) | const |
Return the underlying std::vector.
|
protected |
Definition at line 125 of file fun/i2v/array.hh.
typedef std::vector<T>::reference mln::fun::i2v::array< T >::mutable_result |
Definition at line 74 of file fun/i2v/array.hh.
typedef T mln::fun::i2v::array< T >::result |
Definition at line 73 of file fun/i2v/array.hh.