Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
optimizer.hpp File Reference
#include <tuple>
#include <functional>
#include <limits>
#include <libnest2d/common.hpp>
+ Include dependency graph for optimizer.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  libnest2d::opt::limits< T, B >
 A Type trait for upper and lower limit of a numeric type. More...
 
struct  libnest2d::opt::limits< T, enable_if_t< std::numeric_limits< T >::has_infinity, void > >
 
class  libnest2d::opt::Bound< T >
 An interval of possible input values for optimization. More...
 
struct  libnest2d::opt::Result< Args >
 A type to hold the complete result of the optimization. More...
 
struct  libnest2d::opt::StopCriteria
 A type for specifying the stop criteria. More...
 
class  libnest2d::opt::Optimizer< Subclass >
 The Optimizer base class with CRTP pattern. More...
 
class  libnest2d::opt::DummyOptimizer< T >
 
struct  libnest2d::opt::OptimizerSubclass< m >
 

Namespaces

namespace  libnest2d
 
namespace  libnest2d::opt
 

Typedefs

template<class... Args>
using libnest2d::opt::Input = tuple< Args... >
 
template<Method m>
using libnest2d::opt::TOptimizer = typename OptimizerSubclass< m >::Type
 Optimizer type based on the method provided in parameter m.
 

Enumerations

enum class  libnest2d::opt::Method { libnest2d::opt::L_SIMPLEX , libnest2d::opt::L_SUBPLEX , libnest2d::opt::G_GENETIC , libnest2d::opt::G_PARTICLE_SWARM }
 Specific optimization methods for which a default optimizer implementation can be instantiated. More...
 
enum  libnest2d::opt::ResultCodes {
  libnest2d::opt::FAILURE = -1 , libnest2d::opt::INVALID_ARGS = -2 , libnest2d::opt::OUT_OF_MEMORY = -3 , libnest2d::opt::ROUNDOFF_LIMITED = -4 ,
  libnest2d::opt::FORCED_STOP = -5 , libnest2d::opt::SUCCESS = 1 , libnest2d::opt::STOPVAL_REACHED = 2 , libnest2d::opt::FTOL_REACHED = 3 ,
  libnest2d::opt::XTOL_REACHED = 4 , libnest2d::opt::MAXEVAL_REACHED = 5 , libnest2d::opt::MAXTIME_REACHED = 6
}
 Info about result of an optimization. These codes are exactly the same as the nlopt codes for convinience. More...
 

Functions

template<class T >
Bound< T > libnest2d::opt::bound (const T &min, const T &max)
 
template<class... Args>
tuple< Args... > libnest2d::opt::initvals (Args...args)
 
template<Method m>
TOptimizer< m > libnest2d::opt::GlobalOptimizer (Method, const StopCriteria &scr={})
 Global optimizer with an explicitly specified local method.
 

Class Documentation

◆ libnest2d::opt::Result

struct libnest2d::opt::Result
template<class... Args>
struct libnest2d::opt::Result< Args >

A type to hold the complete result of the optimization.

+ Collaboration diagram for libnest2d::opt::Result< Args >:
Class Members
tuple< Args... > optimum
ResultCodes resultcode
double score

◆ libnest2d::opt::StopCriteria

struct libnest2d::opt::StopCriteria

A type for specifying the stop criteria.

Class Members
double absolute_score_difference = std::nan("") If the absolute value difference between two scores.
unsigned max_iterations = 0 The max allowed number of iterations.
double relative_score_difference = std::nan("") If the relative value difference between two scores.
function< bool()> stop_condition = [] { return false; } A predicate that if evaluates to true, the optimization should terminate and the best result found prior to termination should be returned.
double stop_score = std::nan("") Stop if this value or better is found.

◆ libnest2d::opt::OptimizerSubclass

struct libnest2d::opt::OptimizerSubclass
template<Method m>
struct libnest2d::opt::OptimizerSubclass< m >
Class Members
typedef DummyOptimizer<> Type