QUGaR 0.0.4
Loading...
Searching...
No Matches
qugar::impl::RootsIntervals< dim > Struct Template Reference

Struct for storing and managing computed roots and intervals of an implicit function. More...

#include <impl_utils.hpp>

Public Member Functions

 RootsIntervals ()
 Default constructor.
 
void clear ()
 Clears the container to the initial state.
 
void add_root (real root, int func_id)
 Adds a new root.
 
bool empty () const
 Checks whether the container is empty.
 
int get_num_roots () const
 Gets the number of roots in the container.
 
void sort_roots ()
 Sorts (in increasing order) the roots in the container and the according restriction indices func_ids.
 
void adjust_roots (const Tolerance &tol, real x0, real x1)
 Adjust the container roots by sorting them and forcing near roots (up to a _olerance) to be coincident.
 

Public Attributes

std::vector< realroots
 List of roots.
 
Point< dim > point
 Point at which roots are computed.
 
std::vector< int > func_ids
 Restrictions to which root correspond to (there is a one to correspondence).
 
std::vector< bool > active_intervals
 Flags indicating if the intervals defined by two consecutive roots are active.
 

Private Attributes

std::vector< std::pair< real, int > > roots_ids
 

Detailed Description

template<int dim>
struct qugar::impl::RootsIntervals< dim >

Struct for storing and managing computed roots and intervals of an implicit function.

Template Parameters
dimDimension of the point at which the intervals are computed.

Constructor & Destructor Documentation

◆ RootsIntervals()

template<int dim>
qugar::impl::RootsIntervals< dim >::RootsIntervals ( )

Default constructor.

Member Function Documentation

◆ add_root()

template<int dim>
void qugar::impl::RootsIntervals< dim >::add_root ( real root,
int func_id )

Adds a new root.

Parameters
rootNew root to be added.
func_idIf of the restriction to which the root belongs to.
Note
The roots are neither sorted nor adjusted (for degeneracies) after appending the new root.

◆ adjust_roots()

template<int dim>
void qugar::impl::RootsIntervals< dim >::adjust_roots ( const Tolerance & tol,
real x0,
real x1 )

Adjust the container roots by sorting them and forcing near roots (up to a _olerance) to be coincident.

Parameters
tolTolerance to be used in the comparisons between roots.
x0Start of the interval to which the roots belong to.
x1End of the interval to which the roots belong to.

◆ clear()

template<int dim>
void qugar::impl::RootsIntervals< dim >::clear ( )

Clears the container to the initial state.

◆ empty()

template<int dim>
bool qugar::impl::RootsIntervals< dim >::empty ( ) const
nodiscard

Checks whether the container is empty.

Returns
True if empty, i.e. there are no roots, false otherwise.

◆ get_num_roots()

template<int dim>
int qugar::impl::RootsIntervals< dim >::get_num_roots ( ) const
nodiscard

Gets the number of roots in the container.

Returns
Number of roots.

◆ sort_roots()

template<int dim>
void qugar::impl::RootsIntervals< dim >::sort_roots ( )

Sorts (in increasing order) the roots in the container and the according restriction indices func_ids.

Member Data Documentation

◆ active_intervals

template<int dim>
std::vector<bool> qugar::impl::RootsIntervals< dim >::active_intervals

Flags indicating if the intervals defined by two consecutive roots are active.

◆ func_ids

template<int dim>
std::vector<int> qugar::impl::RootsIntervals< dim >::func_ids

Restrictions to which root correspond to (there is a one to correspondence).

◆ point

template<int dim>
Point<dim> qugar::impl::RootsIntervals< dim >::point

Point at which roots are computed.

◆ roots

template<int dim>
std::vector<real> qugar::impl::RootsIntervals< dim >::roots

List of roots.

◆ roots_ids

template<int dim>
std::vector<std::pair<real, int> > qugar::impl::RootsIntervals< dim >::roots_ids
private

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