详细描述
template<class T>
class shogun::CArray2< T >
Template class Array2 implements a dense two dimensional array.
Note that depending on compile options everything will be inlined, such that this is as high performance 2d-array implementation without error checking.
在文件Array2.h第28行定义。
所有成员的列表。
公有成员 |
| CArray2 (int32_t dim1=1, int32_t dim2=1) |
| CArray2 (T *p_array, int32_t dim1, int32_t dim2, bool p_free_array=true, bool p_copy_array=false) |
| CArray2 (const T *p_array, int32_t dim1, int32_t dim2) |
virtual | ~CArray2 () |
void | get_array_size (int32_t &dim1, int32_t &dim2) |
int32_t | get_dim1 () |
int32_t | get_dim2 () |
void | zero () |
void | set_const (T const_elem) |
T * | get_array () |
void | set_name (const char *p_name) |
void | set_array (T *p_array, int32_t dim1, int32_t dim2, bool p_free_array=true, bool copy_array=false) |
bool | resize_array (int32_t dim1, int32_t dim2) |
const T & | get_element (int32_t idx1, int32_t idx2) const |
bool | set_element (const T &p_element, int32_t idx1, int32_t idx2) |
const T & | element (int32_t idx1, int32_t idx2) const |
T & | element (int32_t idx1, int32_t idx2) |
T & | element (T *p_array, int32_t idx1, int32_t idx2) |
T & | element (T *p_array, int32_t idx1, int32_t idx2, int32_t p_dim1_size) |
CArray2< T > & | operator= (CArray2< T > &orig) |
void | display_array () const |
void | display_size () const |
virtual const char * | get_name () |
保护属性 |
int32_t | dim1_size |
int32_t | dim2_size |
构造及析构函数文档
CArray2 |
( |
int32_t |
dim1 = 1 , |
|
|
int32_t |
dim2 = 1 | |
|
) |
| | |
constructor
- 参数:
-
| dim1 | dimension 1 |
| dim2 | dimension 2 |
在文件Array2.h第36行定义。
CArray2 |
( |
T * |
p_array, |
|
|
int32_t |
dim1, |
|
|
int32_t |
dim2, |
|
|
bool |
p_free_array = true , |
|
|
bool |
p_copy_array = false | |
|
) |
| | |
constructor
- 参数:
-
| p_array | another array |
| dim1 | dimension 1 |
| dim2 | dimension 2 |
| p_free_array | if array must be freed |
| p_copy_array | if array must be copied |
在文件Array2.h第49行定义。
CArray2 |
( |
const T * |
p_array, |
|
|
int32_t |
dim1, |
|
|
int32_t |
dim2 | |
|
) |
| | |
constructor
- 参数:
-
| p_array | another array |
| dim1 | dimension 1 |
| dim2 | dimension 2 |
在文件Array2.h第61行定义。
成员函数文档
void display_array |
( |
|
) |
const |
void display_size |
( |
|
) |
const |
const T& element |
( |
int32_t |
idx1, |
|
|
int32_t |
idx2 | |
|
) |
| | const |
get array element at index
- 参数:
-
| idx1 | index 1 |
| idx2 | index 2 |
- 返回:
- array element at index
在文件Array2.h第179行定义。
T& element |
( |
int32_t |
idx1, |
|
|
int32_t |
idx2 | |
|
) |
| | |
get array element at index
- 参数:
-
| idx1 | index 1 |
| idx2 | index 2 |
- 返回:
- array element at index
在文件Array2.h第190行定义。
T& element |
( |
T * |
p_array, |
|
|
int32_t |
idx1, |
|
|
int32_t |
idx2 | |
|
) |
| | |
get element of given array at given index
- 参数:
-
| p_array | another array |
| idx1 | index 1 |
| idx2 | index 2 |
- 返回:
- element of given array at given index
在文件Array2.h第204行定义。
T& element |
( |
T * |
p_array, |
|
|
int32_t |
idx1, |
|
|
int32_t |
idx2, |
|
|
int32_t |
p_dim1_size | |
|
) |
| | |
get element of given array at given index
- 参数:
-
| p_array | another array |
| idx1 | index 1 |
| idx2 | index 2 |
| p_dim1_size | size of dimension 1 |
- 返回:
- element of given array at given index
在文件Array2.h第220行定义。
get the array call get_array just before messing with it DO NOT call any [],resize/delete functions after get_array(), the pointer may become invalid !
- 返回:
- the array
重载CArray< T >。
在文件Array2.h第107行定义。
void get_array_size |
( |
int32_t & |
dim1, |
|
|
int32_t & |
dim2 | |
|
) |
| | |
return total array size (including granularity buffer)
- 参数:
-
| dim1 | dimension 1 will be stored here |
| dim2 | dimension 2 will be stored here |
在文件Array2.h第73行定义。
const T& get_element |
( |
int32_t |
idx1, |
|
|
int32_t |
idx2 | |
|
) |
| | const |
get array element at index
- 参数:
-
| idx1 | index 1 |
| idx2 | index 2 |
- 返回:
- array element at index
在文件Array2.h第152行定义。
virtual const char* get_name |
( |
|
) |
[virtual] |
operator overload for array assignment
- 参数:
-
- 返回:
- new array
在文件Array2.h第234行定义。
bool resize_array |
( |
int32_t |
dim1, |
|
|
int32_t |
dim2 | |
|
) |
| | |
resize array
- 参数:
-
| dim1 | new dimension 1 |
| dim2 | new dimension 2 |
- 返回:
- if resizing was successful
在文件Array2.h第139行定义。
void set_array |
( |
T * |
p_array, |
|
|
int32_t |
dim1, |
|
|
int32_t |
dim2, |
|
|
bool |
p_free_array = true , |
|
|
bool |
copy_array = false | |
|
) |
| | |
set the array pointer and free previously allocated memory
- 参数:
-
| p_array | another array |
| dim1 | dimension 1 |
| dim2 | dimensino 2 |
| p_free_array | if array must be freed |
| copy_array | if array must be copied |
在文件Array2.h第126行定义。
void set_const |
( |
T |
const_elem |
) |
|
bool set_element |
( |
const T & |
p_element, |
|
|
int32_t |
idx1, |
|
|
int32_t |
idx2 | |
|
) |
| | |
set array element at index 'index'
- 参数:
-
| p_element | array element |
| idx1 | index 1 |
| idx2 | index 2 |
- 返回:
- if setting was successful
在文件Array2.h第166行定义。
void set_name |
( |
const char * |
p_name |
) |
|
成员数据文档
该类的文档由以下文件生成: