robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
robotoc::TimeDiscretization Class Reference

Time discretization of the optimal control problem. More...

#include <time_discretization.hpp>

Public Member Functions

 TimeDiscretization (const double T, const int N, const int reserved_num_discrete_events=0)
 Constructor. More...
 
 TimeDiscretization ()
 Default constructor. More...
 
 ~TimeDiscretization ()=default
 Default destructor. More...
 
 TimeDiscretization (const TimeDiscretization &)=default
 Default copy constructor. More...
 
TimeDiscretization & operator= (const TimeDiscretization &)=default
 Default copy assign operator. More...
 
 TimeDiscretization (TimeDiscretization &&) noexcept=default
 Default move constructor. More...
 
TimeDiscretization & operator= (TimeDiscretization &&) noexcept=default
 Default move assign operator. More...
 
int N () const
 
int size () const
 Returns the number of grids. More...
 
const GridInfo & grid (const int i) const
 Returns the grid info of the specified stage. More...
 
const GridInfo & operator[] (const int i) const
 Returns the grid info of the specified stage. More...
 
const GridInfo & front () const
 Returns the grid info of the initial stage. More...
 
const GridInfo & back () const
 Returns the grid info of the terminal stage. More...
 
double maxTimeStep () const
 Gets the maximum time step of the discretization. More...
 
void reserve (const int reserved_num_discrete_events)
 Reserve the discrete-event data. More...
 
int reservedNumDiscreteEvents () const
 
void discretize (const std::shared_ptr< ContactSequence > &contact_sequence, const double t)
 Discretizes the finite horizon taking into account the discrete events. More...
 
void correctTimeSteps (const std::shared_ptr< ContactSequence > &contact_sequence, const double t)
 Discretizes the finite horizon taking into account the discrete events. More...
 
void disp (std::ostream &os) const
 Displays the time discretization onto a ostream. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const TimeDiscretization &discretization)
 

Detailed Description

Time discretization of the optimal control problem.

Constructor & Destructor Documentation

◆ TimeDiscretization() [1/4]

robotoc::TimeDiscretization::TimeDiscretization ( const double  T,
const int  N,
const int  reserved_num_discrete_events = 0 
)

Constructor.

Parameters
[in]TLength of the horizon. Must be positive.
[in]NNumber of the discretization grids of the horizon except for the discrete events. Must be positive.
[in]reserved_num_discrete_eventsReserved size of each discrete events (impact and lift) to avoid dynamic memory allocation. Must be non-negative. Default is 0.

◆ TimeDiscretization() [2/4]

robotoc::TimeDiscretization::TimeDiscretization ( )

Default constructor.

◆ ~TimeDiscretization()

robotoc::TimeDiscretization::~TimeDiscretization ( )
default

Default destructor.

◆ TimeDiscretization() [3/4]

robotoc::TimeDiscretization::TimeDiscretization ( const TimeDiscretization &  )
default

Default copy constructor.

◆ TimeDiscretization() [4/4]

robotoc::TimeDiscretization::TimeDiscretization ( TimeDiscretization &&  )
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ back()

const GridInfo & robotoc::TimeDiscretization::back ( ) const
inline

Returns the grid info of the terminal stage.

Returns
const reference to the grid info of the terminal stage.

◆ correctTimeSteps()

void robotoc::TimeDiscretization::correctTimeSteps ( const std::shared_ptr< ContactSequence > &  contact_sequence,
const double  t 
)

Discretizes the finite horizon taking into account the discrete events.

Parameters
[in]contact_sequenceShared ptr to the contact sequence.
[in]tInitial time of the horizon.

◆ discretize()

void robotoc::TimeDiscretization::discretize ( const std::shared_ptr< ContactSequence > &  contact_sequence,
const double  t 
)

Discretizes the finite horizon taking into account the discrete events.

Parameters
[in]contact_sequenceShared ptr to the contact sequence.
[in]tInitial time of the horizon.

◆ disp()

void robotoc::TimeDiscretization::disp ( std::ostream &  os) const

Displays the time discretization onto a ostream.

◆ front()

const GridInfo & robotoc::TimeDiscretization::front ( ) const
inline

Returns the grid info of the initial stage.

Returns
const reference to the grid info of the intial stage.

◆ grid()

const GridInfo & robotoc::TimeDiscretization::grid ( const int  i) const
inline

Returns the grid info of the specified stage.

Parameters
[in]iStage of interest.
Returns
const reference to the grid info of the stage of interest.

◆ maxTimeStep()

double robotoc::TimeDiscretization::maxTimeStep ( ) const
inline

Gets the maximum time step of the discretization.

Returns
The maximum time step of the discretization.

◆ N()

int robotoc::TimeDiscretization::N ( ) const
inline
Returns
Number of the time stages on the horizon.

◆ operator=() [1/2]

TimeDiscretization & robotoc::TimeDiscretization::operator= ( const TimeDiscretization &  )
default

Default copy assign operator.

◆ operator=() [2/2]

TimeDiscretization & robotoc::TimeDiscretization::operator= ( TimeDiscretization &&  )
defaultnoexcept

Default move assign operator.

◆ operator[]()

const GridInfo & robotoc::TimeDiscretization::operator[] ( const int  i) const
inline

Returns the grid info of the specified stage.

Parameters
[in]iStage of interest.
Returns
const reference to the grid info of the stage of interest.

◆ reserve()

void robotoc::TimeDiscretization::reserve ( const int  reserved_num_discrete_events)

Reserve the discrete-event data.

Parameters
[in]reserved_num_discrete_eventsReserved size of discrete events
on the horizon. Must be non-negative.

◆ reservedNumDiscreteEvents()

int robotoc::TimeDiscretization::reservedNumDiscreteEvents ( ) const
Returns
Reserved size of the discrete-event data.

◆ size()

int robotoc::TimeDiscretization::size ( ) const
inline

Returns the number of grids.

Returns
The number of grids..

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const TimeDiscretization &  discretization 
)
friend

The documentation for this class was generated from the following file: