详细描述
template<class T>
class shogun::CArray< T >
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.
在文件Array.h第80行定义。
所有成员的列表。
公有成员 |
| 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 |
) |
|
constructor
- 参数:
-
| initial_size | initial size of array |
在文件Array.h第87行定义。
CArray |
( |
T * |
p_array, |
|
|
int32_t |
p_array_size, |
|
|
bool |
p_free_array = true , |
|
|
bool |
p_copy_array = false | |
|
) |
| | |
constructor
- 参数:
-
| p_array | another array |
| p_array_size | size of another array |
| p_free_array | if array must be freed |
| p_copy_array | if array must be copied |
在文件Array.h第103行定义。
CArray |
( |
const T * |
p_array, |
|
|
int32_t |
p_array_size | |
|
) |
| | |
constructor
- 参数:
-
| p_array | another array |
| p_array_size | size of another array |
在文件Array.h第116行定义。
成员函数文档
void display_array |
( |
|
) |
const |
void display_size |
( |
|
) |
const |
T& element |
( |
int32_t |
index |
) |
|
get element at given index
- 参数:
-
- 返回:
- element at given index
在文件Array.h第220行定义。
T& element |
( |
T * |
p_array, |
|
|
int32_t |
index | |
|
) |
| | |
get element of given array at given index
- 参数:
-
| p_array | another array |
| index | index |
- 返回:
- element of given array at given index
在文件Array.h第235行定义。
const T& element |
( |
int32_t |
idx1 |
) |
const |
get element at given index
- 参数:
-
- 返回:
- element at given index
在文件Array.h第209行定义。
int32_t get_array_size |
( |
|
) |
const |
get array size (including granularity buffer)
- 返回:
- total array size
在文件Array.h第150行定义。
const T& get_element |
( |
int32_t |
index |
) |
const |
get array element at index
- 参数:
-
- 返回:
- array element at index
在文件Array.h第183行定义。
virtual const char* get_name |
( |
|
) |
const [virtual] |
operator overload for array assignment
- 参数:
-
- 返回:
- new array
在文件Array.h第353行定义。
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
- 参数:
-
- 返回:
- element at index
在文件Array.h第329行定义。
T& operator[] |
( |
int32_t |
index |
) |
|
operator overload for array read only access
DOES NOT DO ANY BOUNDS CHECKING
- 参数:
-
- 返回:
- element at index
在文件Array.h第342行定义。
bool resize_array |
( |
int32_t |
n |
) |
|
resize array
- 参数:
-
- 返回:
- if resizing was successful
在文件Array.h第248行定义。
void set_array |
( |
const T * |
p_array, |
|
|
int32_t |
p_array_size | |
|
) |
| | |
set the array pointer and free previously allocated memory
- 参数:
-
| p_array | another array |
| p_array_size | size of another array |
在文件Array.h第304行定义。
void set_array |
( |
T * |
p_array, |
|
|
int32_t |
p_array_size, |
|
|
bool |
p_free_array = true , |
|
|
bool |
copy_array = false | |
|
) |
| | |
set the array pointer and free previously allocated memory
- 参数:
-
| p_array | another array |
| p_array_size | size of another array |
| p_free_array | if array must be freed |
| copy_array | if array must be copied |
在文件Array.h第282行定义。
void set_const |
( |
T |
const_elem |
) |
|
bool set_element |
( |
const T & |
p_element, |
|
|
int32_t |
index | |
|
) |
| | |
set array element at index 'index' return false in case of trouble
- 参数:
-
| p_element | array element to set |
| index | index |
- 返回:
- if setting was successful
在文件Array.h第196行定义。
void set_name |
( |
const char * |
p_name |
) |
|
成员数据文档
the number of potentially used elements in array
在文件Array.h第381行定义。
const char* name [protected] |
该类的文档由以下文件生成: