1#ifndef _MBXMLUTILS_OCTEVAL_H_
2#define _MBXMLUTILS_OCTEVAL_H_
8class octave_value_list;
12 class SymbolicExpression;
15namespace XERCES_CPP_NAMESPACE {
class DOMElement; }
19std::shared_ptr<octave_value> C(
const Eval::Value &value);
34 OctEval(std::vector<boost::filesystem::path> *dependencies_=
nullptr);
48 void addImport(
const std::string &code,
const xercesc::DOMElement *e,
const std::string &action=
"")
override;
50 void addImportHelper(
const boost::filesystem::path &dir);
56 std::map<boost::filesystem::path, std::pair<boost::filesystem::path, bool> >&
requiredFiles()
const override;
64 std::map<std::string, octave_value> vn;
65 std::map<std::string, octave_value> gvn;
66 std::map<std::string, octave_value> ufn;
67 std::map<std::string, octave_value> tlvn;
73 Value fullStringToValue(
const std::string &str,
const xercesc::DOMElement *e,
bool skipRet=
false)
const override;
75 static octave_value_list fevalThrow(octave_function *func,
const octave_value_list &arg,
int n=0,
76 const std::string &msg=std::string());
78 static void* getSwigPtr(
const octave_value &v);
79 static Value createSwigByTypeName(
const std::string &name);
80 static std::string getSwigType(
const octave_value &value);
82 Value callFunction(
const std::string &name,
const std::vector<Value>& args)
const override;
84 double cast_double (
const Value &value)
const override;
85 std::vector<double> cast_vector_double (
const Value &value)
const override;
86 std::vector<std::vector<double> > cast_vector_vector_double(
const Value &value)
const override;
87 std::string cast_string (
const Value &value)
const override;
89 Value create_double (
const double& v)
const override;
90 Value create_vector_double (
const std::vector<double>& v)
const override;
91 Value create_vector_vector_double (
const std::vector<std::vector<double> >& v)
const override;
92 Value create_string (
const std::string& v)
const override;
98 std::string serializeFunction(
const Value &x)
const override;
ValueType
Definition: eval.h:82
std::shared_ptr< void > Value
Typedef for a shared value.
Definition: eval.h:91
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:497
void convertIndex(Value &v, bool evalTo1Based) override
Definition: octeval.h:58
~OctEval() override
Destructor.
void addImport(const std::string &code, const xercesc::DOMElement *e, const std::string &action="") override
Definition: octeval.cc:469
OctEval(std::vector< boost::filesystem::path > *dependencies_=nullptr)
Constructor.
Definition: octeval.cc:389
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:319
Value createFunctionDep(const std::vector< Value > &v) const override
create a vector function dependent
Definition: octeval.cc:285
std::string getName() const override
Get the type of this evaluator.
Definition: octeval.h:42
Value createFunctionIndep(int dim) const override
create a function independent variable. If dim == 0 a scalar is created else a vector.
Definition: octeval.cc:397
Value callFunction(const std::string &name, const std::vector< Value > &args) const override
Definition: octeval.cc:800
static std::string getNameStatic()
Get the name of this evaluator.
Definition: octeval.h:41
bool valueIsOfType(const Value &value, ValueType type) const override
get the type of value
Definition: octeval.cc:670
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:752