SHOGUN  3.2.1
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 
所有成员列表 | Public 类型 | Public 成员函数 | 静态 Public 成员函数 | Public 属性 | Protected 成员函数
SGVector< T > Singleton Reference

详细描述

template<class T>
singleton shogun::SGVector< T >

shogun vector

在文件 Parameter.h28 行定义.

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

Public 类型

typedef T Scalar
 

Public 成员函数

 SGVector ()
 
 SGVector (T *v, index_t len, bool ref_counting=true)
 
 SGVector (T *m, index_t len, index_t offset)
 
 SGVector (index_t len, bool ref_counting=true)
 
 SGVector (const SGVector &orig)
 
 SGVector (EigenVectorXt &vec)
 
 SGVector (EigenRowVectorXt &vec)
 
 operator EigenVectorXtMap () const
 
 operator EigenRowVectorXtMap () const
 
void set_const (T const_elem)
 
SGVector< T > get ()
 
void set (SGVector< T > orig)
 
virtual ~SGVector ()
 
int32_t size () const
 
 operator T * ()
 
void zero ()
 
void range_fill (T start=0)
 
void random (T min_value, T max_value)
 
index_t find_position_to_insert (T element)
 
void qsort ()
 
SGVector< index_targsort ()
 
bool is_sorted () const
 
SGVector< T > clone () const
 
const T & get_element (index_t index)
 
void set_element (const T &p_element, index_t index)
 
void resize_vector (int32_t n)
 
const T & operator[] (uint64_t index) const
 
const T & operator[] (int64_t index) const
 
const T & operator[] (uint32_t index) const
 
const T & operator[] (int32_t index) const
 
T & operator[] (uint64_t index)
 
T & operator[] (int64_t index)
 
T & operator[] (uint32_t index)
 
T & operator[] (int32_t index)
 
void add (const SGVector< T > x)
 
void add (const SGSparseVector< T > &x)
 
void add (const T x)
 
SGVector< T > operator+ (SGVector< T > x)
 
SGVector< T > operator+= (SGVector< T > x)
 
SGVector< T > operator+= (SGSparseVector< T > &x)
 
bool equals (SGVector< T > &other)
 
product ()
 Return product(vec) 更多...
 
void display_size () const
 
void display_vector (const char *name="vector", const char *prefix="") const
 
SGVector< index_tfind (T elem)
 
template<typename Predicate >
SGVector< index_tfind_if (Predicate p)
 
void scale (T alpha)
 Scale vector inplace. 更多...
 
void load (CFile *loader)
 
void save (CFile *saver)
 
SGVector< float64_tget_real ()
 
SGVector< float64_tget_imag ()
 
template<>
void zero ()
 
template<>
SGVector< index_targsort ()
 
template<>
bool is_sorted () const
 
template<>
index_t find_position_to_insert (complex128_t element)
 
template<>
void range_fill_vector (complex128_t *vec, int32_t len, complex128_t start)
 
template<>
void display_vector (const bool *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void display_vector (const char *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void display_vector (const uint8_t *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void display_vector (const int8_t *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void display_vector (const uint16_t *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void display_vector (const int16_t *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void display_vector (const int32_t *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void display_vector (const uint32_t *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void display_vector (const int64_t *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void display_vector (const uint64_t *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void display_vector (const float32_t *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void display_vector (const float64_t *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void display_vector (const floatmax_t *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void display_vector (const complex128_t *vector, int32_t n, const char *name, const char *prefix)
 
template<>
void vec1_plus_scalar_times_vec2 (float64_t *vec1, float64_t scalar, const float64_t *vec2, int32_t n)
 
template<>
void vec1_plus_scalar_times_vec2 (float32_t *vec1, float32_t scalar, const float32_t *vec2, int32_t n)
 
template<>
void random_vector (complex128_t *vec, int32_t len, complex128_t min_value, complex128_t max_value)
 
template<>
bool twonorm (const bool *x, int32_t len)
 
template<>
char twonorm (const char *x, int32_t len)
 
template<>
int8_t twonorm (const int8_t *x, int32_t len)
 
template<>
uint8_t twonorm (const uint8_t *x, int32_t len)
 
template<>
int16_t twonorm (const int16_t *x, int32_t len)
 
template<>
uint16_t twonorm (const uint16_t *x, int32_t len)
 
template<>
int32_t twonorm (const int32_t *x, int32_t len)
 
template<>
uint32_t twonorm (const uint32_t *x, int32_t len)
 
template<>
int64_t twonorm (const int64_t *x, int32_t len)
 
template<>
uint64_t twonorm (const uint64_t *x, int32_t len)
 
template<>
float32_t twonorm (const float32_t *x, int32_t len)
 
template<>
float64_t twonorm (const float64_t *v, int32_t n)
 
template<>
floatmax_t twonorm (const floatmax_t *x, int32_t len)
 
template<>
complex128_t twonorm (const complex128_t *x, int32_t len)
 
template<>
complex128_t qsq (complex128_t *x, int32_t len, float64_t q)
 
template<>
complex128_t qnorm (complex128_t *x, int32_t len, float64_t q)
 
template<>
float64_t sum_abs (float64_t *vec, int32_t len)
 
template<>
float32_t sum_abs (float32_t *vec, int32_t len)
 
template<>
int32_t unique (complex128_t *output, int32_t size)
 
template<>
void scale_vector (float64_t alpha, float64_t *vec, int32_t len)
 
template<>
void scale_vector (float32_t alpha, float32_t *vec, int32_t len)
 
template<>
void load (CFile *loader)
 
template<>
void save (CFile *saver)
 
int32_t ref_count ()
 

静态 Public 成员函数

static T * clone_vector (const T *vec, int32_t len)
 
static void fill_vector (T *vec, int32_t len, T value)
 
static void range_fill_vector (T *vec, int32_t len, T start=0)
 
static void random_vector (T *vec, int32_t len, T min_value, T max_value)
 
static T twonorm (const T *x, int32_t len)
 || x ||_2 更多...
 
static float64_t onenorm (T *x, int32_t len)
 || x ||_1 更多...
 
static T qsq (T *x, int32_t len, float64_t q)
 || x ||_q^q 更多...
 
static T qnorm (T *x, int32_t len, float64_t q)
 || x ||_q 更多...
 
static void vec1_plus_scalar_times_vec2 (T *vec1, const T scalar, const T *vec2, int32_t n)
 x=x+alpha*y 更多...
 
static float64_t dot (const bool *v1, const bool *v2, int32_t n)
 Compute dot product between v1 and v2 (blas optimized) 更多...
 
static floatmax_t dot (const floatmax_t *v1, const floatmax_t *v2, int32_t n)
 Compute dot product between v1 and v2 (blas optimized) 更多...
 
static float64_t dot (const float64_t *v1, const float64_t *v2, int32_t n)
 Compute dot product between v1 and v2 (blas optimized) 更多...
 
static float32_t dot (const float32_t *v1, const float32_t *v2, int32_t n)
 Compute dot product between v1 and v2 (blas optimized) 更多...
 
static float64_t dot (const uint64_t *v1, const uint64_t *v2, int32_t n)
 compute dot product between v1 and v2 (for 64bit unsigned ints) 更多...
 
static float64_t dot (const int64_t *v1, const int64_t *v2, int32_t n)
 Compute dot product between v1 and v2 (for 64bit ints) 更多...
 
static float64_t dot (const int32_t *v1, const int32_t *v2, int32_t n)
 Compute dot product between v1 and v2 (for 32bit ints) 更多...
 
static float64_t dot (const uint32_t *v1, const uint32_t *v2, int32_t n)
 Compute dot product between v1 and v2 (for 32bit unsigned ints) 更多...
 
static float64_t dot (const uint16_t *v1, const uint16_t *v2, int32_t n)
 Compute dot product between v1 and v2 (for 16bit unsigned ints) 更多...
 
static float64_t dot (const int16_t *v1, const int16_t *v2, int32_t n)
 Compute dot product between v1 and v2 (for 16bit unsigned ints) 更多...
 
static float64_t dot (const char *v1, const char *v2, int32_t n)
 Compute dot product between v1 and v2 (for 8bit (un)signed ints) 更多...
 
static float64_t dot (const uint8_t *v1, const uint8_t *v2, int32_t n)
 Compute dot product between v1 and v2 (for 8bit (un)signed ints) 更多...
 
static float64_t dot (const int8_t *v1, const int8_t *v2, int32_t n)
 Compute dot product between v1 and v2 (for 8bit (un)signed ints) 更多...
 
static float64_t dot (const float64_t *v1, const char *v2, int32_t n)
 Compute dot product between v1 and v2. 更多...
 
static void vector_multiply (T *target, const T *v1, const T *v2, int32_t len)
 Compute vector multiplication. 更多...
 
static void add (T *target, T alpha, const T *v1, T beta, const T *v2, int32_t len)
 target=alpha*vec1 + beta*vec2 更多...
 
static void add_scalar (T alpha, T *vec, int32_t len)
 Add scalar to vector inplace. 更多...
 
static void scale_vector (T alpha, T *vec, int32_t len)
 Scale vector inplace. 更多...
 
static T sum (T *vec, int32_t len)
 Return sum(vec) 更多...
 
static T sum (SGVector< T > vec)
 Return sum(vec) 更多...
 
static T product (T *vec, int32_t len)
 Return the product of the vectors elements. 更多...
 
static T sum_abs (T *vec, int32_t len)
 return sum(abs(vec)) 更多...
 
static bool fequal (T x, T y, float64_t precision=1e-6)
 return sum(abs(vec)) 更多...
 
static int32_t unique (T *output, int32_t size)
 
static void display_vector (const T *vector, int32_t n, const char *name="vector", const char *prefix="")
 Display vector (useful for debugging) 更多...
 
static void display_vector (const SGVector< T >, const char *name="vector", const char *prefix="")
 Display vector (useful for debugging) 更多...
 
static SGMatrix< T > convert_to_matrix (SGVector< T > vector, index_t nrows, index_t ncols, bool fortran_order)
 
static void convert_to_matrix (T *&matrix, index_t nrows, index_t ncols, const T *vector, int32_t vlen, bool fortran_order)
 

Public 属性

T * vector
 
index_t vlen
 

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 ()
 

成员类型定义说明

typedef T Scalar

The scalar type of the vector

在文件 SGVector.h47 行定义.

构造及析构函数说明

SGVector ( )

Default constructor

在文件 SGVector.cpp73 行定义.

SGVector ( T *  v,
index_t  len,
bool  ref_counting = true 
)

Constructor for setting params

在文件 SGVector.cpp79 行定义.

SGVector ( T *  m,
index_t  len,
index_t  offset 
)

Wraps a vector around an existing memory segment with an offset

在文件 SGVector.h56 行定义.

SGVector ( index_t  len,
bool  ref_counting = true 
)

Constructor to create new vector in memory

在文件 SGVector.cpp85 行定义.

SGVector ( const SGVector< T > &  orig)

Copy constructor

在文件 SGVector.cpp92 行定义.

SGVector ( EigenVectorXt vec)

Wraps a matrix around the data of an Eigen3 column vector

在文件 SGVector.cpp111 行定义.

Wraps a matrix around the data of an Eigen3 row vector

在文件 SGVector.cpp118 行定义.

~SGVector ( )
virtual

Empty destructor

在文件 SGVector.cpp104 行定义.

成员函数说明

void add ( const SGVector< T >  x)

Add vector to current vector

参数
xadd vector x to current vector

在文件 SGVector.cpp350 行定义.

void add ( const SGSparseVector< T > &  x)

Add sparse vector to current vector

参数
xadd sparse vector x to current vector

在文件 SGVector.cpp369 行定义.

void add ( const T  x)

Add scalar to current vector

参数
xadd vector x to current vector

在文件 SGVector.cpp360 行定义.

static void add ( T *  target,
alpha,
const T *  v1,
beta,
const T *  v2,
int32_t  len 
)
static

target=alpha*vec1 + beta*vec2

在文件 SGVector.h475 行定义.

static void add_scalar ( alpha,
T *  vec,
int32_t  len 
)
static

Add scalar to vector inplace.

在文件 SGVector.h484 行定义.

SGVector< index_t > argsort ( )

Get sorted index.

idx = v.argsort() is similar to Matlab [~, idx] = sort(v)

返回
sorted index for this vector

在文件 SGVector.cpp215 行定义.

SGVector< index_t > argsort ( )

在文件 SGVector.cpp228 行定义.

SGVector< T > clone ( ) const

Clone vector

在文件 SGVector.cpp278 行定义.

T * clone_vector ( const T *  vec,
int32_t  len 
)
static

Clone vector

在文件 SGVector.cpp284 行定义.

SGMatrix< T > convert_to_matrix ( SGVector< T >  vector,
index_t  nrows,
index_t  ncols,
bool  fortran_order 
)
static

Create SGMatrix from linear vector

参数
vectorsource vector
nrowsnumber of rows
ncolsnumber of cols
fortran_orderorder of stroing matrix in linear vector true - column-major order (FORTRAN, MATLAB, R) false - row-major order (C, Python)
返回
matrix

在文件 SGVector.cpp1013 行定义.

void convert_to_matrix ( T *&  matrix,
index_t  nrows,
index_t  ncols,
const T *  vector,
int32_t  vlen,
bool  fortran_order 
)
static

Create matrix from linear vector

参数
matrixdestination memory
nrowsnumber of rows
ncolsnumber of cols
vectorsource vector
vlenlenght of source vector
fortran_orderorder of stroing matrix in linear vector true - column-major order (FORTRAN, MATLAB, R) false - row-major order (C, Python)
返回
matrix

在文件 SGVector.cpp1027 行定义.

void copy_data ( const SGReferencedData orig)
protectedvirtual

needs to be overridden to copy data

实现了 SGReferencedData.

在文件 SGVector.cpp389 行定义.

void copy_refcount ( const SGReferencedData orig)
protectedinherited

copy refcount

在文件 SGReferencedData.cpp55 行定义.

void display_size ( ) const

Display array size

在文件 SGVector.cpp383 行定义.

void display_vector ( const bool *  vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp440 行定义.

void display_vector ( const char *  vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp451 行定义.

void display_vector ( const uint8_t *  vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp462 行定义.

void display_vector ( const int8_t *  vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp473 行定义.

void display_vector ( const uint16_t *  vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp484 行定义.

void display_vector ( const int16_t *  vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp495 行定义.

void display_vector ( const int32_t *  vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp506 行定义.

void display_vector ( const uint32_t *  vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp517 行定义.

void display_vector ( const int64_t *  vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp529 行定义.

void display_vector ( const char *  name = "vector",
const char *  prefix = "" 
) const

Display vector

在文件 SGVector.cpp426 行定义.

void display_vector ( const uint64_t *  vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp540 行定义.

static void display_vector ( const T *  vector,
int32_t  n,
const char *  name = "vector",
const char *  prefix = "" 
)
static

Display vector (useful for debugging)

void display_vector ( const SGVector< T >  vector,
const char *  name = "vector",
const char *  prefix = "" 
)
static

Display vector (useful for debugging)

在文件 SGVector.cpp433 行定义.

void display_vector ( const float32_t vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp551 行定义.

void display_vector ( const float64_t vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp562 行定义.

void display_vector ( const floatmax_t vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp573 行定义.

void display_vector ( const complex128_t vector,
int32_t  n,
const char *  name,
const char *  prefix 
)

在文件 SGVector.cpp587 行定义.

static float64_t dot ( const bool *  v1,
const bool *  v2,
int32_t  n 
)
static

Compute dot product between v1 and v2 (blas optimized)

在文件 SGVector.h332 行定义.

static floatmax_t dot ( const floatmax_t v1,
const floatmax_t v2,
int32_t  n 
)
static

Compute dot product between v1 and v2 (blas optimized)

在文件 SGVector.h341 行定义.

float64_t dot ( const float64_t v1,
const float64_t v2,
int32_t  n 
)
static

Compute dot product between v1 and v2 (blas optimized)

在文件 SGVector.cpp635 行定义.

float32_t dot ( const float32_t v1,
const float32_t v2,
int32_t  n 
)
static

Compute dot product between v1 and v2 (blas optimized)

在文件 SGVector.cpp653 行定义.

static float64_t dot ( const uint64_t *  v1,
const uint64_t *  v2,
int32_t  n 
)
static

compute dot product between v1 and v2 (for 64bit unsigned ints)

在文件 SGVector.h357 行定义.

static float64_t dot ( const int64_t *  v1,
const int64_t *  v2,
int32_t  n 
)
static

Compute dot product between v1 and v2 (for 64bit ints)

在文件 SGVector.h367 行定义.

static float64_t dot ( const int32_t *  v1,
const int32_t *  v2,
int32_t  n 
)
static

Compute dot product between v1 and v2 (for 32bit ints)

在文件 SGVector.h378 行定义.

static float64_t dot ( const uint32_t *  v1,
const uint32_t *  v2,
int32_t  n 
)
static

Compute dot product between v1 and v2 (for 32bit unsigned ints)

在文件 SGVector.h389 行定义.

static float64_t dot ( const uint16_t *  v1,
const uint16_t *  v2,
int32_t  n 
)
static

Compute dot product between v1 and v2 (for 16bit unsigned ints)

在文件 SGVector.h400 行定义.

static float64_t dot ( const int16_t *  v1,
const int16_t *  v2,
int32_t  n 
)
static

Compute dot product between v1 and v2 (for 16bit unsigned ints)

在文件 SGVector.h411 行定义.

static float64_t dot ( const char *  v1,
const char *  v2,
int32_t  n 
)
static

Compute dot product between v1 and v2 (for 8bit (un)signed ints)

在文件 SGVector.h422 行定义.

static float64_t dot ( const uint8_t *  v1,
const uint8_t *  v2,
int32_t  n 
)
static

Compute dot product between v1 and v2 (for 8bit (un)signed ints)

在文件 SGVector.h433 行定义.

static float64_t dot ( const int8_t *  v1,
const int8_t *  v2,
int32_t  n 
)
static

Compute dot product between v1 and v2 (for 8bit (un)signed ints)

在文件 SGVector.h444 行定义.

static float64_t dot ( const float64_t v1,
const char *  v2,
int32_t  n 
)
static

Compute dot product between v1 and v2.

在文件 SGVector.h455 行定义.

bool equals ( SGVector< T > &  other)

Equals method up to precision for vectors (element-wise)

参数
othervector to compare with
返回
false if any element differs or if sizes are different, true otherwise

在文件 SGVector.cpp411 行定义.

bool fequal ( x,
y,
float64_t  precision = 1e-6 
)
static

return sum(abs(vec))

返回
sum(abs(vec))

在文件 SGVector.cpp894 行定义.

void fill_vector ( T *  vec,
int32_t  len,
value 
)
static

Fill vector

在文件 SGVector.cpp292 行定义.

SGVector< index_t > find ( elem)

Find index for occurance of an element

参数
elemthe element to find

在文件 SGVector.cpp922 行定义.

SGVector<index_t> find_if ( Predicate  p)

Find index for elements where the predicate returns true

参数
pthe predicate, it should accept the value of the element and return a bool

在文件 SGVector.h562 行定义.

index_t find_position_to_insert ( element)

For a sorted (ascending) vector, gets the index after the first element that is smaller than the given one

参数
elementelement to find index for
返回
index of the first element greater than given one

在文件 SGVector.cpp258 行定义.

index_t find_position_to_insert ( complex128_t  element)

在文件 SGVector.cpp270 行定义.

void free_data ( )
protectedvirtual

needs to be overridden to free data

实现了 SGReferencedData.

在文件 SGVector.cpp403 行定义.

SGVector<T> get ( )

Get the vector (no copying is done here)

返回
the refcount increased vector

在文件 SGVector.h92 行定义.

const T & get_element ( index_t  index)

Get vector element at index

参数
indexindex
返回
vector element at index

在文件 SGVector.cpp314 行定义.

SGVector< float64_t > get_imag ( )

Imag part of a complex128_t vector

在文件 SGVector.cpp1004 行定义.

SGVector< float64_t > get_real ( )

Real part of a complex128_t vector

在文件 SGVector.cpp996 行定义.

void init_data ( )
protectedvirtual

needs to be overridden to initialize empty data

实现了 SGReferencedData.

在文件 SGVector.cpp396 行定义.

bool is_sorted ( ) const

Check if vector is sorted

返回
true if vector is sorted, false otherwise

在文件 SGVector.cpp236 行定义.

bool is_sorted ( ) const

在文件 SGVector.cpp251 行定义.

void load ( CFile loader)

Load vector from file

参数
loaderFile object via which to load data

在文件 SGVector.cpp961 行定义.

void load ( CFile loader)

在文件 SGVector.cpp976 行定义.

float64_t onenorm ( T *  x,
int32_t  len 
)
static

|| x ||_1

在文件 SGVector.cpp821 行定义.

operator EigenRowVectorXtMap ( ) const

Wraps an Eigen3 row vector around the data of this matrix

在文件 SGVector.cpp131 行定义.

operator EigenVectorXtMap ( ) const

Wraps an Eigen3 column vector around the data of this matrix

在文件 SGVector.cpp125 行定义.

operator T * ( )

Cast to pointer

在文件 SGVector.h111 行定义.

SGVector< T > operator+ ( SGVector< T >  x)

Addition operator

addition operator

在文件 SGVector.cpp339 行定义.

SGVector<T> operator+= ( SGVector< T >  x)

Inplace addition operator

在文件 SGVector.h295 行定义.

SGVector<T> operator+= ( SGSparseVector< T > &  x)

Inplace addition operator for sparse vector

在文件 SGVector.h302 行定义.

const T& operator[] ( uint64_t  index) const

Operator overload for vector read only access

参数
indexdimension to access

在文件 SGVector.h198 行定义.

const T& operator[] ( int64_t  index) const

Operator overload for vector read only access

参数
indexdimension to access

在文件 SGVector.h208 行定义.

const T& operator[] ( uint32_t  index) const

Operator overload for vector read only access

参数
indexdimension to access

在文件 SGVector.h218 行定义.

const T& operator[] ( int32_t  index) const

Operator overload for vector read only access

参数
indexdimension to access

在文件 SGVector.h228 行定义.

T& operator[] ( uint64_t  index)

Operator overload for vector r/w access

参数
indexdimension to access

在文件 SGVector.h238 行定义.

T& operator[] ( int64_t  index)

Operator overload for vector r/w access

参数
indexdimension to access

在文件 SGVector.h248 行定义.

T& operator[] ( uint32_t  index)

Operator overload for vector r/w access

参数
indexdimension to access

在文件 SGVector.h258 行定义.

T& operator[] ( int32_t  index)

Operator overload for vector r/w access

参数
indexdimension to access

在文件 SGVector.h268 行定义.

static T product ( T *  vec,
int32_t  len 
)
static

Return the product of the vectors elements.

在文件 SGVector.h510 行定义.

T product ( )

Return product(vec)

在文件 SGVector.h520 行定义.

T qnorm ( T *  x,
int32_t  len,
float64_t  q 
)
static

|| x ||_q

在文件 SGVector.cpp850 行定义.

complex128_t qnorm ( complex128_t x,
int32_t  len,
float64_t  q 
)

在文件 SGVector.cpp857 行定义.

void qsort ( )

Quicksort the vector it is sorted from in ascending (for type T)

在文件 SGVector.cpp189 行定义.

T qsq ( T *  x,
int32_t  len,
float64_t  q 
)
static

|| x ||_q^q

在文件 SGVector.cpp832 行定义.

complex128_t qsq ( complex128_t x,
int32_t  len,
float64_t  q 
)

在文件 SGVector.cpp842 行定义.

void random ( min_value,
max_value 
)

Create random vector

参数
min_value[min_value,max_value]
max_value

在文件 SGVector.cpp181 行定义.

void random_vector ( T *  vec,
int32_t  len,
min_value,
max_value 
)
static

Random vector

在文件 SGVector.cpp671 行定义.

void random_vector ( complex128_t vec,
int32_t  len,
complex128_t  min_value,
complex128_t  max_value 
)

在文件 SGVector.cpp678 行定义.

void range_fill ( start = 0)

Range fill a vector with start...start+len-1

参数
start- value to be assigned to first element of vector

在文件 SGVector.cpp173 行定义.

void range_fill_vector ( T *  vec,
int32_t  len,
start = 0 
)
static

Range fill vector

在文件 SGVector.cpp299 行定义.

void range_fill_vector ( complex128_t vec,
int32_t  len,
complex128_t  start 
)

在文件 SGVector.cpp306 行定义.

int32_t ref ( )
protectedinherited

increase reference counter

返回
reference count

在文件 SGReferencedData.cpp64 行定义.

int32_t ref_count ( )
inherited

display reference counter

返回
reference count

在文件 SGReferencedData.cpp41 行定义.

void resize_vector ( int32_t  n)

Resize vector

参数
nnew size
返回
if resizing was successful

在文件 SGVector.cpp328 行定义.

void save ( CFile saver)

Save vector to file

参数
saverFile object via which to save data

在文件 SGVector.cpp981 行定义.

void save ( CFile saver)

在文件 SGVector.cpp991 行定义.

void scale ( alpha)

Scale vector inplace.

在文件 SGVector.cpp956 行定义.

void scale_vector ( alpha,
T *  vec,
int32_t  len 
)
static

Scale vector inplace.

在文件 SGVector.cpp935 行定义.

void scale_vector ( float64_t  alpha,
float64_t vec,
int32_t  len 
)

在文件 SGVector.cpp943 行定义.

void scale_vector ( float32_t  alpha,
float32_t vec,
int32_t  len 
)

在文件 SGVector.cpp949 行定义.

void set ( SGVector< T >  orig)

Wrapper for the copy constructor useful for SWIG interfaces

参数
origvector to set

在文件 SGVector.cpp98 行定义.

void set_const ( const_elem)

Set vector to a constant

参数
const_elem- value to set vector to

在文件 SGVector.cpp152 行定义.

void set_element ( const T &  p_element,
index_t  index 
)

Set vector element at index 'index' return false in case of trouble

参数
p_elementvector element to set
indexindex
返回
if setting was successful

在文件 SGVector.cpp321 行定义.

int32_t size ( ) const

Size

在文件 SGVector.h108 行定义.

static T sum ( T *  vec,
int32_t  len 
)
static

Return sum(vec)

在文件 SGVector.h494 行定义.

static T sum ( SGVector< T >  vec)
static

Return sum(vec)

在文件 SGVector.h504 行定义.

T sum_abs ( T *  vec,
int32_t  len 
)
static

return sum(abs(vec))

返回
sum(abs(vec))

在文件 SGVector.cpp865 行定义.

float64_t sum_abs ( float64_t vec,
int32_t  len 
)

在文件 SGVector.cpp876 行定义.

float32_t sum_abs ( float32_t vec,
int32_t  len 
)

在文件 SGVector.cpp884 行定义.

static T twonorm ( const T *  x,
int32_t  len 
)
static

|| x ||_2

bool twonorm ( const bool *  x,
int32_t  len 
)

在文件 SGVector.cpp685 行定义.

char twonorm ( const char *  x,
int32_t  len 
)

在文件 SGVector.cpp692 行定义.

int8_t twonorm ( const int8_t *  x,
int32_t  len 
)

在文件 SGVector.cpp699 行定义.

uint8_t twonorm ( const uint8_t *  x,
int32_t  len 
)

在文件 SGVector.cpp709 行定义.

int16_t twonorm ( const int16_t *  x,
int32_t  len 
)

在文件 SGVector.cpp719 行定义.

uint16_t twonorm ( const uint16_t *  x,
int32_t  len 
)

在文件 SGVector.cpp729 行定义.

int32_t twonorm ( const int32_t *  x,
int32_t  len 
)

在文件 SGVector.cpp739 行定义.

uint32_t twonorm ( const uint32_t *  x,
int32_t  len 
)

在文件 SGVector.cpp749 行定义.

int64_t twonorm ( const int64_t *  x,
int32_t  len 
)

在文件 SGVector.cpp759 行定义.

uint64_t twonorm ( const uint64_t *  x,
int32_t  len 
)

在文件 SGVector.cpp769 行定义.

float32_t twonorm ( const float32_t x,
int32_t  len 
)

在文件 SGVector.cpp779 行定义.

float64_t twonorm ( const float64_t v,
int32_t  n 
)

在文件 SGVector.cpp789 行定义.

floatmax_t twonorm ( const floatmax_t x,
int32_t  len 
)

在文件 SGVector.cpp801 行定义.

complex128_t twonorm ( const complex128_t x,
int32_t  len 
)

在文件 SGVector.cpp811 行定义.

int32_t unique ( T *  output,
int32_t  size 
)
static

Performs a inplace unique of a vector of type T using quicksort returns the new number of elements

在文件 SGVector.cpp900 行定义.

int32_t unique ( complex128_t output,
int32_t  size 
)

在文件 SGVector.cpp914 行定义.

int32_t unref ( )
protectedinherited

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

返回
reference count

在文件 SGReferencedData.cpp84 行定义.

void vec1_plus_scalar_times_vec2 ( T *  vec1,
const T  scalar,
const T *  vec2,
int32_t  n 
)
static

x=x+alpha*y

在文件 SGVector.cpp601 行定义.

void vec1_plus_scalar_times_vec2 ( float64_t vec1,
float64_t  scalar,
const float64_t vec2,
int32_t  n 
)

在文件 SGVector.cpp609 行定义.

void vec1_plus_scalar_times_vec2 ( float32_t vec1,
float32_t  scalar,
const float32_t vec2,
int32_t  n 
)

在文件 SGVector.cpp622 行定义.

static void vector_multiply ( T *  target,
const T *  v1,
const T *  v2,
int32_t  len 
)
static

Compute vector multiplication.

在文件 SGVector.h466 行定义.

void zero ( )

Fill vector with zeros

在文件 SGVector.cpp138 行定义.

void zero ( )

在文件 SGVector.cpp145 行定义.

类成员变量说明

T* vector

vector

在文件 SGVector.h635 行定义.

index_t vlen

length of vector

在文件 SGVector.h637 行定义.


The documentation for this singleton was generated from the following files:

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