#include <mathematical_model.h>
Public Member Functions | |
MathematicalModel (void) | |
MathematicalModel (TiXmlElement *) | |
MathematicalModel (const std::string &) | |
MathematicalModel (const MathematicalModel &) | |
virtual | ~MathematicalModel (void) |
virtual MathematicalModel & | operator= (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 |
Definition at line 35 of file mathematical_model.h.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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:
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.
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.
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.
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] |
Reimplemented in OpenNN::OrdinaryDifferentialEquations.
Definition at line 556 of file mathematical_model.cpp.
unsigned int OpenNN::MathematicalModel::independent_variables_number [protected] |
Number of independent variables defining the mathematical model.
Definition at line 117 of file mathematical_model.h.
unsigned int OpenNN::MathematicalModel::dependent_variables_number [protected] |
Number of dependent variables defining the mathematical model.
Definition at line 121 of file mathematical_model.h.
bool OpenNN::MathematicalModel::display [protected] |