QUGaR 0.0.4
|
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< real > | roots |
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 |
Struct for storing and managing computed roots and intervals of an implicit function.
dim | Dimension of the point at which the intervals are computed. |
qugar::impl::RootsIntervals< dim >::RootsIntervals | ( | ) |
Default constructor.
void qugar::impl::RootsIntervals< dim >::add_root | ( | real | root, |
int | func_id ) |
Adds a new root.
root | New root to be added. |
func_id | If of the restriction to which the root belongs to. |
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.
tol | Tolerance to be used in the comparisons between roots. |
x0 | Start of the interval to which the roots belong to. |
x1 | End of the interval to which the roots belong to. |
void qugar::impl::RootsIntervals< dim >::clear | ( | ) |
Clears the container to the initial state.
|
nodiscard |
Checks whether the container is empty.
|
nodiscard |
Gets the number of roots in the container.
void qugar::impl::RootsIntervals< dim >::sort_roots | ( | ) |
Sorts (in increasing order) the roots in the container and the according restriction indices func_ids.
std::vector<bool> qugar::impl::RootsIntervals< dim >::active_intervals |
Flags indicating if the intervals defined by two consecutive roots are active.
std::vector<int> qugar::impl::RootsIntervals< dim >::func_ids |
Restrictions to which root correspond to (there is a one to correspondence).
Point<dim> qugar::impl::RootsIntervals< dim >::point |
Point at which roots are computed.
std::vector<real> qugar::impl::RootsIntervals< dim >::roots |
List of roots.
|
private |