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 |
T * | data () 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) |
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) |
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. 更多... | |
void | load (CFile *loader) |
void | save (CFile *saver) |
SGVector< float64_t > | get_real () |
SGVector< float64_t > | get_imag () |
template<> | |
void | zero () |
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 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 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.h 第 47 行定义.
SGVector | ( | ) |
Default constructor
在文件 SGVector.cpp 第 73 行定义.
Constructor for setting params
在文件 SGVector.cpp 第 79 行定义.
Wraps a vector around an existing memory segment with an offset
在文件 SGVector.h 第 56 行定义.
Constructor to create new vector in memory
在文件 SGVector.cpp 第 85 行定义.
Copy constructor
在文件 SGVector.cpp 第 92 行定义.
SGVector | ( | EigenVectorXt & | vec | ) |
Wraps a matrix around the data of an Eigen3 column vector
在文件 SGVector.cpp 第 111 行定义.
SGVector | ( | EigenRowVectorXt & | vec | ) |
Wraps a matrix around the data of an Eigen3 row vector
在文件 SGVector.cpp 第 118 行定义.
|
virtual |
Empty destructor
在文件 SGVector.cpp 第 104 行定义.
void add | ( | const SGVector< T > | x | ) |
void add | ( | const SGSparseVector< T > & | x | ) |
Add sparse vector to current vector
x | add sparse vector x to current vector |
在文件 SGVector.cpp 第 299 行定义.
void add | ( | const T | x | ) |
|
static |
target=alpha*vec1 + beta*vec2
在文件 SGVector.h 第 335 行定义.
|
static |
Add scalar to vector inplace.
在文件 SGVector.h 第 344 行定义.
SGVector< T > clone | ( | ) | const |
Clone vector
在文件 SGVector.cpp 第 209 行定义.
|
static |
Clone vector
在文件 SGVector.cpp 第 215 行定义.
|
static |
Create SGMatrix from linear vector
vector | source vector |
nrows | number of rows |
ncols | number of cols |
fortran_order | order of stroing matrix in linear vector true - column-major order (FORTRAN, MATLAB, R) false - row-major order (C, Python) |
在文件 SGVector.cpp 第 900 行定义.
|
static |
Create matrix from linear vector
matrix | destination memory |
nrows | number of rows |
ncols | number of cols |
vector | source vector |
vlen | lenght of source vector |
fortran_order | order of stroing matrix in linear vector true - column-major order (FORTRAN, MATLAB, R) false - row-major order (C, Python) |
在文件 SGVector.cpp 第 914 行定义.
|
protectedvirtual |
|
protectedinherited |
copy refcount
在文件 SGReferencedData.cpp 第 55 行定义.
T* data | ( | ) | const |
Data pointer
在文件 SGVector.h 第 118 行定义.
void display_size | ( | ) | const |
Display array size
在文件 SGVector.cpp 第 313 行定义.
void display_vector | ( | const bool * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 370 行定义.
void display_vector | ( | const char * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 381 行定义.
void display_vector | ( | const uint8_t * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 392 行定义.
void display_vector | ( | const char * | name = "vector" , |
const char * | prefix = "" |
||
) | const |
Display vector
在文件 SGVector.cpp 第 356 行定义.
|
static |
Display vector (useful for debugging)
void display_vector | ( | const int8_t * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 403 行定义.
|
static |
Display vector (useful for debugging)
在文件 SGVector.cpp 第 363 行定义.
void display_vector | ( | const uint16_t * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 414 行定义.
void display_vector | ( | const int16_t * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 425 行定义.
void display_vector | ( | const int32_t * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 436 行定义.
void display_vector | ( | const uint32_t * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 447 行定义.
void display_vector | ( | const int64_t * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 459 行定义.
void display_vector | ( | const uint64_t * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 470 行定义.
void display_vector | ( | const float32_t * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 481 行定义.
void display_vector | ( | const float64_t * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 492 行定义.
void display_vector | ( | const floatmax_t * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 503 行定义.
void display_vector | ( | const complex128_t * | vector, |
int32_t | n, | ||
const char * | name, | ||
const char * | prefix | ||
) |
在文件 SGVector.cpp 第 517 行定义.
bool equals | ( | SGVector< T > & | other | ) |
Equals method up to precision for vectors (element-wise)
other | vector to compare with |
在文件 SGVector.cpp 第 341 行定义.
|
static |
Fill vector
在文件 SGVector.cpp 第 223 行定义.
Find index for elements where the predicate returns true
p | the predicate, it should accept the value of the element and return a bool |
在文件 SGVector.h 第 419 行定义.
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
element | element to find index for |
在文件 SGVector.cpp 第 189 行定义.
index_t find_position_to_insert | ( | complex128_t | element | ) |
在文件 SGVector.cpp 第 201 行定义.
|
protectedvirtual |
SGVector<T> get | ( | ) |
const T & get_element | ( | index_t | index | ) |
Imag part of a complex128_t vector
在文件 SGVector.cpp 第 891 行定义.
Real part of a complex128_t vector
在文件 SGVector.cpp 第 883 行定义.
|
protectedvirtual |
void load | ( | CFile * | loader | ) |
void load | ( | CFile * | loader | ) |
在文件 SGVector.cpp 第 863 行定义.
|
static |
|| x ||_1
在文件 SGVector.cpp 第 715 行定义.
operator EigenRowVectorXtMap | ( | ) | const |
Wraps an Eigen3 row vector around the data of this matrix
在文件 SGVector.cpp 第 131 行定义.
operator EigenVectorXtMap | ( | ) | const |
Wraps an Eigen3 column vector around the data of this matrix
在文件 SGVector.cpp 第 125 行定义.
operator T * | ( | ) |
Cast to pointer
在文件 SGVector.h 第 124 行定义.
Inplace addition operator
在文件 SGVector.h 第 289 行定义.
SGVector<T> operator+= | ( | SGSparseVector< T > & | x | ) |
Inplace addition operator for sparse vector
在文件 SGVector.h 第 296 行定义.
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 | ) |
|
static |
Return the product of the vectors elements.
在文件 SGVector.h 第 370 行定义.
T product | ( | ) |
Return product(vec)
在文件 SGVector.h 第 380 行定义.
|
static |
|| x ||_q
在文件 SGVector.cpp 第 744 行定义.
complex128_t qnorm | ( | complex128_t * | x, |
int32_t | len, | ||
float64_t | q | ||
) |
在文件 SGVector.cpp 第 751 行定义.
|
static |
|| x ||_q^q
在文件 SGVector.cpp 第 726 行定义.
complex128_t qsq | ( | complex128_t * | x, |
int32_t | len, | ||
float64_t | q | ||
) |
在文件 SGVector.cpp 第 736 行定义.
void random | ( | T | min_value, |
T | max_value | ||
) |
|
static |
Random vector
在文件 SGVector.cpp 第 565 行定义.
void random_vector | ( | complex128_t * | vec, |
int32_t | len, | ||
complex128_t | min_value, | ||
complex128_t | max_value | ||
) |
在文件 SGVector.cpp 第 572 行定义.
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 第 173 行定义.
|
static |
Range fill vector
在文件 SGVector.cpp 第 230 行定义.
void range_fill_vector | ( | complex128_t * | vec, |
int32_t | len, | ||
complex128_t | start | ||
) |
在文件 SGVector.cpp 第 237 行定义.
|
protectedinherited |
|
inherited |
void resize_vector | ( | int32_t | n | ) |
void save | ( | CFile * | saver | ) |
void save | ( | CFile * | saver | ) |
在文件 SGVector.cpp 第 878 行定义.
void scale | ( | T | alpha | ) |
Scale vector inplace.
在文件 SGVector.cpp 第 843 行定义.
|
static |
Scale vector inplace.
在文件 SGVector.cpp 第 822 行定义.
在文件 SGVector.cpp 第 830 行定义.
在文件 SGVector.cpp 第 836 行定义.
void set | ( | SGVector< T > | orig | ) |
Wrapper for the copy constructor useful for SWIG interfaces
orig | vector to set |
在文件 SGVector.cpp 第 98 行定义.
void set_const | ( | T | const_elem | ) |
void set_element | ( | const T & | p_element, |
index_t | index | ||
) |
Set vector element at index 'index' return false in case of trouble
p_element | vector element to set |
index | index |
在文件 SGVector.cpp 第 252 行定义.
int32_t size | ( | ) | const |
Size
在文件 SGVector.h 第 115 行定义.
|
static |
Return sum(vec)
在文件 SGVector.h 第 354 行定义.
|
static |
Return sum(vec)
在文件 SGVector.h 第 364 行定义.
|
static |
在文件 SGVector.cpp 第 770 行定义.
在文件 SGVector.cpp 第 778 行定义.
|
static |
|| x ||_2
bool twonorm | ( | const bool * | x, |
int32_t | len | ||
) |
在文件 SGVector.cpp 第 579 行定义.
char twonorm | ( | const char * | x, |
int32_t | len | ||
) |
在文件 SGVector.cpp 第 586 行定义.
int8_t twonorm | ( | const int8_t * | x, |
int32_t | len | ||
) |
在文件 SGVector.cpp 第 593 行定义.
uint8_t twonorm | ( | const uint8_t * | x, |
int32_t | len | ||
) |
在文件 SGVector.cpp 第 603 行定义.
int16_t twonorm | ( | const int16_t * | x, |
int32_t | len | ||
) |
在文件 SGVector.cpp 第 613 行定义.
uint16_t twonorm | ( | const uint16_t * | x, |
int32_t | len | ||
) |
在文件 SGVector.cpp 第 623 行定义.
int32_t twonorm | ( | const int32_t * | x, |
int32_t | len | ||
) |
在文件 SGVector.cpp 第 633 行定义.
uint32_t twonorm | ( | const uint32_t * | x, |
int32_t | len | ||
) |
在文件 SGVector.cpp 第 643 行定义.
int64_t twonorm | ( | const int64_t * | x, |
int32_t | len | ||
) |
在文件 SGVector.cpp 第 653 行定义.
uint64_t twonorm | ( | const uint64_t * | x, |
int32_t | len | ||
) |
在文件 SGVector.cpp 第 663 行定义.
在文件 SGVector.cpp 第 673 行定义.
在文件 SGVector.cpp 第 683 行定义.
floatmax_t twonorm | ( | const floatmax_t * | x, |
int32_t | len | ||
) |
在文件 SGVector.cpp 第 695 行定义.
complex128_t twonorm | ( | const complex128_t * | x, |
int32_t | len | ||
) |
在文件 SGVector.cpp 第 705 行定义.
|
static |
Performs a inplace unique of a vector of type T using quicksort returns the new number of elements
在文件 SGVector.cpp 第 787 行定义.
int32_t unique | ( | complex128_t * | output, |
int32_t | size | ||
) |
在文件 SGVector.cpp 第 801 行定义.
|
protectedinherited |
decrement reference counter and deallocate object if refcount is zero before or after decrementing it
在文件 SGReferencedData.cpp 第 84 行定义.
|
static |
x=x+alpha*y
在文件 SGVector.cpp 第 531 行定义.
void vec1_plus_scalar_times_vec2 | ( | float64_t * | vec1, |
float64_t | scalar, | ||
const float64_t * | vec2, | ||
int32_t | n | ||
) |
在文件 SGVector.cpp 第 539 行定义.
void vec1_plus_scalar_times_vec2 | ( | float32_t * | vec1, |
float32_t | scalar, | ||
const float32_t * | vec2, | ||
int32_t | n | ||
) |
在文件 SGVector.cpp 第 552 行定义.
|
static |
Compute vector multiplication.
在文件 SGVector.h 第 326 行定义.
void zero | ( | ) |
Fill vector with zeros
在文件 SGVector.cpp 第 138 行定义.
void zero | ( | ) |
在文件 SGVector.cpp 第 145 行定义.
T* vector |
vector
在文件 SGVector.h 第 492 行定义.
index_t vlen |
length of vector
在文件 SGVector.h 第 494 行定义.