OpenNN
2.2
Open Neural Networks Library
|
#include <mathematical_model.h>
Public Member Functions | |
MathematicalModel (void) | |
MathematicalModel (const tinyxml2::XMLDocument &) | |
MathematicalModel (const std::string &) | |
MathematicalModel (const MathematicalModel &) | |
virtual | ~MathematicalModel (void) |
virtual MathematicalModel & | operator= (const MathematicalModel &) |
virtual bool | operator== (const MathematicalModel &) const |
const size_t & | get_independent_variables_number (void) const |
const size_t & | get_dependent_variables_number (void) const |
size_t | count_variables_number (void) const |
const bool & | get_display (void) const |
void | set (const MathematicalModel &) |
void | set_independent_variables_number (const size_t &) |
void | set_dependent_variables_number (const size_t &) |
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 tinyxml2::XMLDocument * | to_XML (void) const |
virtual void | from_XML (const tinyxml2::XMLDocument &) |
void | save (const std::string &) const |
void | load (const std::string &) |
virtual void | save_data (const NeuralNetwork &, const std::string &) const |
Protected Attributes | |
size_t | independent_variables_number |
size_t | dependent_variables_number |
bool | display |
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 40 of file mathematical_model.h.
|
explicit |
Default constructor. It constructs a default mathematical model object, with zero independent and dependent variables.
Definition at line 26 of file mathematical_model.cpp.
|
explicit |
XML constructor. It creates a mathematical model and loads its members from a TinyXML document.
mathematical_model_document | XML document containing the mathematical model members. |
Definition at line 38 of file mathematical_model.cpp.
|
explicit |
File constructor. It creates a mathematical model and loads its members from a XML file.
file_name | Name of mathematical model XML file. |
Definition at line 52 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 66 of file mathematical_model.cpp.
|
virtual |
Destructor. It does not delete any object.
Definition at line 77 of file mathematical_model.cpp.
|
virtual |
This virtual method returns the dependent variables solutions to the mathematical model, Needs to be derived, otherwise an exception is thrown.
Definition at line 276 of file mathematical_model.cpp.
|
virtual |
This virtual method returns the final solutions of the mathematical model, which are given by the final independent and dependent variables. Needs to be derived, otherwise an exception is thrown.
Reimplemented in OpenNN::OrdinaryDifferentialEquations.
Definition at line 259 of file mathematical_model.cpp.
|
virtual |
This virtual method returns the solutions to the mathematical model, which are given by the independent and the dependent variables. Needs to be derived, otherwise an exception is thrown.
Reimplemented in OpenNN::OrdinaryDifferentialEquations, and OpenNN::PlugIn.
Definition at line 241 of file mathematical_model.cpp.
size_t OpenNN::MathematicalModel::count_variables_number | ( | void | ) | const |
Returns the total number variablesin the mathematical model. This is the sum of the numbers of independent and dependent variables.
Definition at line 151 of file mathematical_model.cpp.
|
virtual |
Deserializes a TinyXML document into this mathematical model object.
document | XML document containing the member data. |
Reimplemented in OpenNN::OrdinaryDifferentialEquations, and OpenNN::PlugIn.
Definition at line 376 of file mathematical_model.cpp.
const bool & OpenNN::MathematicalModel::get_display | ( | void | ) | const |
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 162 of file mathematical_model.cpp.
void OpenNN::MathematicalModel::load | ( | const std::string & | file_name | ) |
Loads the members of the mathematical model from a XML file.
file_name | Name of mathematical model XML file. |
Definition at line 481 of file mathematical_model.cpp.
|
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 88 of file mathematical_model.cpp.
|
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 109 of file mathematical_model.cpp.
void OpenNN::MathematicalModel::save | ( | const std::string & | file_name | ) | const |
Saves to a file the XML representation of the mathematical object.
file_name | Name of mathematical model XML file. |
Definition at line 466 of file mathematical_model.cpp.
|
virtual |
Reimplemented in OpenNN::OrdinaryDifferentialEquations.
Definition at line 504 of file mathematical_model.cpp.
void OpenNN::MathematicalModel::set | ( | const MathematicalModel & | other_mathematical_model | ) |
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 173 of file mathematical_model.cpp.
|
virtual |
Sets the following default values in the mathematical model:
Reimplemented in OpenNN::OrdinaryDifferentialEquations, and OpenNN::PlugIn.
Definition at line 213 of file mathematical_model.cpp.
void OpenNN::MathematicalModel::set_dependent_variables_number | ( | const size_t & | new_dependent_variables_number | ) |
Sets the number of dependent variables in the mathematical model.
new_dependent_variables_number | Number of dependent variables. |
Definition at line 198 of file mathematical_model.cpp.
void OpenNN::MathematicalModel::set_display | ( | const bool & | new_display | ) |
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 229 of file mathematical_model.cpp.
void OpenNN::MathematicalModel::set_independent_variables_number | ( | const size_t & | new_independent_variables_number | ) |
Sets the number of independent variables in the mathematical model.
new_independent_variables_number | Number of independent variables. |
Definition at line 187 of file mathematical_model.cpp.
|
virtual |
Serializes the mathematical model object into a XML document of the TinyXML library. See the OpenNN manual for more information about the format of this document.
Reimplemented in OpenNN::OrdinaryDifferentialEquations, and OpenNN::PlugIn.
Definition at line 321 of file mathematical_model.cpp.