OpenNN::MathematicalModel Class Reference

#include <mathematical_model.h>

Inheritance diagram for OpenNN::MathematicalModel:

OpenNN::OrdinaryDifferentialEquations OpenNN::PlugIn

List of all members.

Public Member Functions

 MathematicalModel (void)
 MathematicalModel (TiXmlElement *)
 MathematicalModel (const std::string &)
 MathematicalModel (const MathematicalModel &)
virtual ~MathematicalModel (void)
virtual MathematicalModeloperator= (const MathematicalModel &)
virtual bool operator== (const MathematicalModel &) const
const unsigned int & get_independent_variables_number (void) const
const unsigned int & get_dependent_variables_number (void) const
unsigned int count_variables_number (void) const
const bool & get_display (void) const
virtual void set (const MathematicalModel &)
void set_independent_variables_number (const unsigned int &)
void set_dependent_variables_number (const unsigned int &)
void set_display (const bool &)
virtual void set_default (void)
virtual Matrix< double > calculate_solutions (const NeuralNetwork &) const
virtual Vector< double > calculate_final_solutions (const NeuralNetwork &) const
virtual Matrix< double > calculate_dependent_variables (const NeuralNetwork &, const Matrix< double > &) const
virtual std::string to_string (void) const
void print (void) const
virtual TiXmlElement * to_XML (void) const
virtual void from_XML (TiXmlElement *)
void save (const std::string &) const
void load (const std::string &)
virtual void save_data (const NeuralNetwork &, const std::string &) const

Protected Attributes

unsigned int independent_variables_number
unsigned int dependent_variables_number
bool display


Detailed Description

This class represents the concept of mathematical model. A mathematical model is the base for learning in some types of problems, such as optimal control and inverse problems.

Definition at line 35 of file mathematical_model.h.


Constructor & Destructor Documentation

OpenNN::MathematicalModel::MathematicalModel ( void   )  [explicit]

Default constructor. It constructs a default mathematical model object, with zero independent and dependent variables.

Definition at line 38 of file mathematical_model.cpp.

OpenNN::MathematicalModel::MathematicalModel ( TiXmlElement *  mathematical_model_element  )  [explicit]

XML constructor. It creates a mathematical model and loads its members from a Tiny XML element.

Parameters:
mathematical_model_element Pointer to a XML element containing the mathematical model members.

Definition at line 50 of file mathematical_model.cpp.

OpenNN::MathematicalModel::MathematicalModel ( const std::string &  filename  )  [explicit]

File constructor. It creates a mathematical model and loads its members from a XML file.

Parameters:
filename Name of mathematical model XML file.

Definition at line 64 of file mathematical_model.cpp.

OpenNN::MathematicalModel::MathematicalModel ( const MathematicalModel other_mathematical_model  ) 

Copy constructor. It creates a mathematical model object and copies its members from another object.

Parameters:
other_mathematical_model Mathematical model object to be copied.

Definition at line 78 of file mathematical_model.cpp.

OpenNN::MathematicalModel::~MathematicalModel ( void   )  [virtual]

Destructor. It does not delete any object.

Definition at line 89 of file mathematical_model.cpp.


Member Function Documentation

MathematicalModel & OpenNN::MathematicalModel::operator= ( const MathematicalModel other_mathematical_model  )  [virtual]

Assignment operator. It assigns to this object the members of an existing mathematical model object.

Parameters:
other_mathematical_model Mathematical model object to be assigned.

Definition at line 100 of file mathematical_model.cpp.

bool OpenNN::MathematicalModel::operator== ( const MathematicalModel other_mathematical_model  )  const [virtual]

Equal to operator. It compares this object with another object of the same class. It returns true if the members of the two objects have the same values, and false otherwise. @ param other_mathematical_model Mathematical model to be compared with.

Definition at line 121 of file mathematical_model.cpp.

const unsigned int & OpenNN::MathematicalModel::get_independent_variables_number ( void   )  const

This method returns the number of independent variables in the mathematical model.

Definition at line 142 of file mathematical_model.cpp.

const unsigned int & OpenNN::MathematicalModel::get_dependent_variables_number ( void   )  const

This method returns the number of dependent variables in the mathematical model.

Definition at line 152 of file mathematical_model.cpp.

unsigned int OpenNN::MathematicalModel::count_variables_number ( void   )  const

This method returns the total number variablesin the mathematical model. This is the sum of the numbers of independent and dependent variables.

Definition at line 163 of file mathematical_model.cpp.

const bool & OpenNN::MathematicalModel::get_display ( void   )  const

This method returns true if messages from this class can be displayed on the screen, or false if messages from this class can't be displayed on the screen.

Definition at line 174 of file mathematical_model.cpp.

void OpenNN::MathematicalModel::set ( const MathematicalModel other_mathematical_model  )  [virtual]

This method sets the members of this mathematical model object with those from other mathematical model object.

Parameters:
other_mathematical_model Mathematical model object to be copied.

Definition at line 185 of file mathematical_model.cpp.

void OpenNN::MathematicalModel::set_independent_variables_number ( const unsigned int &  new_independent_variables_number  ) 

This method sets the number of independent variables in the mathematical model.

Parameters:
new_independent_variables_number Number of independent variables.

Definition at line 199 of file mathematical_model.cpp.

void OpenNN::MathematicalModel::set_dependent_variables_number ( const unsigned int &  new_dependent_variables_number  ) 

This method sets the number of dependent variables in the mathematical model.

Parameters:
new_dependent_variables_number Number of dependent variables.

Definition at line 210 of file mathematical_model.cpp.

void OpenNN::MathematicalModel::set_display ( const bool &  new_display  ) 

This method sets a new display value. If it is set to true messages from this class are to be displayed on the screen; if it is set to false messages from this class are not to be displayed on the screen.

Parameters:
new_display Display value.

Definition at line 241 of file mathematical_model.cpp.

void OpenNN::MathematicalModel::set_default ( void   )  [virtual]

This method sets the following default values in the mathematical model:

  • Number of dependent variables: 0.
  • Number of independent variables: 0.
  • Display: True.

Reimplemented in OpenNN::OrdinaryDifferentialEquations, and OpenNN::PlugIn.

Definition at line 225 of file mathematical_model.cpp.

Matrix< double > OpenNN::MathematicalModel::calculate_solutions ( const NeuralNetwork  )  const [virtual]

This virtual method returns the solutions to the mathematical model, which are given by the independent and the dependent variables. This method needs to be derived, otherwise an exception is thrown.

Reimplemented in OpenNN::OrdinaryDifferentialEquations, and OpenNN::PlugIn.

Definition at line 253 of file mathematical_model.cpp.

Vector< double > OpenNN::MathematicalModel::calculate_final_solutions ( const NeuralNetwork  )  const [virtual]

This virtual method returns the final solutions of the mathematical model, which are given by the final independent and dependent variables. This method needs to be derived, otherwise an exception is thrown.

Reimplemented in OpenNN::OrdinaryDifferentialEquations.

Definition at line 271 of file mathematical_model.cpp.

Matrix< double > OpenNN::MathematicalModel::calculate_dependent_variables ( const NeuralNetwork ,
const Matrix< double > &   
) const [virtual]

This virtual method returns the dependent variables solutions to the mathematical model, This method needs to be derived, otherwise an exception is thrown.

Definition at line 288 of file mathematical_model.cpp.

std::string OpenNN::MathematicalModel::to_string ( void   )  const [virtual]

This method returns a string representation of the current mathematical model object.

Reimplemented in OpenNN::OrdinaryDifferentialEquations, and OpenNN::PlugIn.

Definition at line 304 of file mathematical_model.cpp.

void OpenNN::MathematicalModel::print ( void   )  const

This method outputs to the console the string representation of the mathematical model.

Definition at line 321 of file mathematical_model.cpp.

TiXmlElement * OpenNN::MathematicalModel::to_XML ( void   )  const [virtual]

This method serializes the mathematical model object into a XML element of the TinyXML library. See the OpenNN manual for more information about the format of this element.

Reimplemented in OpenNN::OrdinaryDifferentialEquations, and OpenNN::PlugIn.

Definition at line 333 of file mathematical_model.cpp.

void OpenNN::MathematicalModel::from_XML ( TiXmlElement *  mathematical_model_element  )  [virtual]

This method deserializes a TinyXML element into this mathematical model object.

Parameters:
mathematical_model_element Pointer to a XML element containing the member data.

Reimplemented in OpenNN::OrdinaryDifferentialEquations, and OpenNN::PlugIn.

Definition at line 385 of file mathematical_model.cpp.

void OpenNN::MathematicalModel::save ( const std::string &  filename  )  const

This method saves to a file the XML representation of the mathematical object.

Parameters:
filename Name of mathematical model XML file.

Definition at line 494 of file mathematical_model.cpp.

void OpenNN::MathematicalModel::load ( const std::string &  filename  ) 

This method loads the members of the mathematical model from a XML file.

Parameters:
filename Name of mathematical model XML file.

Definition at line 520 of file mathematical_model.cpp.

void OpenNN::MathematicalModel::save_data ( const NeuralNetwork ,
const std::string &   
) const [virtual]

Todo:

Reimplemented in OpenNN::OrdinaryDifferentialEquations.

Definition at line 556 of file mathematical_model.cpp.


Member Data Documentation

Number of independent variables defining the mathematical model.

Definition at line 117 of file mathematical_model.h.

Number of dependent variables defining the mathematical model.

Definition at line 121 of file mathematical_model.h.

Flag for displaying warnings.

Definition at line 125 of file mathematical_model.h.


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

Generated on Sun Aug 26 11:58:17 2012 for OpenNN by  doxygen 1.5.9