SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
所有成员列表 | Public 成员函数 | 静态 Public 成员函数 | Public 属性
TParameter结构体 参考

详细描述

parameter struct

在文件 base/Parameter.h32 行定义.

Public 成员函数

 TParameter (const TSGDataType *datatype, void *parameter, const char *name, const char *description)
 
 ~TParameter ()
 
void print (const char *prefix)
 
bool save (CSerializableFile *file, const char *prefix="")
 
bool load (CSerializableFile *file, const char *prefix="")
 
bool equals (TParameter *other, float64_t accuracy=0.0, bool tolerant=false)
 
bool copy (TParameter *target)
 
bool operator== (const TParameter &other) const
 
bool operator< (const TParameter &other) const
 
bool operator> (const TParameter &other) const
 
void get_incremental_hash (uint32_t &hash, uint32_t &carry, uint32_t &total_length)
 
bool is_valid ()
 

静态 Public 成员函数

static bool compare_ptype (EPrimitiveType ptype, void *data1, void *data2, float64_t accuracy=0.0, bool tolerant=false)
 
static bool compare_stype (EStructType stype, EPrimitiveType ptype, void *data1, void *data2, float64_t accuracy=0.0, bool tolerant=false)
 
static bool copy_ptype (EPrimitiveType ptype, void *source, void *target)
 
static bool copy_stype (EStructType stype, EPrimitiveType ptype, void *source, void *target)
 

Public 属性

TSGDataType m_datatype
 
void * m_parameter
 
char * m_name
 
char * m_description
 

构造及析构函数说明

TParameter ( const TSGDataType datatype,
void *  parameter,
const char *  name,
const char *  description 
)
explicit

explicit constructor

参数
datatypedatatype
parameterpointer to parameter
namename of parameter
descriptiondescription of parameter

在文件 Parameter.cpp1782 行定义.

~TParameter ( )

destructor

在文件 Parameter.cpp1791 行定义.

成员函数说明

bool compare_ptype ( EPrimitiveType  ptype,
void *  data1,
void *  data2,
float64_t  accuracy = 0.0,
bool  tolerant = false 
)
static

Given two pointers to a scalar element of a given primitive-type, this method compares the values up to a given accuracy.

If the type of the data is SGObject, recursively calls equals on the object.

参数
ptypeprimitive type of both data
data1pointer 1
data2pointer 2
accuracyaccuracy to compare
tolerantallows linient check on float equality (within accuracy)
返回
whether the data was equal

ensure that no NULL data are de-referenced

在文件 Parameter.cpp3107 行定义.

bool compare_stype ( EStructType  stype,
EPrimitiveType  ptype,
void *  data1,
void *  data2,
float64_t  accuracy = 0.0,
bool  tolerant = false 
)
static

Given two pointers to a string element of a given primitive-type, this method compares the values up to a given accuracy.

If the type of the data is SGObject, recursively calls equals on the object.

参数
stypestring type of both data
ptypeprimitive type of both data
data1pointer 1
data2pointer 2
accuracyaccuracy to compare
tolerantallows linient check on float equality (within accuracy)
返回
whether the data was equal

在文件 Parameter.cpp3496 行定义.

bool copy ( TParameter target)

copy this to parameter target

参数
targetwhere this should be copied to

在文件 Parameter.cpp3770 行定义.

bool copy_ptype ( EPrimitiveType  ptype,
void *  source,
void *  target 
)
static

copy primitive type from source to target

参数
ptypethe primitive type
sourcefrom where to copy
targetwhere to copy to

在文件 Parameter.cpp3352 行定义.

bool copy_stype ( EStructType  stype,
EPrimitiveType  ptype,
void *  source,
void *  target 
)
static

copy structured type from source to target

参数
stypethe structured type
ptypethe primitive type that the structured objects use
sourcefrom where to copy
targetwhere to copy to

在文件 Parameter.cpp3624 行定义.

bool equals ( TParameter other,
float64_t  accuracy = 0.0,
bool  tolerant = false 
)

Numerically this instance with another instance. Compares recursively in case of non-numerical parameters

参数
otherother instance to compare with
accuracyaccuracy for numerical comparison
tolerantallows linient check on float equality (within accuracy)
返回
true if given parameter instance is equal, false otherwise

在文件 Parameter.cpp2962 行定义.

void get_incremental_hash ( uint32_t &  hash,
uint32_t &  carry,
uint32_t &  total_length 
)

Incrementally get a hash from parameter value

参数
hashcurrent hash value
carryvalue for incremental murmur hashing
total_lengthbyte length of parameters. Function will add byte length to received value

在文件 Parameter.cpp2423 行定义.

bool is_valid ( )

test if parameter can be validly accessed, e.g., in case of a list/vector/matrix of objects the list/vector/matrix has non-zero length

在文件 Parameter.cpp2507 行定义.

bool load ( CSerializableFile file,
const char *  prefix = "" 
)

load from serializable file

参数
filesource file
prefixprefix

在文件 Parameter.cpp2612 行定义.

bool operator< ( const TParameter other) const

operator for comparison (by string m_name)

在文件 Parameter.cpp2952 行定义.

bool operator== ( const TParameter other) const

operator for comparison, (by string m_name)

在文件 Parameter.cpp2945 行定义.

bool operator> ( const TParameter other) const

operator for comparison (by string m_name)

在文件 Parameter.cpp2957 行定义.

void print ( const char *  prefix)

print with prefix

参数
prefixprefix to print

在文件 Parameter.cpp1808 行定义.

bool save ( CSerializableFile file,
const char *  prefix = "" 
)

save to serializable file

参数
filedestination file
prefixprefix

在文件 Parameter.cpp2513 行定义.

类成员变量说明

TSGDataType m_datatype

type of parameter

在文件 base/Parameter.h141 行定义.

char* m_description

description of parameter

在文件 base/Parameter.h147 行定义.

char* m_name

name of parameter

在文件 base/Parameter.h145 行定义.

void* m_parameter

pointer to parameter

在文件 base/Parameter.h143 行定义.


该结构体的文档由以下文件生成:

SHOGUN 机器学习工具包 - 项目文档