21#ifndef _MBXMLUTILS_OCTEVAL_H_
22#define _MBXMLUTILS_OCTEVAL_H_
28class octave_value_list;
32 class SymbolicExpression;
35namespace XERCES_CPP_NAMESPACE {
class DOMElement; }
39std::shared_ptr<octave_value> C(
const Eval::Value &value);
54 OctEval(std::vector<boost::filesystem::path> *dependencies_=
nullptr);
68 void addImport(
const std::string &code,
const xercesc::DOMElement *e,
const std::string &action=
"")
override;
70 void addImportHelper(
const boost::filesystem::path &dir);
76 std::map<boost::filesystem::path, std::pair<boost::filesystem::path, bool> >&
requiredFiles()
const override;
84 std::map<std::string, octave_value> vn;
85 std::map<std::string, octave_value> gvn;
86 std::map<std::string, octave_value> ufn;
87 std::map<std::string, octave_value> tlvn;
93 Value fullStringToValue(
const std::string &str,
const xercesc::DOMElement *e,
bool skipRet=
false)
const override;
95 static octave_value_list fevalThrow(octave_function *func,
const octave_value_list &arg,
int n=0,
96 const std::string &msg=std::string());
98 static void* getSwigPtr(
const octave_value &v);
99 static Value createSwigByTypeName(
const std::string &name);
100 static std::string getSwigType(
const octave_value &value);
102 Value callFunction(
const std::string &name,
const std::vector<Value>& args)
const override;
104 double cast_double (
const Value &value)
const override;
105 std::vector<double> cast_vector_double (
const Value &value)
const override;
106 std::vector<std::vector<double> > cast_vector_vector_double(
const Value &value)
const override;
107 std::string cast_string (
const Value &value)
const override;
109 Value create_double (
const double& v)
const override;
110 Value create_vector_double (
const std::vector<double>& v)
const override;
111 Value create_vector_vector_double(
const std::vector<std::vector<double> >& v)
const override;
112 Value create_string (
const std::string& v)
const override;
114 std::string createSourceCode_double (
const double& v)
const override;
115 std::string createSourceCode_vector_double (
const std::vector<double>& v)
const override;
116 std::string createSourceCode_vector_vector_double(
const std::vector<std::vector<double> >& v)
const override;
117 std::string createSourceCode_string (
const std::string& v)
const override;
123 std::string serializeFunction(
const Value &x)
const override;
ValueType
Definition: eval.h:83
std::shared_ptr< void > Value
Typedef for a shared value.
Definition: eval.h:92
Value fullStringToValue(const std::string &str, const xercesc::DOMElement *e, bool skipRet=false) const override
evaluate str fully and return result as an octave variable
Definition: octeval.cc:594
void convertIndex(Value &v, bool evalTo1Based) override
Definition: octeval.h:78
~OctEval() override
Destructor.
void addImport(const std::string &code, const xercesc::DOMElement *e, const std::string &action="") override
Definition: octeval.cc:566
OctEval(std::vector< boost::filesystem::path > *dependencies_=nullptr)
Constructor.
Definition: octeval.cc:486
Value createFunction(const std::vector< Value > &indeps, const Value &dep) const override
create a Function with n independents and a dependent function (scalar, vector or matrix)
Definition: octeval.cc:416
Value createFunctionDep(const std::vector< Value > &v) const override
create a vector function dependent
Definition: octeval.cc:382
std::string getName() const override
Get the type of this evaluator.
Definition: octeval.h:62
Value createFunctionIndep(int dim) const override
create a function independent variable. If dim == 0 a scalar is created else a vector.
Definition: octeval.cc:494
Value callFunction(const std::string &name, const std::vector< Value > &args) const override
Definition: octeval.cc:896
static std::string getNameStatic()
Get the name of this evaluator.
Definition: octeval.h:61
bool valueIsOfType(const Value &value, ValueType type) const override
get the type of value
Definition: octeval.cc:766
std::map< boost::filesystem::path, std::pair< boost::filesystem::path, bool > > & requiredFiles() const override
return a list of all required files of octave (excluding dependent files of libraries)
Definition: octeval.cc:848