11 #ifndef __DATATYPE_H__
12 #define __DATATYPE_H__
18 #define PT_NOT_GENERIC PT_SGOBJECT
19 #define PT_LONGEST floatmax_t
91 void random(T min_value, T max_value)
107 for (int32_t i=0; i<len; i++)
117 for (int32_t i=0; i<len; i++)
125 for (int32_t i=0; i<len; i++)
141 for (int32_t i = 0; i < n; i++)
239 for (int32_t i=0; i<
vlen; i++)
529 index_t index,
bool free_v=
false) :
590 index_t num_vec,
bool free_m=
false) :
648 #ifndef DOXYGEN_SHOULD_SKIP_THIS
705 explicit TSGDataType(EContainerType ctype, EStructType stype,
706 EPrimitiveType ptype);
713 explicit TSGDataType(EContainerType ctype, EStructType stype,
714 EPrimitiveType ptype,
index_t* length);
722 explicit TSGDataType(EContainerType ctype, EStructType stype,
723 EPrimitiveType ptype,
index_t* length_y,
733 return !(*
this == a);
740 void to_string(
char* dest,
size_t n)
const;
764 EPrimitiveType ptype,
size_t n);
T & operator[](index_t index)
template class SGSparseMatrix
SGString(T *s, index_t l, bool free_s=false)
SGNDArray(T *a, index_t *d, index_t nd)
static bool string_to_ptype(EPrimitiveType *ptype, const char *str)
template class SGStringList
SGSparseMatrix(index_t num_vec, index_t num_feat, bool free_m=false)
SGMatrix(index_t nrows, index_t ncols, bool free_mat=false)
SGVector(index_t len, bool free_vec=false)
static size_t offset_sparseentry(EPrimitiveType ptype)
virtual void destroy_matrix()
void display_vector() const
void set_element(const T &p_element, index_t index)
index_t get_num_elements()
SGSparseVector< T > * sparse_matrix
array of sparse vectors of size num_vectors
static void permute(VT *perm, int32_t n)
size_t sizeof_ptype() const
void random(T min_value, T max_value)
bool operator!=(const TSGDataType &a)
static VT * clone_vector(const VT *vec, int32_t len)
static void ptype_to_string(char *dest, EPrimitiveType ptype, size_t n)
index_t num_vectors
total number of vectors
SGSparseMatrix(const SGSparseMatrix &orig)
TSGDataType(EContainerType ctype, EStructType stype, EPrimitiveType ptype)
SGVector(const SGVector &orig)
Datatypes that shogun supports.
SGString(const SGString &orig)
static void range_fill_vector(VT *vec, int32_t len, VT start=0)
template class SGSparseVector
SGSparseVector(const SGSparseVector &orig)
SGString(SGVector< T > v)
virtual void free_vector()
SGNDArray(const SGNDArray &orig)
const T & operator[](index_t index) const
virtual void destroy_vector()
SGString(index_t len, bool free_s=false)
void range_fill(T start=0)
static void stype_to_string(char *dest, EStructType stype, EPrimitiveType ptype, size_t n)
index_t num_features
total number of features
const T & operator[](index_t index) const
size_t sizeof_stype() const
T & operator[](index_t index)
SGSparseMatrix(SGSparseVector< T > *vecs, index_t num_feat, index_t num_vec, bool free_m=false)
static SGVector get_vector(SGVector &src, bool own=true)
bool operator==(const TSGDataType &a)
const T & get_element(index_t index)
void set_const(T const_elem)
SGSparseVector(SGSparseVectorEntry< T > *feats, index_t num_entries, index_t index, bool free_v=false)
SGStringList(SGString< T > *s, index_t num_s, index_t max_length, bool free_strings=false)
#define SG_REALLOC(type, ptr, len)
SGMatrix(const SGMatrix &orig)
void to_string(char *dest, size_t n) const
index_t max_string_length
static void random_vector(VT *vec, int32_t len, VT min_value, VT max_value)
SGMatrix(T *m, index_t nrows, index_t ncols, bool free_mat=false)
static void fill_vector(VT *vec, int32_t len, VT value)
template class SGSparseVectorEntry
void display_size() const
Template class Cache implements a simple cache.
void resize_vector(int32_t n)
static void randperm(VT *perm, int32_t n)
SGSparseVector(index_t num_entries, index_t index, bool free_v=false)
shogun n-dimensional array
SGStringList(const SGStringList &orig)
#define SG_MALLOC(type, len)
virtual void free_matrix()
static size_t sizeof_sparseentry(EPrimitiveType ptype)
SGStringList(index_t num_s, index_t max_length, bool free_strings=false)
SGVector(T *v, index_t len, bool free_vec=false)
SGSparseVectorEntry< T > * features