SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes
TSGDataType Struct Reference

Detailed Description

Datatypes that shogun supports.

Definition at line 68 of file DataType.h.

Public Member Functions

 TSGDataType (EContainerType ctype, EStructType stype, EPrimitiveType ptype)
 
 TSGDataType (EContainerType ctype, EStructType stype, EPrimitiveType ptype, index_t *length)
 
 TSGDataType (EContainerType ctype, EStructType stype, EPrimitiveType ptype, index_t *length_y, index_t *length_x)
 
bool equals (TSGDataType other)
 
bool equals_without_length (TSGDataType other)
 
bool operator== (const TSGDataType &a)
 
bool operator!= (const TSGDataType &a)
 
void to_string (char *dest, size_t n) const
 
size_t sizeof_stype () const
 
size_t sizeof_ptype () const
 
size_t get_size ()
 
int64_t get_num_elements ()
 

Static Public Member Functions

static size_t sizeof_ptype (EPrimitiveType ptype)
 
static size_t sizeof_stype (EStructType stype, EPrimitiveType ptype)
 
static size_t sizeof_sparseentry (EPrimitiveType ptype)
 
static size_t offset_sparseentry (EPrimitiveType ptype)
 
static void stype_to_string (char *dest, EStructType stype, EPrimitiveType ptype, size_t n)
 
static void ptype_to_string (char *dest, EPrimitiveType ptype, size_t n)
 
static bool string_to_ptype (EPrimitiveType *ptype, const char *str)
 

Public Attributes

EContainerType m_ctype
 
EStructType m_stype
 
EPrimitiveType m_ptype
 
index_tm_length_y
 
index_tm_length_x
 

Constructor & Destructor Documentation

TSGDataType ( EContainerType  ctype,
EStructType  stype,
EPrimitiveType  ptype 
)
explicit

constructor

Parameters
ctype
stype
ptype

Definition at line 22 of file DataType.cpp.

TSGDataType ( EContainerType  ctype,
EStructType  stype,
EPrimitiveType  ptype,
index_t length 
)
explicit

constructor

Parameters
ctype
stype
ptype
length

Definition at line 29 of file DataType.cpp.

TSGDataType ( EContainerType  ctype,
EStructType  stype,
EPrimitiveType  ptype,
index_t length_y,
index_t length_x 
)
explicit

constructor

Parameters
ctype
stype
ptype
length_y
length_x

Definition at line 36 of file DataType.cpp.

Member Function Documentation

bool equals ( TSGDataType  other)

Compares the content of the data types, including the length fields if non-NULL

Returns
other type to compare with
true if equals, false otherwise

Definition at line 95 of file DataType.cpp.

bool equals_without_length ( TSGDataType  other)

Compares the content of the data types, excluding the length fields

Returns
other type to compare with
true if equals, false otherwise

Definition at line 67 of file DataType.cpp.

int64_t get_num_elements ( )

get num of elements

Returns
number of (matrix, vector, scalar) elements of type

Definition at line 464 of file DataType.cpp.

size_t get_size ( )

get size

Returns
size of type in bytes

Definition at line 440 of file DataType.cpp.

size_t offset_sparseentry ( EPrimitiveType  ptype)
static

offset of sparse entry

Parameters
ptype

Definition at line 308 of file DataType.cpp.

bool operator!= ( const TSGDataType a)

inequality

Parameters
a

Definition at line 126 of file DataType.h.

bool operator== ( const TSGDataType a)

equality

Definition at line 45 of file DataType.cpp.

void ptype_to_string ( char *  dest,
EPrimitiveType  ptype,
size_t  n 
)
static

ptype to string

Parameters
dest
ptype
n

Definition at line 365 of file DataType.cpp.

size_t sizeof_ptype ( ) const

size of ptype

Definition at line 183 of file DataType.cpp.

size_t sizeof_ptype ( EPrimitiveType  ptype)
static

get the size of the primitive type ptype

Parameters
ptypethe primitive type
Returns
its size

Definition at line 252 of file DataType.cpp.

size_t sizeof_sparseentry ( EPrimitiveType  ptype)
static

size of sparse entry

Parameters
ptype

Definition at line 279 of file DataType.cpp.

size_t sizeof_stype ( ) const

size of stype

Definition at line 177 of file DataType.cpp.

size_t sizeof_stype ( EStructType  stype,
EPrimitiveType  ptype 
)
static

get the size of the structured type stype that internally uses the primitive type ptype as type

Parameters
stypethe structured type
ptypethe primitive type
Returns
its size

Definition at line 189 of file DataType.cpp.

bool string_to_ptype ( EPrimitiveType *  ptype,
const char *  str 
)
static

string to ptype

Parameters
ptype
str

Definition at line 393 of file DataType.cpp.

void stype_to_string ( char *  dest,
EStructType  stype,
EPrimitiveType  ptype,
size_t  n 
)
static

stype to string

Parameters
dest
stype
ptype
n

Definition at line 337 of file DataType.cpp.

void to_string ( char *  dest,
size_t  n 
) const

to string

Parameters
dest
n

Definition at line 145 of file DataType.cpp.

Member Data Documentation

EContainerType m_ctype

container type

Definition at line 71 of file DataType.h.

index_t* m_length_x

length x

Definition at line 80 of file DataType.h.

index_t* m_length_y

length y

Definition at line 78 of file DataType.h.

EPrimitiveType m_ptype

primitive type

Definition at line 75 of file DataType.h.

EStructType m_stype

struct type

Definition at line 73 of file DataType.h.


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

SHOGUN Machine Learning Toolbox - Documentation