codac 1.5.6
Loading...
Searching...
No Matches
codac_TrajectoryVector.h
Go to the documentation of this file.
1
12#ifndef __CODAC_TRAJECTORYVECTOR_H__
13#define __CODAC_TRAJECTORYVECTOR_H__
14
15#include <map>
16#include <list>
17#include <initializer_list>
18#include "codac_Vector.h"
19#include "codac_Interval.h"
20#include "codac_TFunction.h"
21#include "codac_Trajectory.h"
22#include "codac_DynamicalItem.h"
24
25namespace codac
26{
27 class TFunction;
28 class TubeVector;
29 class Trajectory;
30
38 {
39 public:
40
43
49 explicit TrajectoryVector(int n);
50
57 TrajectoryVector(const Interval& tdomain, const TFunction& f);
58
67 TrajectoryVector(const Interval& tdomain, const TFunction& f, double timestep);
68
74 explicit TrajectoryVector(const std::map<double,Vector>& m_map_values);
75
81 explicit TrajectoryVector(const std::vector<std::map<double,double> >& v_map_values);
82
91 explicit TrajectoryVector(const std::list<double>& list_t, const std::list<Vector>& list_x);
92
98 TrajectoryVector(std::initializer_list<Trajectory> list);
99
106
113 TrajectoryVector(int n, const Trajectory& x);
114
119
127
133 int size() const;
134
140 const Interval tdomain() const;
141
150 void resize(int n);
151
159 const TrajectoryVector subvector(int start_index, int end_index) const;
160
167 void put(int start_index, const TrajectoryVector& subvec);
168
172
178 const IntervalVector codomain() const;
179
187
194 const Trajectory& operator[](int index) const;
195
207 const Vector operator()(double t) const;
208
215 const IntervalVector operator()(const Interval& t) const;
216
222 const Vector first_value() const;
223
229 const Vector last_value() const;
230
234
241 bool not_defined() const;
242
249 bool operator==(const TrajectoryVector& x) const;
250
257 bool operator!=(const TrajectoryVector& x) const;
258
262
269 void set(const Vector& y, double t);
270
280
292
299
308 TrajectoryVector& sample(double timestep);
309
322
335
349
353
363 const TrajectoryVector primitive(const Vector& c) const;
364
373 const TrajectoryVector primitive(const Vector& c, double timestep) const;
374
384 const TrajectoryVector diff() const;
385
389
396 const TrajectoryVector& operator+=(double x);
397
405
412 const TrajectoryVector& operator+=(const Vector& x);
413
421
428 const TrajectoryVector& operator-=(double x);
429
437
444 const TrajectoryVector& operator-=(const Vector& x);
445
453
460 const TrajectoryVector& operator*=(double x);
461
469
476 const TrajectoryVector& operator/=(double x);
477
485
489
497 const std::string class_name() const { return "TrajectoryVector"; };
498
506 friend std::ostream& operator<<(std::ostream& str, const TrajectoryVector& x);
507
509
510 protected:
511
518
526 const IntervalVector codomain_box() const;
527
528 // Class variables:
529
530 int m_n = 0;
532
533 friend void deserialize_TrajectoryVector(std::ifstream& bin_file, TrajectoryVector *&traj);
534 friend class TubeVector; // for TubeVector::deserialize method
535 };
536}
537
538#endif
Abstract class for common properties of Tube, TubeVector, Slice, Trajectory, TrajectoryVector objects...
Definition codac_DynamicalItem.h:26
One dimensional trajectory , defined as a temporal map of values.
Definition codac_Trajectory.h:35
n-dimensional trajectory , defined as a temporal map of vector values
Definition codac_TrajectoryVector.h:38
TrajectoryVector & make_continuous()
Makes a trajectory continuous by avoiding infinite slopes.
Trajectory & operator[](int index)
Returns the ith Trajectory of this TrajectoryVector.
const TrajectoryVector & operator+=(double x)
Operates +=.
const TrajectoryVector & operator/=(const Trajectory &x)
Operates /=.
void resize(int n)
Resizes this TrajectoryVector.
const TrajectoryVector subvector(int start_index, int end_index) const
Returns a subvector of this TrajectoryVector.
TrajectoryVector()
Creates an undefined n-dimensional trajectory.
Trajectory * m_v_trajs
array of components (scalar trajectories)
Definition codac_TrajectoryVector.h:531
const std::string class_name() const
Returns the name of this class.
Definition codac_TrajectoryVector.h:497
TrajectoryVector(int n, const Trajectory &x)
Creates a n-dimensional trajectory with all the components initialized to .
int size() const
Returns the dimension of the trajectory.
TrajectoryVector & sample(const TrajectoryVector &x)
Samples this trajectory so that it will share the same sampling of .
const TrajectoryVector & operator*=(const Trajectory &x)
Operates *=.
TrajectoryVector(const TrajectoryVector &traj)
Creates a copy of a n-dimensional trajectory .
TrajectoryVector(int n)
Creates a n-dimensional trajectory .
const IntervalVector codomain() const
Returns the box of feasible values.
const TrajectoryVector & operator+=(const TrajectoryVector &x)
Operates +=.
const TrajectoryVector & operator+=(const Trajectory &x)
Operates +=.
int m_n
dimension of this trajectory
Definition codac_TrajectoryVector.h:530
bool not_defined() const
Tests whether this trajectory is defined or not.
const Trajectory & operator[](int index) const
Returns a const reference to the ith Trajectory of this TrajectoryVector.
TrajectoryVector(const std::list< double > &list_t, const std::list< Vector > &list_x)
Creates a n-dimensional trajectory from a list of vector values.
TrajectoryVector & sample(double timestep)
Transforms an analytic trajectory as a map of values.
TrajectoryVector & truncate_tdomain(const Interval &tdomain)
Truncates the tdomain of .
const IntervalVector operator()(const Interval &t) const
Returns the interval evaluation of this trajectory over .
const TrajectoryVector & operator-=(const Trajectory &x)
Operates -=.
bool same_tdomain_forall_components() const
Checks whether all the Trajectory components have the same tdomain or not.
const IntervalVector codomain_box() const
Returns the box .
const TrajectoryVector diff() const
Differentiates this trajectory vector.
friend void deserialize_TrajectoryVector(std::ifstream &bin_file, TrajectoryVector *&traj)
Creates a TrajectoryVector object from a binary file.
const Vector last_value() const
Returns the value .
const Vector first_value() const
Returns the value .
TrajectoryVector & shift_tdomain(double a)
Shifts the tdomain of .
TrajectoryVector(const Interval &tdomain, const TFunction &f, double timestep)
Creates a n-dimensional trajectory from an analytic expression, and transforms it as a map of values...
bool operator!=(const TrajectoryVector &x) const
Returns true if this trajectory is different from .
const TrajectoryVector & operator*=(double x)
Operates *=.
const Vector operator()(double t) const
Returns the evaluation of this trajectory at .
const TrajectoryVector & operator+=(const Vector &x)
Operates +=.
const Interval tdomain() const
Returns the temporal definition domain of this trajectory.
friend std::ostream & operator<<(std::ostream &str, const TrajectoryVector &x)
Displays a synthesis of this trajectory.
const TrajectoryVector & operator/=(double x)
Operates /=.
TrajectoryVector(const Interval &tdomain, const TFunction &f)
Creates a n-dimensional trajectory from an analytic expression.
TrajectoryVector(std::initializer_list< Trajectory > list)
Creates a n-dimensional trajectory from a list of Trajectory objects.
const TrajectoryVector & operator=(const TrajectoryVector &x)
Returns a copy of a TrajectoryVector.
const TrajectoryVector & operator-=(double x)
Operates -=.
const TrajectoryVector & operator-=(const TrajectoryVector &x)
Operates -=.
void put(int start_index, const TrajectoryVector &subvec)
Puts a subvector into this TrajectoryVector at a given position.
const TrajectoryVector & operator-=(const Vector &x)
Operates -=.
const TrajectoryVector primitive(const Vector &c) const
Computes an approximative primitive of .
TrajectoryVector & sample(const Trajectory &x)
Samples this trajectory so that it will share the same sampling of .
void set(const Vector &y, double t)
Sets a value at : .
~TrajectoryVector()
TrajectoryVector destructor.
bool operator==(const TrajectoryVector &x) const
Returns true if this trajectory is equal to .
TrajectoryVector(const std::vector< std::map< double, double > > &v_map_values)
Creates a n-dimensional trajectory from a vector of maps of scalar values.
TrajectoryVector(const std::map< double, Vector > &m_map_values)
Creates a n-dimensional trajectory from a map of vector values.
const TrajectoryVector primitive(const Vector &c, double timestep) const
Computes an approximative primitive of with some time discretization .
n-dimensional tube , defined as an interval of n-dimensional trajectories
Definition codac_TubeVector.h:39
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition codac_capd_helpers.h:9