Pulse Class Reference

Multi-transition pulse functions (step functions). More...

#include <pulse.h>

Inheritance diagram for Pulse:

Inheritance graph
[legend]
Collaboration diagram for Pulse:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Pulse (UINT n_in=0)
 Pulse (std::istream &is)
virtual const id_tid () const
virtual Pulsecreate () const
 Create a new object using the default constructor.
virtual Pulseclone () const
 Create a new object by replicating itself.
UINT index () const
void set_index (UINT i)
 Set the dimension picked for classification.
const std::vector< REAL > & threshold () const
void set_threshold (const std::vector< REAL > &)
 Set the transition points.
bool direction () const
void set_direction (bool d)
 Set the pulse direction (true if starting with -1).
UINT max_transitions ()
void set_max_transitions (UINT ml)
 Set the maximal number of transitions the pulse can have.
virtual bool support_weighted_data () const
 Whether the learning model/algorithm supports unequally weighted data.
virtual void train ()
virtual Output operator() (const Input &) const

Protected Member Functions

virtual bool serialize (std::ostream &, ver_list &) const
virtual bool unserialize (std::istream &, ver_list &, const id_t &=NIL_ID)

Detailed Description

Multi-transition pulse functions (step functions).

Todo:
Documentation

Definition at line 19 of file pulse.h.


Constructor & Destructor Documentation

Pulse UINT  n_in = 0  )  [inline, explicit]
 

Definition at line 26 of file pulse.h.

Referenced by Pulse::clone(), and Pulse::create().

Pulse std::istream &  is  )  [inline, explicit]
 

Definition at line 27 of file pulse.h.


Member Function Documentation

virtual Pulse* clone  )  const [inline, virtual]
 

Create a new object by replicating itself.

Returns:
A pointer to the new copy.
The code for a derived class Derived is always
 return new Derived(*this); 
Though seemingly redundant, it helps to copy an object without knowing the real type of the object.
See also:
C++ FAQ Lite 20.6

Implements LearnModel.

Definition at line 31 of file pulse.h.

References Pulse::Pulse().

virtual Pulse* create  )  const [inline, virtual]
 

Create a new object using the default constructor.

The code for a derived class Derived is always

 return new Derived(); 

Implements LearnModel.

Definition at line 30 of file pulse.h.

References Pulse::Pulse().

bool direction  )  const [inline]
 

Returns:
true if the pulse starts with -1.

Definition at line 42 of file pulse.h.

virtual const id_t& id  )  const [virtual]
 

Returns:
Class ID string (class name)

Implements Object.

UINT index  )  const [inline]
 

Returns:
The dimension picked for classification.

Definition at line 34 of file pulse.h.

UINT max_transitions  )  [inline]
 

Returns:
the maximal number of transitions the pulse can have.

Definition at line 46 of file pulse.h.

Output operator() const Input  )  const [virtual]
 

Implements LearnModel.

Definition at line 173 of file pulse.cpp.

References LearnModel::n_input().

bool serialize std::ostream &  ,
ver_list
const [protected, virtual]
 

Reimplemented from LearnModel.

Definition at line 32 of file pulse.cpp.

References serialize(), and SERIALIZE_PARENT.

void set_direction bool  d  )  [inline]
 

Set the pulse direction (true if starting with -1).

Definition at line 44 of file pulse.h.

void set_index UINT  i  )  [inline]
 

Set the dimension picked for classification.

Definition at line 36 of file pulse.h.

References LearnModel::n_input().

void set_max_transitions UINT  ml  )  [inline]
 

Set the maximal number of transitions the pulse can have.

Definition at line 48 of file pulse.h.

void set_threshold const std::vector< REAL > &   ) 
 

Set the transition points.

Definition at line 54 of file pulse.cpp.

virtual bool support_weighted_data  )  const [inline, virtual]
 

Whether the learning model/algorithm supports unequally weighted data.

Returns:
true if supporting; false otherwise. The default is false, just for safety.
See also:
set_train_data()

Reimplemented from LearnModel.

Definition at line 51 of file pulse.h.

const std::vector<REAL>& threshold  )  const [inline]
 

Returns:
a vector of transition points.

Definition at line 38 of file pulse.h.

void train  )  [virtual]
 

Note:
we can also save the threshold info. as lower and upper x values, which is a bit faster (less operations) but needs more memory space.

Implements LearnModel.

Definition at line 64 of file pulse.cpp.

References LearnModel::_n_in, LearnModel::n_samples, LearnModel::ptd, LearnModel::ptw, and LearnModel::set_dimensions().

bool unserialize std::istream &  ,
ver_list ,
const id_t = NIL_ID
[protected, virtual]
 

Reimplemented from LearnModel.

Definition at line 39 of file pulse.cpp.

References Object::NIL_ID, unserialize(), and UNSERIALIZE_PARENT.


The documentation for this class was generated from the following files:
Generated on Wed Nov 8 08:17:22 2006 for LEMGA by  doxygen 1.4.6