shogun vector
Definition at line 28 of file SGVector.h.
Classes | |
struct | IndexSorter |
Public Member Functions | |
SGVector () | |
SGVector (T *v, index_t len, bool ref_counting=true) | |
SGVector (index_t len, bool ref_counting=true) | |
SGVector (const SGVector &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 () |
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[] (index_t index) const |
T & | operator[] (index_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) |
void | permute () |
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) |
SGVector< index_t > | sorted_index () |
void | scale (T alpha) |
scale vector inplace | |
float64_t | mean () const |
void | load (CFile *loader) |
void | save (CFile *saver) |
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<> | |
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) |
int32_t | ref_count () |
Static Public Member Functions | |
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_vector (SGVector< T > vec) |
static void | resize (T *&data, int64_t old_size, int64_t new_size) |
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 (float64_t *vec1, const float64_t scalar, const float64_t *vec2, int32_t n) |
x=x+alpha*y (blas optimized) | |
static void | vec1_plus_scalar_times_vec2 (float32_t *vec1, const float32_t scalar, const float32_t *vec2, int32_t n) |
x=x+alpha*y (blas optimized) | |
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 | min (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_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) | |
Public Attributes | |
T * | vector |
index_t | vlen |
Protected Member Functions | |
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
Definition at line 25 of file SGVector.cpp.
constructor for setting params
Definition at line 30 of file SGVector.cpp.
constructor to create new vector in memory
Definition at line 35 of file SGVector.cpp.
copy constructor
Definition at line 41 of file SGVector.cpp.
~SGVector | ( | ) | [virtual] |
empty destructor
Definition at line 46 of file SGVector.cpp.
void add | ( | const SGVector< T > | x | ) |
add vector to current vector
x | add vector x to current vector |
Definition at line 104 of file SGVector.cpp.
void add | ( | const SGSparseVector< T > & | x | ) |
add sparse vector to current vector
x | add sparse vector x to current vector |
Definition at line 121 of file SGVector.cpp.
void add | ( | const T | x | ) |
add scalar to current vector
x | add vector x to current vector |
Definition at line 113 of file SGVector.cpp.
static void add | ( | T * | target, | |
T | alpha, | |||
const T * | v1, | |||
T | beta, | |||
const T * | v2, | |||
int32_t | len | |||
) | [static] |
target=alpha*vec1 + beta*vec2
Definition at line 385 of file SGVector.h.
static void add_scalar | ( | T | alpha, | |
T * | vec, | |||
int32_t | len | |||
) | [static] |
add scalar to vector inplace
Definition at line 394 of file SGVector.h.
static int32_t arg_max | ( | T * | vec, | |
int32_t | inc, | |||
int32_t | len, | |||
T * | maxv_ptr = NULL | |||
) | [static] |
return arg_max(vec)
Definition at line 431 of file SGVector.h.
static int32_t arg_min | ( | T * | vec, | |
int32_t | inc, | |||
int32_t | len, | |||
T * | minv_ptr = NULL | |||
) | [static] |
return arg_min(vec)
Definition at line 451 of file SGVector.h.
SGVector< T > clone | ( | ) | const |
clone vector
Definition at line 78 of file SGVector.cpp.
static T* clone_vector | ( | const T * | vec, | |
int32_t | len | |||
) | [static] |
clone vector
Definition at line 81 of file SGVector.h.
void copy_data | ( | const SGReferencedData & | orig | ) | [protected, virtual] |
needs to be overridden to copy data
Implements SGReferencedData.
Definition at line 139 of file SGVector.cpp.
void copy_refcount | ( | const SGReferencedData & | orig | ) | [protected, inherited] |
copy refcount
Definition at line 102 of file SGReferencedData.h.
void display_size | ( | ) | const |
display array size
Definition at line 134 of file SGVector.cpp.
void display_vector | ( | const SGVector< T > | vector, | |
const char * | name = "vector" , |
|||
const char * | prefix = "" | |||
) | [static] |
display vector (useful for debugging)
Definition at line 165 of file SGVector.cpp.
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 bool * | vector, | |
int32_t | n, | |||
const char * | name, | |||
const char * | prefix | |||
) |
Definition at line 172 of file SGVector.cpp.
void display_vector | ( | const char * | vector, | |
int32_t | n, | |||
const char * | name, | |||
const char * | prefix | |||
) |
Definition at line 183 of file SGVector.cpp.
void display_vector | ( | const uint8_t * | vector, | |
int32_t | n, | |||
const char * | name, | |||
const char * | prefix | |||
) |
Definition at line 194 of file SGVector.cpp.
void display_vector | ( | const int8_t * | vector, | |
int32_t | n, | |||
const char * | name, | |||
const char * | prefix | |||
) |
Definition at line 205 of file SGVector.cpp.
void display_vector | ( | const uint16_t * | vector, | |
int32_t | n, | |||
const char * | name, | |||
const char * | prefix | |||
) |
Definition at line 216 of file SGVector.cpp.
void display_vector | ( | const float64_t * | vector, | |
int32_t | n, | |||
const char * | name, | |||
const char * | prefix | |||
) |
Definition at line 294 of file SGVector.cpp.
void display_vector | ( | const int16_t * | vector, | |
int32_t | n, | |||
const char * | name, | |||
const char * | prefix | |||
) |
Definition at line 227 of file SGVector.cpp.
void display_vector | ( | const int32_t * | vector, | |
int32_t | n, | |||
const char * | name, | |||
const char * | prefix | |||
) |
Definition at line 238 of file SGVector.cpp.
void display_vector | ( | const uint32_t * | vector, | |
int32_t | n, | |||
const char * | name, | |||
const char * | prefix | |||
) |
Definition at line 249 of file SGVector.cpp.
void display_vector | ( | const int64_t * | vector, | |
int32_t | n, | |||
const char * | name, | |||
const char * | prefix | |||
) |
Definition at line 261 of file SGVector.cpp.
void display_vector | ( | const uint64_t * | vector, | |
int32_t | n, | |||
const char * | name, | |||
const char * | prefix | |||
) |
Definition at line 272 of file SGVector.cpp.
void display_vector | ( | const float32_t * | vector, | |
int32_t | n, | |||
const char * | name, | |||
const char * | prefix | |||
) |
Definition at line 283 of file SGVector.cpp.
void display_vector | ( | const floatmax_t * | vector, | |
int32_t | n, | |||
const char * | name, | |||
const char * | prefix | |||
) |
Definition at line 305 of file SGVector.cpp.
void display_vector | ( | const char * | name = "vector" , |
|
const char * | prefix = "" | |||
) | const |
display vector
Definition at line 158 of file SGVector.cpp.
static float64_t dot | ( | const bool * | v1, | |
const bool * | v2, | |||
int32_t | n | |||
) | [static] |
compute dot product between v1 and v2 (blas optimized)
Definition at line 242 of file SGVector.h.
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)
Definition at line 251 of file SGVector.h.
compute dot product between v1 and v2 (blas optimized)
Definition at line 345 of file SGVector.cpp.
compute dot product between v1 and v2 (blas optimized)
Definition at line 365 of file SGVector.cpp.
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)
Definition at line 267 of file SGVector.h.
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)
Definition at line 277 of file SGVector.h.
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)
Definition at line 288 of file SGVector.h.
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)
Definition at line 310 of file SGVector.h.
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)
Definition at line 299 of file SGVector.h.
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)
Definition at line 321 of file SGVector.h.
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)
Definition at line 332 of file SGVector.h.
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)
Definition at line 343 of file SGVector.h.
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)
Definition at line 354 of file SGVector.h.
compute dot product between v1 and v2
Definition at line 365 of file SGVector.h.
bool fequal | ( | T | x, | |
T | y, | |||
float64_t | precision = 1e-6 | |||
) | [static] |
return sum(abs(vec))
Definition at line 619 of file SGVector.cpp.
static void fill_vector | ( | T * | vec, | |
int32_t | len, | |||
T | value | |||
) | [static] |
fill vector
Definition at line 89 of file SGVector.h.
find index for occurance of an element
elem | the element to find |
Definition at line 639 of file SGVector.cpp.
find index for elements where the predicate returns true
p | the predicate, it should accept the value of the element and return a bool |
Definition at line 507 of file SGVector.h.
void free_data | ( | ) | [protected, virtual] |
needs to be overridden to free data
Implements SGReferencedData.
Definition at line 151 of file SGVector.cpp.
const T & get_element | ( | index_t | index | ) |
get vector element at index
index | index |
Definition at line 83 of file SGVector.cpp.
void init_data | ( | ) | [protected, virtual] |
needs to be overridden to initialize empty data
Implements SGReferencedData.
Definition at line 145 of file SGVector.cpp.
void load | ( | CFile * | loader | ) |
load vector from file
loader | File object via which to load data |
Definition at line 666 of file SGVector.cpp.
T max | ( | T * | vec, | |
int32_t | len | |||
) | [static] |
Definition at line 595 of file SGVector.cpp.
float64_t mean | ( | ) | const |
compute the mean value of the vector
Definition at line 656 of file SGVector.cpp.
T min | ( | T * | vec, | |
int32_t | len | |||
) | [static] |
Definition at line 582 of file SGVector.cpp.
float64_t onenorm | ( | T * | x, | |
int32_t | len | |||
) | [static] |
|| x ||_1
Definition at line 552 of file SGVector.cpp.
operator T * | ( | ) |
cast to pointer
Definition at line 50 of file SGVector.h.
addition operator
Definition at line 172 of file SGVector.h.
SGVector<T> operator+= | ( | SGSparseVector< T > & | x | ) |
inplace addition operator for sparse vector
Definition at line 190 of file SGVector.h.
inplace addition operator
Definition at line 183 of file SGVector.h.
const T& operator[] | ( | index_t | index | ) | const |
operator overload for vector read only access
index | dimension to access |
Definition at line 138 of file SGVector.h.
T& operator[] | ( | index_t | index | ) |
operator overload for vector r/w access
index | dimension to access |
Definition at line 148 of file SGVector.h.
void permute | ( | ) |
create a random permutation in place
Definition at line 409 of file SGVector.cpp.
void permute | ( | T * | vec, | |
int32_t | n | |||
) | [static] |
permute
Definition at line 403 of file SGVector.cpp.
void permute_vector | ( | SGVector< T > | vec | ) | [static] |
permute vector
Definition at line 415 of file SGVector.cpp.
T qnorm | ( | T * | x, | |
int32_t | len, | |||
float64_t | q | |||
) | [static] |
|| x ||_q
Definition at line 574 of file SGVector.cpp.
T qsq | ( | T * | x, | |
int32_t | len, | |||
float64_t | q | |||
) | [static] |
|| x ||_q^q
Definition at line 563 of file SGVector.cpp.
void random | ( | T | min_value, | |
T | max_value | |||
) |
create random vector
min_value | [min_value,max_value] | |
max_value |
Definition at line 68 of file SGVector.cpp.
void random_vector | ( | T * | vec, | |
int32_t | len, | |||
T | min_value, | |||
T | max_value | |||
) | [static] |
random vector
Definition at line 386 of file SGVector.cpp.
void randperm | ( | T * | perm, | |
int32_t | n | |||
) | [static] |
random permatutaion
Definition at line 394 of file SGVector.cpp.
void randperm | ( | ) |
random permutate
Definition at line 73 of file SGVector.cpp.
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 |
Definition at line 63 of file SGVector.cpp.
static void range_fill_vector | ( | T * | vec, | |
int32_t | len, | |||
T | start = 0 | |||
) | [static] |
range fill vector
Definition at line 96 of file SGVector.h.
int32_t ref | ( | ) | [protected, inherited] |
increase reference counter
Definition at line 111 of file SGReferencedData.h.
int32_t ref_count | ( | ) | [inherited] |
static void resize | ( | T *& | data, | |
int64_t | old_size, | |||
int64_t | new_size | |||
) | [static] |
resize array from old_size to new_size (keeping as much array content as possible intact)
Definition at line 205 of file SGVector.h.
void resize_vector | ( | int32_t | n | ) |
resize vector
n | new size |
Definition at line 95 of file SGVector.cpp.
void save | ( | CFile * | saver | ) |
save vector to file
saver | File object via which to save data |
Definition at line 674 of file SGVector.cpp.
void scale | ( | T | alpha | ) |
scale vector inplace
Definition at line 651 of file SGVector.cpp.
static void scale_vector | ( | T | alpha, | |
T * | vec, | |||
int32_t | len | |||
) | [static] |
scale vector inplace
Definition at line 401 of file SGVector.h.
void set_const | ( | T | const_elem | ) |
set vector to a constant
const_elem | - value to set vector to |
Definition at line 57 of file SGVector.cpp.
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 |
Definition at line 89 of file SGVector.cpp.
int32_t size | ( | ) | const |
size
Definition at line 47 of file SGVector.h.
get sorted index.
idx = v.sorted_index() is similar to Matlab [~, idx] = sort(v)
Definition at line 541 of file SGVector.h.
static T sum | ( | T * | vec, | |
int32_t | len | |||
) | [static] |
return sum(vec)
Definition at line 408 of file SGVector.h.
static T sum | ( | SGVector< T > | vec | ) | [static] |
return sum(vec)
Definition at line 418 of file SGVector.h.
T sum_abs | ( | T * | vec, | |
int32_t | len | |||
) | [static] |
return sum(abs(vec))
Definition at line 608 of file SGVector.cpp.
uint64_t twonorm | ( | const uint64_t * | x, | |
int32_t | len | |||
) |
Definition at line 509 of file SGVector.cpp.
Definition at line 519 of file SGVector.cpp.
uint32_t twonorm | ( | const uint32_t * | x, | |
int32_t | len | |||
) |
Definition at line 489 of file SGVector.cpp.
Definition at line 529 of file SGVector.cpp.
floatmax_t twonorm | ( | const floatmax_t * | x, | |
int32_t | len | |||
) |
Definition at line 541 of file SGVector.cpp.
static T twonorm | ( | const T * | x, | |
int32_t | len | |||
) | [static] |
|| x ||_2
int16_t twonorm | ( | const int16_t * | x, | |
int32_t | len | |||
) |
Definition at line 459 of file SGVector.cpp.
int64_t twonorm | ( | const int64_t * | x, | |
int32_t | len | |||
) |
Definition at line 499 of file SGVector.cpp.
uint8_t twonorm | ( | const uint8_t * | x, | |
int32_t | len | |||
) |
Definition at line 449 of file SGVector.cpp.
int32_t twonorm | ( | const int32_t * | x, | |
int32_t | len | |||
) |
Definition at line 479 of file SGVector.cpp.
int8_t twonorm | ( | const int8_t * | x, | |
int32_t | len | |||
) |
Definition at line 439 of file SGVector.cpp.
bool twonorm | ( | const bool * | x, | |
int32_t | len | |||
) |
Definition at line 425 of file SGVector.cpp.
char twonorm | ( | const char * | x, | |
int32_t | len | |||
) |
Definition at line 432 of file SGVector.cpp.
uint16_t twonorm | ( | const uint16_t * | x, | |
int32_t | len | |||
) |
Definition at line 469 of file SGVector.cpp.
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
Definition at line 625 of file SGVector.cpp.
int32_t unref | ( | ) | [protected, inherited] |
decrement reference counter and deallocate object if refcount is zero before or after decrementing it
Definition at line 136 of file SGReferencedData.h.
void vec1_plus_scalar_times_vec2 | ( | float64_t * | vec1, | |
const float64_t | scalar, | |||
const float64_t * | vec2, | |||
int32_t | n | |||
) | [static] |
x=x+alpha*y (blas optimized)
Definition at line 319 of file SGVector.cpp.
void vec1_plus_scalar_times_vec2 | ( | float32_t * | vec1, | |
const float32_t | scalar, | |||
const float32_t * | vec2, | |||
int32_t | n | |||
) | [static] |
x=x+alpha*y (blas optimized)
Definition at line 332 of file SGVector.cpp.
static void vector_multiply | ( | T * | target, | |
const T * | v1, | |||
const T * | v2, | |||
int32_t | len | |||
) | [static] |
compute vector multiplication
Definition at line 376 of file SGVector.h.
void zero | ( | ) |
fill vector with zeros
Definition at line 51 of file SGVector.cpp.
T* vector |
vector
Definition at line 586 of file SGVector.h.
length of vector
Definition at line 588 of file SGVector.h.