codac 1.5.6
Loading...
Searching...
No Matches
codac_TFunction.h
1
11#ifndef __CODAC_TFUNCTION_H__
12#define __CODAC_TFUNCTION_H__
13
14#include <string>
15#include "codac_Function.h"
16#include "codac_TFnc.h"
17#include "codac_Trajectory.h"
19
20namespace codac
21{
22 class Slice;
23 class Trajectory;
24 class TrajectoryVector;
25
26 std::string to_string(const Function& f);
27
28 class TFunction : public TFnc
29 {
30 public:
31
32 TFunction(const Function& f);
33 TFunction(const char* y);
34 TFunction(const char* x1, const char* y);
35 TFunction(const char* x1, const char* x2, const char* y);
36 TFunction(const char* x1, const char* x2, const char* x3, const char* y);
37 TFunction(const char* x1, const char* x2, const char* x3, const char* x4, const char* y);
38 TFunction(const char* x1, const char* x2, const char* x3, const char* x4, const char* x5, const char* y);
39 TFunction(const char* x1, const char* x2, const char* x3, const char* x4, const char* x5, const char* x6, const char* y);
40 TFunction(const char* x1, const char* x2, const char* x3, const char* x4, const char* x5, const char* x6, const char* x7, const char* y);
41 TFunction(const char* x1, const char* x2, const char* x3, const char* x4, const char* x5, const char* x6, const char* x7, const char* x8, const char* y);
42 TFunction(int n, const char** x, const char* y);
43 TFunction(const TFunction& f);
44 ~TFunction();
45
46 const TFunction& operator=(const TFunction& f);
47 const TFunction operator[](int i) const;
48
49 const std::string& expr() const;
50 const std::string expr(int i) const;
51 const Function& getFunction() const;
52 const std::string arg_name(int i) const;
53
54 using TFnc::eval;
55 // todo: using TFnc::eval_vector?
56 // todo: keep using TFnc::eval?
57
58 const Tube eval(const TubeVector& x) const;
59 const Trajectory traj_eval(const TrajectoryVector& x) const;
60 const Interval eval(const Interval& t) const;
61 const Interval eval(const IntervalVector& x) const;
62 const Interval eval(int slice_id, const TubeVector& x) const;
63 const Interval eval(const Interval& t, const TubeVector& x) const;
64
65 const TubeVector eval_vector(const TubeVector& x) const;
66 const TrajectoryVector traj_eval_vector(const TrajectoryVector& x) const;
67 const IntervalVector eval_vector(const Interval& t) const;
68 const IntervalVector eval_vector(const IntervalVector& x) const;
69 const IntervalVector eval_vector(int slice_id, const TubeVector& x) const;
70 const IntervalVector eval_vector(const Interval& t, const TubeVector& x) const;
71 const IntervalVector eval_vector(const IntervalVector& x1, const IntervalVector& x2) const;
72
73 template<typename FirstArg, typename... Args>
74 const IntervalVector eval_vector(const IntervalVector& x1, const IntervalVector& x2, FirstArg& xi, Args&... xs) // recursive variadic function
75 {
76 IntervalVector x_ = cart_prod(x1,x2,xi);
77 if constexpr(sizeof...(xs) > 0)
78 return eval_vector(x_, xs...);
79 else
80 return eval_vector(x_);
81 }
82
83 const TFunction diff() const;
84
85 protected:
86
87 void construct_from_array(int n, const char** x, const char* y);
88
89 Function *m_ibex_f = nullptr;
90 std::string m_expr; // stored here because impossible to get this value from Function
91 };
92}
93
94#endif
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition codac_capd_helpers.h:9
CtcCartProd cart_prod(Ctc &c1, Ctc &c2)
Cartesian product of contractors from two Ctc objects.