Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::opt::detail Namespace Reference

Classes

struct  AlgBurteForce
 
struct  AlgFeatures_
 
struct  AlgFeatures_< AlgNLoptAGS >
 
struct  AlgFeatures_< AlgNLoptCobyla >
 
struct  AlgFeatures_< AlgNLoptISRES >
 
struct  AlgFeatures_< AlgNLoptORIG_DIRECT >
 
struct  AlgFeatures_< NLoptAUGLAG< M > >
 
struct  GetNLoptAlg_
 
struct  GetNLoptAlg_< NLoptAlg< a > >
 
struct  GetNLoptAlg_< NLoptAlgComb< g, l > >
 
struct  GetNLoptAlg_< NLoptAUGLAG< M > >
 
struct  IsNLoptAlg
 
struct  IsNLoptAlg< NLoptAlg< a > >
 
struct  IsNLoptAlg< NLoptAlgComb< a1, a2 > >
 
struct  IsNLoptAlg< NLoptAUGLAG< NLoptAlg< a > > >
 
struct  IsNLoptAlg< NLoptAUGLAG< NLoptAlgComb< a1, a2 > > >
 
struct  NLoptAlg
 
struct  NLoptAlgComb
 
struct  NLoptAUGLAG
 
class  NLoptOpt
 
struct  NLoptRAII
 

Typedefs

template<class M , class T = void>
using NLoptOnly = std::enable_if_t< IsNLoptAlg< M >::value, T >
 

Enumerations

enum class  OptDir { MIN , MAX }
 

Functions

template<size_t N>
long num_iter (const std::array< size_t, N > &idx, size_t gridsz)
 
template<class Fn , class... Args>
Fn for_each_argument (Fn &&fn, Args &&...args)
 
template<class Fn , class Tup >
Fn for_each_in_tuple (Fn fn, Tup &&tup)
 
template<template< class > class W, class... Args>
auto wrap_tup (const std::tuple< Args... > &tup)
 
template<size_t N, class T >
auto to_arr (const T *a)
 
template<size_t N, class T >
auto to_arr (const T(&a)[N])
 

Variables

template<class M >
constexpr nlopt_algorithm GetNLoptAlg_Global = GetNLoptAlg_<remove_cvref_t<M>>::Global
 
template<class M >
constexpr nlopt_algorithm GetNLoptAlg_Local = GetNLoptAlg_<remove_cvref_t<M>>::Local
 
template<class M >
constexpr bool IsAUGLAG = GetNLoptAlg_<remove_cvref_t<M>>::IsAUGLAG
 

Class Documentation

◆ Slic3r::opt::detail::NLoptAlg

struct Slic3r::opt::detail::NLoptAlg
template<nlopt_algorithm alg>
struct Slic3r::opt::detail::NLoptAlg< alg >

◆ Slic3r::opt::detail::NLoptAlgComb

struct Slic3r::opt::detail::NLoptAlgComb
template<nlopt_algorithm gl_alg, nlopt_algorithm lc_alg = NLOPT_LN_NELDERMEAD>
struct Slic3r::opt::detail::NLoptAlgComb< gl_alg, lc_alg >

◆ Slic3r::opt::detail::NLoptAUGLAG

struct Slic3r::opt::detail::NLoptAUGLAG
template<class Alg>
struct Slic3r::opt::detail::NLoptAUGLAG< Alg >

Typedef Documentation

◆ NLoptOnly

template<class M , class T = void>
using Slic3r::opt::detail::NLoptOnly = typedef std::enable_if_t<IsNLoptAlg<M>::value, T>

Enumeration Type Documentation

◆ OptDir

enum class Slic3r::opt::detail::OptDir
strong
Enumerator
MIN 
MAX 
89{ MIN, MAX }; // Where to optimize
#define MIN(a, b)
Definition avrftdi.c:48
#define MAX(a, b)
Definition avrftdi.c:45

Function Documentation

◆ for_each_argument()

template<class Fn , class... Args>
Fn Slic3r::opt::detail::for_each_argument ( Fn &&  fn,
Args &&...  args 
)
110{
111 // see https://www.fluentcpp.com/2019/03/05/for_each_arg-applying-a-function-to-each-argument-of-a-function-in-cpp/
112 (fn(std::forward<Args>(args)),...);
113
114 return fn;
115}

Referenced by for_each_in_tuple().

+ Here is the caller graph for this function:

◆ for_each_in_tuple()

template<class Fn , class Tup >
Fn Slic3r::opt::detail::for_each_in_tuple ( Fn  fn,
Tup &&  tup 
)
120{
121 auto mpfn = [&fn](auto&...pack) {
122 for_each_argument(fn, pack...);
123 };
124
125 std::apply(mpfn, tup);
126
127 return fn;
128}
Fn for_each_argument(Fn &&fn, Args &&...args)
Definition NLoptOptimizer.hpp:109

References for_each_argument().

Referenced by Slic3r::opt::detail::NLoptOpt< M, class >::optimize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ num_iter()

template<size_t N>
long Slic3r::opt::detail::num_iter ( const std::array< size_t, N > &  idx,
size_t  gridsz 
)
14{
15 long ret = 0;
16 for (size_t i = 0; i < N; ++i)
17 ret += idx[i] * std::pow(gridsz, i);
18
19 return ret;
20}

Referenced by Slic3r::opt::detail::AlgBurteForce::run().

+ Here is the caller graph for this function:

◆ to_arr() [1/2]

template<size_t N, class T >
auto Slic3r::opt::detail::to_arr ( const T *  a)
178{
179 std::array<T, N> r;
180 std::copy(a, a + N, std::begin(r));
181 return r;
182}

Referenced by Slic3r::opt::bounds(), Slic3r::opt::initvals(), and Slic3r::opt::score_gradient().

+ Here is the caller graph for this function:

◆ to_arr() [2/2]

template<size_t N, class T >
auto Slic3r::opt::detail::to_arr ( const T(&)  a[N])
185{
186 return to_arr<N>(static_cast<const T *>(a));
187}

◆ wrap_tup()

template<template< class > class W, class... Args>
auto Slic3r::opt::detail::wrap_tup ( const std::tuple< Args... > &  tup)
135{
136 return std::tuple<W<Args>...>(tup);
137}

Variable Documentation

◆ GetNLoptAlg_Global

template<class M >
constexpr nlopt_algorithm Slic3r::opt::detail::GetNLoptAlg_Global = GetNLoptAlg_<remove_cvref_t<M>>::Global
constexpr

◆ GetNLoptAlg_Local

template<class M >
constexpr nlopt_algorithm Slic3r::opt::detail::GetNLoptAlg_Local = GetNLoptAlg_<remove_cvref_t<M>>::Local
constexpr

◆ IsAUGLAG

template<class M >
constexpr bool Slic3r::opt::detail::IsAUGLAG = GetNLoptAlg_<remove_cvref_t<M>>::IsAUGLAG
constexpr