SHOGUN v0.9.0
|
Template class Array implements a dense one dimensional array.
Note that depending on compile options everything will be inlined, such that this is as high performance array implementation without error checking.
公有成员 | |
CArray (int32_t initial_size=1) | |
CArray (T *p_array, int32_t p_array_size, bool p_free_array=true, bool p_copy_array=false) | |
CArray (const T *p_array, int32_t p_array_size) | |
virtual | ~CArray () |
virtual const char * | get_name () const |
void | set_name (const char *p_name) |
int32_t | get_array_size () const |
int32_t | get_dim1 () |
void | zero () |
void | set_const (T const_elem) |
const T & | get_element (int32_t index) const |
bool | set_element (const T &p_element, int32_t index) |
const T & | element (int32_t idx1) const |
T & | element (int32_t index) |
T & | element (T *p_array, int32_t index) |
bool | resize_array (int32_t n) |
T * | get_array () |
void | set_array (T *p_array, int32_t p_array_size, bool p_free_array=true, bool copy_array=false) |
void | set_array (const T *p_array, int32_t p_array_size) |
void | clear_array () |
const T & | operator[] (int32_t index) const |
T & | operator[] (int32_t index) |
CArray< T > & | operator= (const CArray< T > &orig) |
void | display_size () const |
void | display_array () const |
保护属性 | |
T * | array |
int32_t | array_size |
bool | free_array |
const char * | name |
DECLARE_ARRAY_STATISTICS |
CArray | ( | int32_t | initial_size = 1 | ) |
CArray | ( | T * | p_array, |
int32_t | p_array_size, | ||
bool | p_free_array = true , |
||
bool | p_copy_array = false |
||
) |
CArray | ( | const T * | p_array, |
int32_t | p_array_size | ||
) |
void display_array | ( | ) | const |
void display_size | ( | ) | const |
T& element | ( | int32_t | index | ) |
T& element | ( | T * | p_array, |
int32_t | index | ||
) |
const T& element | ( | int32_t | idx1 | ) | const |
T* get_array | ( | void | ) |
call get_array just before messing with it DO NOT call any [],resize/delete functions after get_array(), the pointer may become invalid!
被CArray2< T >、CArray3< T >、CArray2< CPlifBase * >、CArray2< float64_t >、CArray2< float32_t >、CArray2< int32_t >及CArray3< float64_t >重载。
int32_t get_array_size | ( | void | ) | const |
int32_t get_dim1 | ( | ) |
get array size (including granularity buffer)
被CArray2< T >、CArray3< T >、CArray2< CPlifBase * >、CArray2< float64_t >、CArray2< float32_t >、CArray2< int32_t >及CArray3< float64_t >重载。
const T& get_element | ( | int32_t | index | ) | const |
virtual const char* get_name | ( | void | ) | const [virtual] |
const T& operator[] | ( | int32_t | index | ) | const |
operator overload for array read only access use set_element() for write access (will also make the array dynamically grow)
DOES NOT DO ANY BOUNDS CHECKING
index |
T& operator[] | ( | int32_t | index | ) |
bool resize_array | ( | int32_t | n | ) |
void set_array | ( | const T * | p_array, |
int32_t | p_array_size | ||
) |
void set_array | ( | T * | p_array, |
int32_t | p_array_size, | ||
bool | p_free_array = true , |
||
bool | copy_array = false |
||
) |
void set_const | ( | T | const_elem | ) |
set array with a constant
被CArray2< T >、CArray3< T >、CArray2< CPlifBase * >、CArray2< float64_t >、CArray2< float32_t >、CArray2< int32_t >及CArray3< float64_t >重载。
bool set_element | ( | const T & | p_element, |
int32_t | index | ||
) |
void set_name | ( | const char * | p_name | ) |
set name
p_name | new name |
被CArray2< T >、CArray3< T >、CArray2< CPlifBase * >、CArray2< float64_t >、CArray2< float32_t >、CArray2< int32_t >及CArray3< float64_t >重载。
void zero | ( | ) |
int32_t array_size [protected] |
DECLARE_ARRAY_STATISTICS [protected] |
bool free_array [protected] |