codac 1.5.6
|
n-dimensional trajectory \(\mathbf{x}(\cdot)\), defined as a temporal map of vector values More...
#include <codac_TrajectoryVector.h>
Public Member Functions | |
Definition | |
TrajectoryVector (int n) | |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\). | |
TrajectoryVector (const Interval &tdomain, const TFunction &f) | |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\) from an analytic expression. | |
TrajectoryVector (const Interval &tdomain, const TFunction &f, double timestep) | |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\) from an analytic expression, and transforms it as a map of values (sampling procedure) | |
TrajectoryVector (const std::map< double, Vector > &m_map_values) | |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\) from a map of vector values. | |
TrajectoryVector (const std::vector< std::map< double, double > > &v_map_values) | |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\) from a vector of maps of scalar values. | |
TrajectoryVector (const std::list< double > &list_t, const std::list< Vector > &list_x) | |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\) from a list of vector values. | |
TrajectoryVector (std::initializer_list< Trajectory > list) | |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\) from a list of Trajectory objects. | |
TrajectoryVector (const TrajectoryVector &traj) | |
Creates a copy of a n-dimensional trajectory \(\mathbf{x}(\cdot)\). | |
TrajectoryVector (int n, const Trajectory &x) | |
Creates a n-dimensional trajectory with all the components initialized to \(x(\cdot)\). | |
~TrajectoryVector () | |
TrajectoryVector destructor. | |
const TrajectoryVector & | operator= (const TrajectoryVector &x) |
Returns a copy of a TrajectoryVector. | |
int | size () const |
Returns the dimension of the trajectory. | |
const Interval | tdomain () const |
Returns the temporal definition domain of this trajectory. | |
void | resize (int n) |
Resizes this TrajectoryVector. | |
const TrajectoryVector | subvector (int start_index, int end_index) const |
Returns a subvector of this TrajectoryVector. | |
void | put (int start_index, const TrajectoryVector &subvec) |
Puts a subvector into this TrajectoryVector at a given position. | |
Accessing values | |
const IntervalVector | codomain () const |
Returns the box of feasible values. | |
Trajectory & | operator[] (int index) |
Returns the ith Trajectory of this TrajectoryVector. | |
const Trajectory & | operator[] (int index) const |
Returns a const reference to the ith Trajectory of this TrajectoryVector. | |
const Vector | operator() (double t) const |
Returns the evaluation of this trajectory at \(t\). | |
const IntervalVector | operator() (const Interval &t) const |
Returns the interval evaluation of this trajectory over \([t]\). | |
const Vector | first_value () const |
Returns the value \(\mathbf{x}(t_0)\). | |
const Vector | last_value () const |
Returns the value \(\mathbf{x}(t_f)\). | |
Tests | |
bool | not_defined () const |
Tests whether this trajectory is defined or not. | |
bool | operator== (const TrajectoryVector &x) const |
Returns true if this trajectory is equal to \(\mathbf{x}(\cdot)\). | |
bool | operator!= (const TrajectoryVector &x) const |
Returns true if this trajectory is different from \(\mathbf{x}(\cdot)\). | |
Setting values | |
void | set (const Vector &y, double t) |
Sets a value \(\mathbf{y}\) at \(t\): \(\mathbf{x}(t)=\mathbf{y}\). | |
TrajectoryVector & | truncate_tdomain (const Interval &tdomain) |
Truncates the tdomain of \(\mathbf{x}(\cdot)\). | |
TrajectoryVector & | shift_tdomain (double a) |
Shifts the tdomain \([t_0,t_f]\) of \(\mathbf{x}(\cdot)\). | |
bool | same_tdomain_forall_components () const |
Checks whether all the Trajectory components have the same tdomain or not. | |
TrajectoryVector & | sample (double timestep) |
Transforms an analytic trajectory as a map of values. | |
TrajectoryVector & | sample (const Trajectory &x) |
Samples this trajectory so that it will share the same sampling of \(x(\cdot)\). | |
TrajectoryVector & | sample (const TrajectoryVector &x) |
Samples this trajectory so that it will share the same sampling of \(\mathbf{x}(\cdot)\). | |
TrajectoryVector & | make_continuous () |
Makes a trajectory continuous by avoiding infinite slopes. | |
Integration | |
const TrajectoryVector | primitive (const Vector &c) const |
Computes an approximative primitive of \(\mathbf{x}(\cdot)\). | |
const TrajectoryVector | primitive (const Vector &c, double timestep) const |
Computes an approximative primitive of \(\mathbf{x}(\cdot)\) with some time discretization \(\delta\). | |
const TrajectoryVector | diff () const |
Differentiates this trajectory vector. | |
Assignments operators | |
const TrajectoryVector & | operator+= (double x) |
Operates +=. | |
const TrajectoryVector & | operator+= (const Trajectory &x) |
Operates +=. | |
const TrajectoryVector & | operator+= (const Vector &x) |
Operates +=. | |
const TrajectoryVector & | operator+= (const TrajectoryVector &x) |
Operates +=. | |
const TrajectoryVector & | operator-= (double x) |
Operates -=. | |
const TrajectoryVector & | operator-= (const Trajectory &x) |
Operates -=. | |
const TrajectoryVector & | operator-= (const Vector &x) |
Operates -=. | |
const TrajectoryVector & | operator-= (const TrajectoryVector &x) |
Operates -=. | |
const TrajectoryVector & | operator*= (double x) |
Operates *=. | |
const TrajectoryVector & | operator*= (const Trajectory &x) |
Operates *=. | |
const TrajectoryVector & | operator/= (double x) |
Operates /=. | |
const TrajectoryVector & | operator/= (const Trajectory &x) |
Operates /=. | |
Public Member Functions inherited from codac::DynamicalItem | |
virtual | ~DynamicalItem () |
DynamicalItem destructor. | |
Protected Member Functions | |
TrajectoryVector () | |
Creates an undefined n-dimensional trajectory. | |
const IntervalVector | codomain_box () const |
Returns the box \(\mathbf{x}([t_0,t_f])\). | |
Protected Attributes | |
int | m_n = 0 |
dimension of this trajectory | |
Trajectory * | m_v_trajs = nullptr |
array of components (scalar trajectories) | |
String | |
const std::string | class_name () const |
Returns the name of this class. | |
Additional Inherited Members | |
Static Public Member Functions inherited from codac::DynamicalItem | |
static bool | valid_tdomain (const Interval &tdomain) |
Verifies that this interval is a feasible tdomain. | |
n-dimensional trajectory \(\mathbf{x}(\cdot)\), defined as a temporal map of vector values
|
explicit |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\).
n | dimension of this trajectory |
codac::TrajectoryVector::TrajectoryVector | ( | const Interval & | tdomain, |
const TFunction & | f ) |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\) from an analytic expression.
tdomain | temporal domain \([t_0,t_f]\) |
f | TFunction object defining the trajectory: \(\mathbf{x}(t)=\mathbf{f}(t)\) |
codac::TrajectoryVector::TrajectoryVector | ( | const Interval & | tdomain, |
const TFunction & | f, | ||
double | timestep ) |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\) from an analytic expression, and transforms it as a map of values (sampling procedure)
tdomain | temporal domain \([t_0,t_f]\) |
f | TFunction object defining the trajectory: \(\mathbf{x}(t)=\mathbf{f}(t)\) |
timestep | sampling value \(\delta\) for the temporal discretization (double) |
|
explicit |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\) from a map of vector values.
m_map_values | map<t,y> defining the trajectory: \(\mathbf{x}(t)=\mathbf{y}\) |
|
explicit |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\) from a vector of maps of scalar values.
v_map_values | set of map<t,y> defining the trajectory: \(\mathbf{x}(t)=\mathbf{y}\) |
|
explicit |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\) from a list of vector values.
Values and datations are separated into two lists.
list_t | list of time keys |
list_x | list of vector values |
codac::TrajectoryVector::TrajectoryVector | ( | std::initializer_list< Trajectory > | list | ) |
Creates a n-dimensional trajectory \(\mathbf{x}(\cdot)\) from a list of Trajectory objects.
list | list of \(x_i(\cdot)\) trajectories |
codac::TrajectoryVector::TrajectoryVector | ( | const TrajectoryVector & | traj | ) |
Creates a copy of a n-dimensional trajectory \(\mathbf{x}(\cdot)\).
traj | TrajectoryVector to be duplicated |
codac::TrajectoryVector::TrajectoryVector | ( | int | n, |
const Trajectory & | x ) |
Creates a n-dimensional trajectory with all the components initialized to \(x(\cdot)\).
n | dimension of this trajectory |
x | Trajectory to be copied for all the components |
|
protected |
Creates an undefined n-dimensional trajectory.
const TrajectoryVector & codac::TrajectoryVector::operator= | ( | const TrajectoryVector & | x | ) |
Returns a copy of a TrajectoryVector.
x | the TrajectoryVector object to be copied |
|
virtual |
|
virtual |
Returns the temporal definition domain of this trajectory.
Implements codac::DynamicalItem.
void codac::TrajectoryVector::resize | ( | int | n | ) |
Resizes this TrajectoryVector.
n | the new size to be set |
const TrajectoryVector codac::TrajectoryVector::subvector | ( | int | start_index, |
int | end_index ) const |
Returns a subvector of this TrajectoryVector.
start_index | first component index of the subvector to be returned |
end_index | last component index of the subvector to be returned |
void codac::TrajectoryVector::put | ( | int | start_index, |
const TrajectoryVector & | subvec ) |
Puts a subvector into this TrajectoryVector at a given position.
start_index | position where the subvector will be put |
subvec | the TrajectoryVector to put from start_index |
const IntervalVector codac::TrajectoryVector::codomain | ( | ) | const |
Returns the box of feasible values.
Trajectory & codac::TrajectoryVector::operator[] | ( | int | index | ) |
Returns the ith Trajectory of this TrajectoryVector.
index | the index of this ith component |
const Trajectory & codac::TrajectoryVector::operator[] | ( | int | index | ) | const |
Returns a const reference to the ith Trajectory of this TrajectoryVector.
index | the index of this ith component |
const Vector codac::TrajectoryVector::operator() | ( | double | t | ) | const |
Returns the evaluation of this trajectory at \(t\).
t | the temporal key (double, must belong to the trajectory's tdomain) |
const IntervalVector codac::TrajectoryVector::operator() | ( | const Interval & | t | ) | const |
Returns the interval evaluation of this trajectory over \([t]\).
t | the subtdomain (Interval, must be a subset of the trajectory's tdomain) |
const Vector codac::TrajectoryVector::first_value | ( | ) | const |
Returns the value \(\mathbf{x}(t_0)\).
const Vector codac::TrajectoryVector::last_value | ( | ) | const |
Returns the value \(\mathbf{x}(t_f)\).
bool codac::TrajectoryVector::not_defined | ( | ) | const |
Tests whether this trajectory is defined or not.
bool codac::TrajectoryVector::operator== | ( | const TrajectoryVector & | x | ) | const |
Returns true if this trajectory is equal to \(\mathbf{x}(\cdot)\).
x | the TrajectoryVector object |
bool codac::TrajectoryVector::operator!= | ( | const TrajectoryVector & | x | ) | const |
Returns true if this trajectory is different from \(\mathbf{x}(\cdot)\).
x | the TrajectoryVector object |
void codac::TrajectoryVector::set | ( | const Vector & | y, |
double | t ) |
Sets a value \(\mathbf{y}\) at \(t\): \(\mathbf{x}(t)=\mathbf{y}\).
y | local vector value of the trajectory |
t | the temporal key (double, must belong to the trajectory's tdomain) |
TrajectoryVector & codac::TrajectoryVector::truncate_tdomain | ( | const Interval & | tdomain | ) |
Truncates the tdomain of \(\mathbf{x}(\cdot)\).
tdomain | new temporal domain \([t_0,t_f]\) |
TrajectoryVector & codac::TrajectoryVector::shift_tdomain | ( | double | a | ) |
Shifts the tdomain \([t_0,t_f]\) of \(\mathbf{x}(\cdot)\).
a | the offset value so that \([t_0,t_f]:=[t_0-a,t_f-a]\) |
bool codac::TrajectoryVector::same_tdomain_forall_components | ( | ) | const |
Checks whether all the Trajectory components have the same tdomain or not.
TrajectoryVector & codac::TrajectoryVector::sample | ( | double | timestep | ) |
Transforms an analytic trajectory as a map of values.
timestep | sampling value \(\delta\) for the temporal discretization (double) |
TrajectoryVector & codac::TrajectoryVector::sample | ( | const Trajectory & | x | ) |
Samples this trajectory so that it will share the same sampling of \(x(\cdot)\).
x | the Trajectory from which the new sampling will come from |
TrajectoryVector & codac::TrajectoryVector::sample | ( | const TrajectoryVector & | x | ) |
Samples this trajectory so that it will share the same sampling of \(\mathbf{x}(\cdot)\).
x | the TrajectoryVector from which the new sampling will come from |
TrajectoryVector & codac::TrajectoryVector::make_continuous | ( | ) |
Makes a trajectory continuous by avoiding infinite slopes.
const TrajectoryVector codac::TrajectoryVector::primitive | ( | const Vector & | c | ) | const |
Computes an approximative primitive of \(\mathbf{x}(\cdot)\).
c | the constant of integration |
const TrajectoryVector codac::TrajectoryVector::primitive | ( | const Vector & | c, |
double | timestep ) const |
Computes an approximative primitive of \(\mathbf{x}(\cdot)\) with some time discretization \(\delta\).
c | the constant of integration |
timestep | sampling value \(\delta\) for the temporal discretization (double) |
const TrajectoryVector codac::TrajectoryVector::diff | ( | ) | const |
Differentiates this trajectory vector.
const TrajectoryVector & codac::TrajectoryVector::operator+= | ( | double | x | ) |
Operates +=.
x | double |
const TrajectoryVector & codac::TrajectoryVector::operator+= | ( | const Trajectory & | x | ) |
const TrajectoryVector & codac::TrajectoryVector::operator+= | ( | const Vector & | x | ) |
Operates +=.
x | Vector |
const TrajectoryVector & codac::TrajectoryVector::operator+= | ( | const TrajectoryVector & | x | ) |
const TrajectoryVector & codac::TrajectoryVector::operator-= | ( | double | x | ) |
Operates -=.
x | double |
const TrajectoryVector & codac::TrajectoryVector::operator-= | ( | const Trajectory & | x | ) |
const TrajectoryVector & codac::TrajectoryVector::operator-= | ( | const Vector & | x | ) |
Operates -=.
x | Vector |
const TrajectoryVector & codac::TrajectoryVector::operator-= | ( | const TrajectoryVector & | x | ) |
const TrajectoryVector & codac::TrajectoryVector::operator*= | ( | double | x | ) |
Operates *=.
x | double |
const TrajectoryVector & codac::TrajectoryVector::operator*= | ( | const Trajectory & | x | ) |
const TrajectoryVector & codac::TrajectoryVector::operator/= | ( | double | x | ) |
Operates /=.
x | double |
const TrajectoryVector & codac::TrajectoryVector::operator/= | ( | const Trajectory & | x | ) |
|
inlinevirtual |
Returns the name of this class.
Implements codac::DynamicalItem.
|
protectedvirtual |
Returns the box \(\mathbf{x}([t_0,t_f])\).
Implements codac::DynamicalItem.