|
SHOGUN
v1.1.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.

Public Member Functions | |
| 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 |
| virtual const char * | get_array_name () const |
| void | set_array_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 |
Public Member Functions inherited from CSGObject | |
| CSGObject () | |
| CSGObject (const CSGObject &orig) | |
| virtual | ~CSGObject () |
| virtual bool | is_generic (EPrimitiveType *generic) const |
| template<class T > | |
| void | set_generic () |
| void | unset_generic () |
| virtual void | print_serializable (const char *prefix="") |
| virtual bool | save_serializable (CSerializableFile *file, const char *prefix="") |
| virtual bool | load_serializable (CSerializableFile *file, const char *prefix="") |
| void | set_global_io (SGIO *io) |
| SGIO * | get_global_io () |
| void | set_global_parallel (Parallel *parallel) |
| Parallel * | get_global_parallel () |
| void | set_global_version (Version *version) |
| Version * | get_global_version () |
| SGVector< char * > | get_modelsel_names () |
| char * | get_modsel_param_descr (const char *param_name) |
| index_t | get_modsel_param_index (const char *param_name) |
Protected Attributes | |
| T * | array |
| int32_t | array_size |
| bool | free_array |
| const char * | name |
| DECLARE_ARRAY_STATISTICS | |
Additional Inherited Members | |
Public Attributes inherited from CSGObject | |
| SGIO * | io |
| Parallel * | parallel |
| Version * | version |
| Parameter * | m_parameters |
| Parameter * | m_model_selection_parameters |
Protected Member Functions inherited from CSGObject | |
| virtual void | load_serializable_pre () throw (ShogunException) |
| virtual void | load_serializable_post () throw (ShogunException) |
| virtual void | save_serializable_pre () throw (ShogunException) |
| virtual void | save_serializable_post () throw (ShogunException) |
| 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 |
display array
Reimplemented in CArray3< T >, CArray3< float64_t >, CArray2< T >, CArray2< CPlifBase * >, CArray2< float64_t >, CArray2< float32_t >, and CArray2< int32_t >.
| void display_size | ( | ) | const |
display array size
Reimplemented in CArray3< T >, CArray3< float64_t >, CArray2< T >, CArray2< CPlifBase * >, CArray2< float64_t >, CArray2< float32_t >, and CArray2< int32_t >.
| const T& element | ( | int32_t | idx1 | ) | const |
| T& element | ( | int32_t | index | ) |
| T& element | ( | T * | p_array, |
| int32_t | index | ||
| ) |
| T* get_array | ( | ) |
call get_array just before messing with it DO NOT call any [],resize/delete functions after get_array(), the pointer may become invalid!
Reimplemented in CArray3< T >, CArray3< float64_t >, CArray2< T >, CArray2< CPlifBase * >, CArray2< float64_t >, CArray2< float32_t >, and CArray2< int32_t >.
|
virtual |
| int32_t get_array_size | ( | ) | const |
| int32_t get_dim1 | ( | ) |
get array size (including granularity buffer)
Reimplemented in CArray3< T >, CArray3< float64_t >, CArray2< T >, CArray2< CPlifBase * >, CArray2< float64_t >, CArray2< float32_t >, and CArray2< int32_t >.
| const T& get_element | ( | int32_t | index | ) | 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 | ( | 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 set_array_name | ( | const char * | p_name | ) |
set name
| p_name | new name |
Reimplemented in CArray2< T >, CArray2< CPlifBase * >, CArray2< float64_t >, CArray2< float32_t >, CArray2< int32_t >, CArray3< T >, and CArray3< float64_t >.
| void set_const | ( | T | const_elem | ) |
set array with a constant
Reimplemented in CArray3< T >, CArray3< float64_t >, CArray2< T >, CArray2< CPlifBase * >, CArray2< float64_t >, CArray2< float32_t >, and CArray2< int32_t >.
| bool set_element | ( | const T & | p_element, |
| int32_t | index | ||
| ) |
| void zero | ( | ) |
zero array
Reimplemented in CArray3< T >, CArray3< float64_t >, CArray2< T >, CArray2< CPlifBase * >, CArray2< float64_t >, CArray2< float32_t >, and CArray2< int32_t >.
|
protected |