SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
所有成员列表 | Public 成员函数 | Public 属性
v_array< T > 模板类 参考

详细描述

template<class T>
class shogun::v_array< T >

Class v_array taken directly from JL's implementation.

Class v_array is a templated class used to store variable length arrays. Memory locations are stored as 'extents', i.e., address of the first memory location and address after the last member.

`begin', `end' and `end_array' handle the extent of the array. `end_array' is the address at the end of the space allocated for the array while `end' is the address at the end of the space actually filled with elements.

The class should be instantiated on the basis of the data type of the contained array, eg. v_array<float32_t> if one wants to store a float32_t* array.

在文件 JLCoverTreePoint.h24 行定义.

Public 成员函数

last ()
 
void decr ()
 
 v_array ()
 
T & operator[] (unsigned int i)
 
 v_array ()
 
 ~v_array ()
 
T & operator[] (unsigned int i)
 
last ()
 
pop ()
 
bool empty ()
 
void decr ()
 
unsigned int index ()
 
void erase ()
 
void push (const T &new_elem)
 
void push_many (const T *new_elem, size_t num)
 
void reserve (size_t length)
 
void calloc_reserve (size_t length)
 
v_array< T > pop (v_array< v_array< T > > &stack)
 

Public 属性

int index
 
int length
 
T * elements
 
T * begin
 Pointer to first element of the array. 更多...
 
T * end
 Pointer to last set element in the array. 更多...
 
T * end_array
 Pointer to end of array, based on memory reserved. 更多...
 

构造及析构函数说明

v_array ( )

Create an empty v_array

在文件 JLCoverTreePoint.h35 行定义.

v_array ( )

Constructor. Sets begin and end pointers to NULL.

在文件 v_array.h49 行定义.

~v_array ( )

Destructor

will only free the array not the ptrs it contains

在文件 v_array.h60 行定义.

成员函数说明

void calloc_reserve ( size_t  length)

Reserve space for specified number of elements. No reallocation is done, array is replaced.

参数
length

在文件 v_array.h211 行定义.

void decr ( )

Decrement the pointer to the last element

在文件 JLCoverTreePoint.h32 行定义.

void decr ( )

Decrement the 'end' pointer.

在文件 v_array.h100 行定义.

bool empty ( )

Check if array is empty or not.

返回
whether array is empty

在文件 v_array.h94 行定义.

void erase ( )

Empty the array.

在文件 v_array.h113 行定义.

unsigned int index ( )

Get number of elements in array.

返回
number of array elements

在文件 v_array.h107 行定义.

T last ( )

Getter for the the last element of the v_array

返回
the last element of the array

在文件 JLCoverTreePoint.h29 行定义.

T last ( )

Return the last element.

返回
Last element of array

在文件 v_array.h80 行定义.

T& operator[] ( unsigned int  i)

Element access operator

参数
iof the element to be read
返回
the corresponding element

在文件 JLCoverTreePoint.h40 行定义.

T& operator[] ( unsigned int  i)

Operator [] overloaded to return the i-th element of the stored array.

参数
iindex of the element, starting at 0
返回
element at position i

在文件 v_array.h73 行定义.

T pop ( )

Pop from the array.

返回
Popped element

在文件 v_array.h87 行定义.

v_array< T > pop ( v_array< v_array< T > > &  stack)

Pop an array from a list of arrays.

参数
stackarray of arrays
返回
popped array

在文件 v_array.h219 行定义.

void push ( const T &  new_elem)

Push an element into the array.

参数
new_elemelement to be pushed

在文件 v_array.h168 行定义.

void push_many ( const T *  new_elem,
size_t  num 
)

Push multiple elements into the array.

参数
new_elempointer to first element
numnumber of elements

在文件 v_array.h183 行定义.

void reserve ( size_t  length)

Reserve space for specified number of elements. Reallocate, keeping the elements currently in the array.

参数
lengthnumber of elements to accommodate

在文件 v_array.h199 行定义.

类成员变量说明

T* begin

Pointer to first element of the array.

在文件 v_array.h157 行定义.

T* elements

Pointer to the beginning of the v_array elements

在文件 JLCoverTreePoint.h50 行定义.

T* end

Pointer to last set element in the array.

在文件 v_array.h160 行定义.

T* end_array

Pointer to end of array, based on memory reserved.

在文件 v_array.h163 行定义.

int index

Pointer to the last element of the v_array

在文件 JLCoverTreePoint.h44 行定义.

int length

Length of the v_array

在文件 JLCoverTreePoint.h47 行定义.


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

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