SHOGUN  v3.2.0
所有成员列表 | Public 成员函数 | 静态 Public 成员函数 | Public 属性 | Protected 成员函数
SGVector< T > 模板类 参考

详细描述

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

shogun vector

在文件 ProbabilityDistribution.h 第 19 行定义.

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

Public 成员函数

 SGVector ()
 
 SGVector (T *v, index_t len, bool ref_counting=true)
 
 SGVector (index_t len, bool ref_counting=true)
 
 SGVector (const SGVector &orig)
 
void set (SGVector< T > orig)
 
virtual ~SGVector ()
 
int32_t size () const
 
 operator T * ()
 
void zero ()
 
void set_const (T const_elem)
 
void range_fill (T start=0)
 
void random (T min_value, T max_value)
 
void randperm ()
 
index_t find_position_to_insert (T element)
 
void qsort ()
 
SGVector< index_t > argsort ()
 
bool is_sorted () const
 
SGVector< T > clone () const
 
SGVector< T > get ()
 
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)
 
void permute ()
 
void permute (CRandom *rand)
 
T product ()
 return product(vec) 更多...
 
void display_size () const
 
void display_vector (const char *name="vector", const char *prefix="") const
 
SGVector< index_t > find (T elem)
 
template<typename Predicate >
SGVector< index_t > find_if (Predicate p)
 
void scale (T alpha)
 scale vector inplace 更多...
 
float64_t mean () const
 
void load (CFile *loader)
 
void save (CFile *saver)
 
void abs ()
 absolute value of vector elements 更多...
 
void acos ()
 arc cosine of vector elements 更多...
 
void asin ()
 arc sine of vector elements 更多...
 
void atan ()
 arc tangent of vector elements 更多...
 
void atan2 (T x)
 atan2 of vector elements 更多...
 
void cos ()
 cosine of vector elements 更多...
 
void cosh ()
 hyperbolic cosine of vector elements 更多...
 
void exp ()
 exponential of vector elements 更多...
 
void log ()
 natural logarithm of vector elements 更多...
 
void log10 ()
 common logarithm of vector elements 更多...
 
void pow (T q)
 power of vector elements 更多...
 
void sin ()
 sine of vector elements 更多...
 
void sinh ()
 hyperbolic sine of vector elements 更多...
 
void sqrt ()
 square root of vector elements 更多...
 
void tan ()
 tangent of vector elements 更多...
 
void tanh ()
 hyperbolic tangent of vector elements 更多...
 
SGVector< float64_t > get_real ()
 
SGVector< float64_t > get_imag ()
 
template<>
void zero ()
 
template<>
SGVector< index_t > argsort ()
 
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<>
SGVector< complex128_t > randperm_vec (int32_t n)
 
template<>
complex128_t * randperm (int32_t n)
 
template<>
void randperm (complex128_t *perm, int32_t n)
 
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 max_abs (float64_t *vec, int32_t len)
 
template<>
float32_t max_abs (float32_t *vec, int32_t len)
 
template<>
complex128_t max_abs (complex128_t *vec, int32_t len)
 
template<>
int32_t arg_max_abs (float64_t *vec, int32_t inc, int32_t len, float64_t *maxv_ptr)
 
template<>
int32_t arg_max_abs (float32_t *vec, int32_t inc, int32_t len, float32_t *maxv_ptr)
 
template<>
int32_t arg_max_abs (complex128_t *vec, int32_t inc, int32_t len, complex128_t *maxv_ptr)
 
template<>
int32_t arg_max (complex128_t *vec, int32_t inc, int32_t len, complex128_t *maxv_ptr)
 
template<>
int32_t arg_min (complex128_t *vec, int32_t inc, int32_t len, complex128_t *minv_ptr)
 
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<>
float64_t mean () const
 
template<>
void load (CFile *loader)
 
template<>
void save (CFile *saver)
 
template<>
float64_t * linspace (complex128_t start, complex128_t end, int32_t n)
 
template<>
void pow (complex128_t q)
 
int32_t ref_count ()
 

静态 Public 成员函数

static SGVector< T > randperm_vec (int32_t n)
 
static T * randperm (int32_t n)
 
static SGVector< float64_t > linspace_vec (T start, T end, int32_t n)
 
static float64_t * linspace (T start, T end, int32_t n)
 
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 void randperm (T *perm, int32_t n)
 
static void permute (T *vec, int32_t n)
 
static void permute (T *vec, int32_t n, CRandom *rand)
 
static void permute_vector (SGVector< T > vec)
 
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 min (T *vec, int32_t len)
 
static T max_abs (T *vec, int32_t len)
 
static T max (T *vec, int32_t len)
 
static int32_t arg_max (T *vec, int32_t inc, int32_t len, T *maxv_ptr=NULL)
 return arg_max(vec) 更多...
 
static int32_t arg_max_abs (T *vec, int32_t inc, int32_t len, T *maxv_ptr=NULL)
 return arg_max_abs(vec) 更多...
 
static int32_t arg_min (T *vec, int32_t inc, int32_t len, T *minv_ptr=NULL)
 return arg_min(vec) 更多...
 
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 ()
 

构造及析构函数说明

SGVector ( )

default constructor

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

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

constructor for setting params

在文件 SGVector.cpp 第 79 行定义.

SGVector ( index_t  len,
bool  ref_counting = true 
)

constructor to create new vector in memory

在文件 SGVector.cpp 第 85 行定义.

SGVector ( const SGVector< T > &  orig)

copy constructor

在文件 SGVector.cpp 第 92 行定义.

~SGVector ( )
virtual

empty destructor

在文件 SGVector.cpp 第 104 行定义.

成员函数说明

void abs ( )

absolute value of vector elements

void acos ( )

arc cosine of vector elements

void add ( const SGVector< T >  x)

add vector to current vector

参数
xadd vector x to current vector

在文件 SGVector.cpp 第 329 行定义.

void add ( const SGSparseVector< T > &  x)

add sparse vector to current vector

参数
xadd sparse vector x to current vector

在文件 SGVector.cpp 第 348 行定义.

void add ( const T  x)

add scalar to current vector

参数
xadd vector x to current vector

在文件 SGVector.cpp 第 339 行定义.

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

target=alpha*vec1 + beta*vec2

在文件 SGVector.h 第 487 行定义.

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

add scalar to vector inplace

在文件 SGVector.h 第 496 行定义.

int32_t arg_max ( T *  vec,
int32_t  inc,
int32_t  len,
T *  maxv_ptr = NULL 
)
static

return arg_max(vec)

在文件 SGVector.cpp 第 1048 行定义.

int32_t arg_max ( complex128_t *  vec,
int32_t  inc,
int32_t  len,
complex128_t *  maxv_ptr 
)

在文件 SGVector.cpp 第 1068 行定义.

int32_t arg_max_abs ( T *  vec,
int32_t  inc,
int32_t  len,
T *  maxv_ptr = NULL 
)
static

return arg_max_abs(vec)

在文件 SGVector.cpp 第 1019 行定义.

int32_t arg_max_abs ( float64_t *  vec,
int32_t  inc,
int32_t  len,
float64_t *  maxv_ptr 
)

在文件 SGVector.cpp 第 994 行定义.

int32_t arg_max_abs ( float32_t *  vec,
int32_t  inc,
int32_t  len,
float32_t *  maxv_ptr 
)

在文件 SGVector.cpp 第 1006 行定义.

int32_t arg_max_abs ( complex128_t *  vec,
int32_t  inc,
int32_t  len,
complex128_t *  maxv_ptr 
)

在文件 SGVector.cpp 第 1039 行定义.

int32_t arg_min ( T *  vec,
int32_t  inc,
int32_t  len,
T *  minv_ptr = NULL 
)
static

return arg_min(vec)

在文件 SGVector.cpp 第 1079 行定义.

int32_t arg_min ( complex128_t *  vec,
int32_t  inc,
int32_t  len,
complex128_t *  minv_ptr 
)

在文件 SGVector.cpp 第 1099 行定义.

SGVector< index_t > argsort ( )

get sorted index.

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

返回
sorted index for this vector

在文件 SGVector.cpp 第 194 行定义.

SGVector< index_t > argsort ( )

在文件 SGVector.cpp 第 207 行定义.

void asin ( )

arc sine of vector elements

void atan ( )

arc tangent of vector elements

void atan2 ( T  x)

atan2 of vector elements

在文件 SGVector.cpp 第 1314 行定义.

SGVector< T > clone ( ) const

clone vector

在文件 SGVector.cpp 第 257 行定义.

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

clone vector

在文件 SGVector.cpp 第 263 行定义.

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.cpp 第 1376 行定义.

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.cpp 第 1390 行定义.

void copy_data ( const SGReferencedData &  orig)
protectedvirtual

needs to be overridden to copy data

实现了 SGReferencedData.

在文件 SGVector.cpp 第 368 行定义.

void copy_refcount ( const SGReferencedData &  orig)
protectedinherited

copy refcount

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

void cos ( )

cosine of vector elements

void cosh ( )

hyperbolic cosine of vector elements

void display_size ( ) const

display array size

在文件 SGVector.cpp 第 362 行定义.

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

在文件 SGVector.cpp 第 419 行定义.

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

在文件 SGVector.cpp 第 430 行定义.

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

在文件 SGVector.cpp 第 441 行定义.

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

在文件 SGVector.cpp 第 452 行定义.

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

在文件 SGVector.cpp 第 463 行定义.

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

在文件 SGVector.cpp 第 474 行定义.

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

在文件 SGVector.cpp 第 485 行定义.

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

在文件 SGVector.cpp 第 496 行定义.

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

在文件 SGVector.cpp 第 508 行定义.

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

在文件 SGVector.cpp 第 519 行定义.

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

在文件 SGVector.cpp 第 530 行定义.

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

在文件 SGVector.cpp 第 541 行定义.

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

在文件 SGVector.cpp 第 552 行定义.

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

在文件 SGVector.cpp 第 566 行定义.

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

display vector

在文件 SGVector.cpp 第 405 行定义.

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.cpp 第 412 行定义.

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

compute dot product between v1 and v2 (blas optimized)

在文件 SGVector.h 第 344 行定义.

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.h 第 353 行定义.

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.cpp 第 614 行定义.

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.cpp 第 632 行定义.

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.h 第 369 行定义.

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.h 第 379 行定义.

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.h 第 390 行定义.

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.h 第 401 行定义.

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.h 第 412 行定义.

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.h 第 423 行定义.

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.h 第 434 行定义.

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.h 第 445 行定义.

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.h 第 456 行定义.

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

compute dot product between v1 and v2

在文件 SGVector.h 第 467 行定义.

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.cpp 第 390 行定义.

void exp ( )

exponential of vector elements

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

return sum(abs(vec))

在文件 SGVector.cpp 第 1138 行定义.

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

fill vector

在文件 SGVector.cpp 第 271 行定义.

SGVector< index_t > find ( T  elem)

find index for occurance of an element

参数
elemthe element to find

在文件 SGVector.cpp 第 1166 行定义.

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.h 第 592 行定义.

index_t find_position_to_insert ( T  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.cpp 第 237 行定义.

index_t find_position_to_insert ( complex128_t  element)

在文件 SGVector.cpp 第 249 行定义.

void free_data ( )
protectedvirtual

needs to be overridden to free data

实现了 SGReferencedData.

在文件 SGVector.cpp 第 382 行定义.

SGVector<T> get ( )

get the vector (no copying is done here)

返回
the refcount increased vector

在文件 SGVector.h 第 169 行定义.

const T & get_element ( index_t  index)

get vector element at index

参数
indexindex
返回
vector element at index

在文件 SGVector.cpp 第 293 行定义.

SGVector< float64_t > get_imag ( )

imag part of a complex128_t vector

在文件 SGVector.cpp 第 1367 行定义.

SGVector< float64_t > get_real ( )

real part of a complex128_t vector

在文件 SGVector.cpp 第 1359 行定义.

void init_data ( )
protectedvirtual

needs to be overridden to initialize empty data

实现了 SGReferencedData.

在文件 SGVector.cpp 第 375 行定义.

bool is_sorted ( ) const

check if vector is sorted

返回
true if vector is sorted, false otherwise

在文件 SGVector.cpp 第 215 行定义.

bool is_sorted ( ) const

在文件 SGVector.cpp 第 230 行定义.

float64_t * linspace ( T  start,
T  end,
int32_t  n 
)
static

Returns an array with n linearly spaced elements between start and end.

参数
startbeginning of the interval to divide
endupper bound of the interval to divide
nnumber of elements used to divide the interval
返回
array with linearly spaced elements within the interval

在文件 SGVector.cpp 第 1336 行定义.

float64_t * linspace ( complex128_t  start,
complex128_t  end,
int32_t  n 
)

在文件 SGVector.cpp 第 1345 行定义.

SGVector< float64_t > linspace_vec ( T  start,
T  end,
int32_t  n 
)
static

Returns a vector with n linearly spaced elements between start and end.

参数
startbeginning of the interval to divide
endupper bound of the interval to divide
nnumber of elements used to divide the interval
返回
vector with linearly spaced elements within the interval

在文件 SGVector.cpp 第 1330 行定义.

void load ( CFile *  loader)

load vector from file

参数
loaderFile object via which to load data

在文件 SGVector.cpp 第 1222 行定义.

void load ( CFile *  loader)

在文件 SGVector.cpp 第 1237 行定义.

void log ( )

natural logarithm of vector elements

void log10 ( )

common logarithm of vector elements

T max ( T *  vec,
int32_t  len 
)
static
返回
max(vec)

在文件 SGVector.cpp 第 981 行定义.

T max_abs ( T *  vec,
int32_t  len 
)
static
返回
max(abs(vec))
max_abs(vec)

在文件 SGVector.cpp 第 961 行定义.

float64_t max_abs ( float64_t *  vec,
int32_t  len 
)

在文件 SGVector.cpp 第 939 行定义.

float32_t max_abs ( float32_t *  vec,
int32_t  len 
)

在文件 SGVector.cpp 第 949 行定义.

complex128_t max_abs ( complex128_t *  vec,
int32_t  len 
)

在文件 SGVector.cpp 第 973 行定义.

float64_t mean ( ) const

compute the mean value of the vector

返回
the mean value

在文件 SGVector.cpp 第 1205 行定义.

float64_t mean ( ) const

在文件 SGVector.cpp 第 1216 行定义.

T min ( T *  vec,
int32_t  len 
)
static
返回
min(vec)

在文件 SGVector.cpp 第 926 行定义.

float64_t onenorm ( T *  x,
int32_t  len 
)
static

|| x ||_1

在文件 SGVector.cpp 第 882 行定义.

operator T * ( )

cast to pointer

在文件 SGVector.h 第 57 行定义.

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

addition operator

在文件 SGVector.cpp 第 318 行定义.

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

inplace addition operator

在文件 SGVector.h 第 298 行定义.

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

inplace addition operator for sparse vector

在文件 SGVector.h 第 305 行定义.

const T& operator[] ( uint64_t  index) const

operator overload for vector read only access

参数
indexdimension to access

在文件 SGVector.h 第 201 行定义.

const T& operator[] ( int64_t  index) const

operator overload for vector read only access

参数
indexdimension to access

在文件 SGVector.h 第 211 行定义.

const T& operator[] ( uint32_t  index) const

operator overload for vector read only access

参数
indexdimension to access

在文件 SGVector.h 第 221 行定义.

const T& operator[] ( int32_t  index) const

operator overload for vector read only access

参数
indexdimension to access

在文件 SGVector.h 第 231 行定义.

T& operator[] ( uint64_t  index)

operator overload for vector r/w access

参数
indexdimension to access

在文件 SGVector.h 第 241 行定义.

T& operator[] ( int64_t  index)

operator overload for vector r/w access

参数
indexdimension to access

在文件 SGVector.h 第 251 行定义.

T& operator[] ( uint32_t  index)

operator overload for vector r/w access

参数
indexdimension to access

在文件 SGVector.h 第 261 行定义.

T& operator[] ( int32_t  index)

operator overload for vector r/w access

参数
indexdimension to access

在文件 SGVector.h 第 271 行定义.

void permute ( T *  vec,
int32_t  n 
)
static

permute

在文件 SGVector.cpp 第 710 行定义.

void permute ( T *  vec,
int32_t  n,
CRandom *  rand 
)
static

permute with given CRandom state

在文件 SGVector.cpp 第 717 行定义.

void permute ( )

create a random permutation in place

在文件 SGVector.cpp 第 724 行定义.

void permute ( CRandom *  rand)

create a random permutation with given CRandom state

在文件 SGVector.cpp 第 730 行定义.

void permute_vector ( SGVector< T >  vec)
static

permute vector

在文件 SGVector.cpp 第 736 行定义.

void pow ( T  q)

power of vector elements

在文件 SGVector.cpp 第 1323 行定义.

void pow ( complex128_t  q)

在文件 SGVector.cpp 第 1353 行定义.

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

return the product of the vectors elements

在文件 SGVector.h 第 522 行定义.

T product ( )

return product(vec)

在文件 SGVector.h 第 532 行定义.

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

|| x ||_q

在文件 SGVector.cpp 第 911 行定义.

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

在文件 SGVector.cpp 第 918 行定义.

void qsort ( )

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

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

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

|| x ||_q^q

在文件 SGVector.cpp 第 893 行定义.

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

在文件 SGVector.cpp 第 903 行定义.

void random ( T  min_value,
T  max_value 
)

create random vector

参数
min_value[min_value,max_value]
max_value

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

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

random vector

在文件 SGVector.cpp 第 650 行定义.

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

在文件 SGVector.cpp 第 657 行定义.

void randperm ( )

Returns a random permutation of number from 0 to len-1

在文件 SGVector.cpp 第 161 行定义.

T * randperm ( int32_t  n)
static

Returns a random permutation of number from 0 to n-1. Caller has to free memory.

参数
nrange of permutation
返回
random permutation of number from 0 to n-1

在文件 SGVector.cpp 第 678 行定义.

void randperm ( T *  perm,
int32_t  n 
)
static

random permatutaion

在文件 SGVector.cpp 第 695 行定义.

complex128_t * randperm ( int32_t  n)

在文件 SGVector.cpp 第 687 行定义.

void randperm ( complex128_t *  perm,
int32_t  n 
)

在文件 SGVector.cpp 第 703 行定义.

SGVector< T > randperm_vec ( int32_t  n)
static

Returns a random permutation of number from 0 to n-1

在文件 SGVector.cpp 第 664 行定义.

SGVector< complex128_t > randperm_vec ( int32_t  n)

在文件 SGVector.cpp 第 670 行定义.

void range_fill ( T  start = 0)

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

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

在文件 SGVector.cpp 第 145 行定义.

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

range fill vector

在文件 SGVector.cpp 第 278 行定义.

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

在文件 SGVector.cpp 第 285 行定义.

int32_t ref ( )
protectedinherited

increase reference counter

返回
reference count

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

int32_t ref_count ( )
inherited

display reference counter

返回
reference count

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

void resize_vector ( int32_t  n)

resize vector

参数
nnew size
返回
if resizing was successful

在文件 SGVector.cpp 第 307 行定义.

void save ( CFile *  saver)

save vector to file

参数
saverFile object via which to save data

在文件 SGVector.cpp 第 1242 行定义.

void save ( CFile *  saver)

在文件 SGVector.cpp 第 1252 行定义.

void scale ( T  alpha)

scale vector inplace

在文件 SGVector.cpp 第 1200 行定义.

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

scale vector inplace

在文件 SGVector.cpp 第 1179 行定义.

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

在文件 SGVector.cpp 第 1187 行定义.

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

在文件 SGVector.cpp 第 1193 行定义.

void set ( SGVector< T >  orig)

wrapper for the copy constructor useful for SWIG interfaces

参数
origvector to set

在文件 SGVector.cpp 第 98 行定义.

void set_const ( T  const_elem)

set vector to a constant

参数
const_elem- value to set vector to

在文件 SGVector.cpp 第 124 行定义.

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.cpp 第 300 行定义.

void sin ( )

sine of vector elements

void sinh ( )

hyperbolic sine of vector elements

int32_t size ( ) const

size

在文件 SGVector.h 第 54 行定义.

void sqrt ( )

square root of vector elements

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

return sum(vec)

在文件 SGVector.h 第 506 行定义.

static T sum ( SGVector< T >  vec)
static

return sum(vec)

在文件 SGVector.h 第 516 行定义.

T sum_abs ( T *  vec,
int32_t  len 
)
static

return sum(abs(vec))

在文件 SGVector.cpp 第 1109 行定义.

float64_t sum_abs ( float64_t *  vec,
int32_t  len 
)

在文件 SGVector.cpp 第 1120 行定义.

float32_t sum_abs ( float32_t *  vec,
int32_t  len 
)

在文件 SGVector.cpp 第 1128 行定义.

void tan ( )

tangent of vector elements

void tanh ( )

hyperbolic tangent of vector elements

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

|| x ||_2

bool twonorm ( const bool *  x,
int32_t  len 
)

在文件 SGVector.cpp 第 746 行定义.

char twonorm ( const char *  x,
int32_t  len 
)

在文件 SGVector.cpp 第 753 行定义.

int8_t twonorm ( const int8_t *  x,
int32_t  len 
)

在文件 SGVector.cpp 第 760 行定义.

uint8_t twonorm ( const uint8_t *  x,
int32_t  len 
)

在文件 SGVector.cpp 第 770 行定义.

int16_t twonorm ( const int16_t *  x,
int32_t  len 
)

在文件 SGVector.cpp 第 780 行定义.

uint16_t twonorm ( const uint16_t *  x,
int32_t  len 
)

在文件 SGVector.cpp 第 790 行定义.

int32_t twonorm ( const int32_t *  x,
int32_t  len 
)

在文件 SGVector.cpp 第 800 行定义.

uint32_t twonorm ( const uint32_t *  x,
int32_t  len 
)

在文件 SGVector.cpp 第 810 行定义.

int64_t twonorm ( const int64_t *  x,
int32_t  len 
)

在文件 SGVector.cpp 第 820 行定义.

uint64_t twonorm ( const uint64_t *  x,
int32_t  len 
)

在文件 SGVector.cpp 第 830 行定义.

float32_t twonorm ( const float32_t *  x,
int32_t  len 
)

在文件 SGVector.cpp 第 840 行定义.

float64_t twonorm ( const float64_t *  v,
int32_t  n 
)

在文件 SGVector.cpp 第 850 行定义.

floatmax_t twonorm ( const floatmax_t *  x,
int32_t  len 
)

在文件 SGVector.cpp 第 862 行定义.

complex128_t twonorm ( const complex128_t *  x,
int32_t  len 
)

在文件 SGVector.cpp 第 872 行定义.

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.cpp 第 1144 行定义.

int32_t unique ( complex128_t *  output,
int32_t  size 
)

在文件 SGVector.cpp 第 1158 行定义.

int32_t unref ( )
protectedinherited

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

返回
reference count

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

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

x=x+alpha*y

在文件 SGVector.cpp 第 580 行定义.

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

在文件 SGVector.cpp 第 588 行定义.

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

在文件 SGVector.cpp 第 601 行定义.

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

compute vector multiplication

在文件 SGVector.h 第 478 行定义.

void zero ( )

fill vector with zeros

在文件 SGVector.cpp 第 110 行定义.

void zero ( )

在文件 SGVector.cpp 第 117 行定义.

类成员变量说明

T* vector

vector

在文件 SGVector.h 第 704 行定义.

index_t vlen

length of vector

在文件 SGVector.h 第 706 行定义.


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

SHOGUN Machine Learning Toolbox - Documentation