SHOGUN  4.1.0
所有成员列表 | Public 成员函数 | Public 属性 | Protected 成员函数
SGNDArray< T > 模板类 参考

详细描述

template<class T>
class shogun::SGNDArray< T >

shogun n-dimensional array

在文件 SGNDArray.h 第 25 行定义.

类 SGNDArray< T > 继承关系图:
Inheritance graph
[图例]

Public 成员函数

 SGNDArray ()
 
 SGNDArray (T *a, index_t *d, index_t nd, bool ref_counting=true)
 
 SGNDArray (index_t *d, index_t nd, bool ref_counting=true)
 
 SGNDArray (SGVector< index_t > d, bool ref_counting=true)
 
 SGNDArray (const SGNDArray &orig)
 
virtual ~SGNDArray ()
 
SGNDArray< T > clone () const
 
T * get_matrix (index_t matIdx) const
 
void transpose_matrix (index_t matIdx) const
 
const T & operator[] (index_t index) const
 
T & operator[] (index_t index)
 
SGVector< index_t > get_dimensions () const
 
void set_const (T const_elem)
 
SGNDArray< T > & operator*= (T val)
 
SGNDArray< T > & operator+= (SGNDArray &ndarray)
 
SGNDArray< T > & operator-= (SGNDArray &ndarray)
 
T max_element (index_t &max_at)
 
void expand (SGNDArray &big_array, SGVector< index_t > &axes)
 
T get_value (SGVector< index_t > index) const
 
void next_index (SGVector< index_t > &curr_index) const
 
template<>
SGNDArray< bool > & operator*= (bool val)
 
template<>
SGNDArray< char > & operator*= (char val)
 
template<>
SGNDArray< bool > & operator+= (SGNDArray &ndarray)
 
template<>
SGNDArray< char > & operator+= (SGNDArray &ndarray)
 
template<>
SGNDArray< bool > & operator-= (SGNDArray &ndarray)
 
template<>
SGNDArray< char > & operator-= (SGNDArray &ndarray)
 
template<>
bool max_element (int32_t &max_at)
 
template<>
char max_element (int32_t &max_at)
 
int32_t ref_count ()
 

Public 属性

T * array
 
index_t * dims
 
index_t num_dims
 
index_t len_array
 

Protected 成员函数

virtual void copy_data (const SGReferencedData &orig)
 
virtual void init_data ()
 
virtual void free_data ()
 
void copy_refcount (const SGReferencedData &orig)
 
int32_t ref ()
 
int32_t unref ()
 

构造及析构函数说明

SGNDArray ( )

default constructor

在文件 SGNDArray.cpp 第 20 行定义.

SGNDArray ( T *  a,
index_t *  d,
index_t  nd,
bool  ref_counting = true 
)

constructor for setting params

参数
adata of the array
ddimentions of the array
ndnumber of dimentions
ref_countingif true, count the reference

在文件 SGNDArray.cpp 第 26 行定义.

SGNDArray ( index_t *  d,
index_t  nd,
bool  ref_counting = true 
)

constructor to create new ndarray in memory

参数
ddimentions of the array
ndnumber of dimentions
ref_countingif true, count the reference

在文件 SGNDArray.cpp 第 39 行定义.

SGNDArray ( SGVector< index_t >  d,
bool  ref_counting = true 
)

constructor to create new ndarray of given bases

参数
ddimentions of the array
ref_countingif true, count the reference

在文件 SGNDArray.cpp 第 50 行定义.

SGNDArray ( const SGNDArray< T > &  orig)

copy constructor

参数
origthe original N-d array

在文件 SGNDArray.cpp 第 67 行定义.

~SGNDArray ( )
virtual

empty destructor

在文件 SGNDArray.cpp 第 73 行定义.

成员函数说明

SGNDArray< T > clone ( ) const
返回
the cloned N-d array

在文件 SGNDArray.cpp 第 105 行定义.

void copy_data ( const SGReferencedData &  orig)
protectedvirtual

copy data

实现了 SGReferencedData.

在文件 SGNDArray.cpp 第 78 行定义.

void copy_refcount ( const SGReferencedData &  orig)
protectedinherited

copy refcount

在文件 SGReferencedData.cpp 第 55 行定义.

void expand ( SGNDArray< T > &  big_array,
SGVector< index_t > &  axes 
)

expand to a big size array

参数
big_arraythe target big size array
axesthe axis where the current ndarray will be replicated

在文件 SGNDArray.cpp 第 303 行定义.

void free_data ( )
protectedvirtual

free data

实现了 SGReferencedData.

在文件 SGNDArray.cpp 第 94 行定义.

SGVector< index_t > get_dimensions ( ) const
返回
dimentions of the N-d array

在文件 SGNDArray.cpp 第 112 行定义.

T* get_matrix ( index_t  matIdx) const

get a matrix formed by the two first dimensions

参数
matIdxmatrix index
返回
pointer to the matrix

在文件 SGNDArray.h 第 72 行定义.

T get_value ( SGVector< index_t >  index) const

get the value at index

参数
indexvector of indices where the value to retrieve of the array is located
返回
the value at index

在文件 SGNDArray.cpp 第 266 行定义.

void init_data ( )
protectedvirtual

init data

实现了 SGReferencedData.

在文件 SGNDArray.cpp 第 86 行定义.

T max_element ( index_t &  max_at)

find the maximum value of the elements

参数
max_atthe index of the maximum element, index is in 1-d flattend array. If there are multiple maximum element, return the last index.
返回
the maximum value

在文件 SGNDArray.cpp 第 232 行定义.

bool max_element ( int32_t &  max_at)

在文件 SGNDArray.cpp 第 252 行定义.

char max_element ( int32_t &  max_at)

在文件 SGNDArray.cpp 第 259 行定义.

void next_index ( SGVector< index_t > &  curr_index) const

get the next index from the current one

参数
curr_indexthe current index

在文件 SGNDArray.cpp 第 286 行定义.

SGNDArray< T > & operator*= ( T  val)

operator overload of multiplication assignment

参数
vala scalar value to multiply
返回
the result N-d array

在文件 SGNDArray.cpp 第 153 行定义.

SGNDArray< bool > & operator*= ( bool  val)

在文件 SGNDArray.cpp 第 162 行定义.

SGNDArray< char > & operator*= ( char  val)

在文件 SGNDArray.cpp 第 169 行定义.

SGNDArray< T > & operator+= ( SGNDArray< T > &  ndarray)

operator overload of addition assignment

参数
ndarrayN-d array to add
返回
the result N-d array

在文件 SGNDArray.cpp 第 176 行定义.

SGNDArray< bool > & operator+= ( SGNDArray< T > &  ndarray)

在文件 SGNDArray.cpp 第 190 行定义.

SGNDArray< char > & operator+= ( SGNDArray< T > &  ndarray)

在文件 SGNDArray.cpp 第 197 行定义.

SGNDArray< T > & operator-= ( SGNDArray< T > &  ndarray)

operator overload of subtruction assignment

参数
ndarrayN-d array to add
返回
the result N-d array

在文件 SGNDArray.cpp 第 204 行定义.

SGNDArray< bool > & operator-= ( SGNDArray< T > &  ndarray)

在文件 SGNDArray.cpp 第 218 行定义.

SGNDArray< char > & operator-= ( SGNDArray< T > &  ndarray)

在文件 SGNDArray.cpp 第 225 行定义.

const T& operator[] ( index_t  index) const

operator overload for ndarray read only access

参数
indexto access

在文件 SGNDArray.h 第 88 行定义.

T& operator[] ( index_t  index)

operator overload for ndarray r/w access

参数
indexto access

在文件 SGNDArray.h 第 97 行定义.

int32_t ref ( )
protectedinherited

increase reference counter

返回
reference count

在文件 SGReferencedData.cpp 第 64 行定义.

int32_t ref_count ( )
inherited

display reference counter

返回
reference count

在文件 SGReferencedData.cpp 第 41 行定义.

void set_const ( T  const_elem)

set N-d array to a constant

参数
const_elemconstant value to set N-d array to

在文件 SGNDArray.cpp 第 146 行定义.

void transpose_matrix ( index_t  matIdx) const

transposes a matrix formed by the two first dimensions

参数
matIdxmatrix index

在文件 SGNDArray.cpp 第 122 行定义.

int32_t unref ( )
protectedinherited

decrement reference counter and deallocate object if refcount is zero before or after decrementing it

返回
reference count

在文件 SGReferencedData.cpp 第 84 行定义.

类成员变量说明

T* array

array

在文件 SGNDArray.h 第 174 行定义.

index_t* dims

dimension sizes

在文件 SGNDArray.h 第 177 行定义.

index_t len_array

the flatten length of the N-d array

在文件 SGNDArray.h 第 183 行定义.

index_t num_dims

number of dimensions

在文件 SGNDArray.h 第 180 行定义.


该类的文档由以下文件生成:

SHOGUN 机器学习工具包 - 项目文档