#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
Include dependency graph for object.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Classes | |
class | Object |
The root (ancestor) of all classes. More... | |
struct | _register_creator |
Defines | |
#define | INFINITESIMAL (8e-16) |
almost equal to 0, 1+x/2-1>0 | |
#define | EPSILON (1e-9) |
accumulated numerical error | |
#define | INFINITY (5e30) |
Should avoid using INFINITY since it is a lazy trick. | |
#define | OBJ_FUNC_UNDEFINED(fun) |
Stop the program and warn when an undefined function is called. | |
#define | REGISTER_CREATOR(cls) |
#define | SERIALIZE_PARENT(pcls, os, vl, def_ver) vl.push_back(def_ver); pcls::serialize(os, vl) |
Serialize parents (ancestors) part. | |
#define | UNSERIALIZE_PARENT(pcls, is, vl, def_ver, ver) |
Unserialize parents and set current format number ver. | |
Typedefs | |
typedef unsigned long | UINT |
typedef double | REAL |
typedef Object *(* | _creator_t )() |
Functions | |
std::ostream & | operator<< (std::ostream &os, const Object &obj) |
Definition in file object.h.
|
accumulated numerical error
Definition at line 20 of file object.h. Referenced by SVM::kernel(), CGBoost::linear_smpwgt(), dataset::random_sample(), LearnModel::set_train_data(), SVM::signed_margin(), Perceptron::train(), and SVM::w_norm(). |
|
almost equal to 0, 1+x/2-1>0
Definition at line 19 of file object.h. Referenced by LearnModel::c_error(), AdaCost< REAL >::cost(), AdaCost< REAL >::deriv1(), Boosting::margin(), SVM::margin_of(), Perceptron::margin_of(), Boosting::margin_of(), LearnModel::min_margin(), SVM::operator()(), and Stump::train_1d(). |
|
Should avoid using INFINITY since it is a lazy trick.
Definition at line 23 of file object.h. Referenced by Boosting::cost(), LearnModel::min_margin(), and Stump::train_1d(). |
|
Value: std::cerr<<__FILE__":"<<__LINE__<<": "<<id()<<"::" fun " undefined.\n"; \ exit(-99); Some member functions may be optional for child classes. There are two cases for an optional function:
This macro will stop the program with a ``function undefined" error.
Definition at line 53 of file object.h. Referenced by Boosting::convex_smpwgt(), Boosting::convex_weight(), AdaBoost::convex_weight(), Boosting::linear_smpwgt(), Boosting::linear_weight(), LearnModel::margin_of(), SVM::operator=(), SVM::serialize(), NNLayer::train(), and SVM::unserialize(). |
|
Value: static const Object::id_t _id_ = #cls; \ static Object* _c_ () { return new cls; } \ const Object::id_t& cls::id () const { return ::_id_; } \ static const _register_creator _(_id_, _c_) |
|
Serialize parents (ancestors) part.
Definition at line 136 of file object.h. Referenced by Stump::serialize(), Pulse::serialize(), Perceptron::serialize(), NNLayer::serialize(), MultiClass_ECOC::serialize(), LearnModel::serialize(), FeedForwardNN::serialize(), CGBoost::serialize(), Cascade::serialize(), Boosting::serialize(), and Aggregating::serialize(). |
|
Value: if (!pcls::unserialize(is, vl)) return false; \ const ver_t ver = vl.back(); \ if (ver > def_ver) { \ std::cerr << this->id() \ << ": unserialize: format newer than the program\n"; \ return false; \ } \ if (ver > 0) vl.pop_back()
Definition at line 144 of file object.h. Referenced by Stump::unserialize(), Pulse::unserialize(), Perceptron::unserialize(), NNLayer::unserialize(), MultiClass_ECOC::unserialize(), LearnModel::unserialize(), FeedForwardNN::unserialize(), CGBoost::unserialize(), Cascade::unserialize(), Boosting::unserialize(), and Aggregating::unserialize(). |
|
|
|
|
|
|
|
Definition at line 105 of file object.h. References Object::serialize(). |