EllAlgo 1.6.13
Loading...
Searching...
No Matches
ell_stable.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <valarray>
9
10#include "ell_base.hpp"
11
24template <typename Arr> class EllStable : public EllBase<Arr, true> {
26
27 public:
28 using Vec = std::valarray<double>;
29 using ArrayType = Arr;
30
38 static auto from_radii(const Vec& val, Arr x) -> EllStable {
39 return EllStable(val, std::move(x));
40 }
41
49 static auto from_alpha(const double alpha, Arr x) -> EllStable {
50 return EllStable(alpha, std::move(x));
51 }
52
54 EllStable(const Vec& val, Arr x) : Base(val, std::move(x)) {}
55
57 EllStable(const double alpha, Arr x) : Base(alpha, std::move(x)) {}
58
60 EllStable(EllStable&& E) noexcept = default;
61
64
67
70
73
79 auto copy() const -> EllStable { return EllStable(*this); }
80}; // } EllStable
1D or 2D array backed by std::vector<double> for small optimization problems
Definition arr.hpp:23
Ellipsoid Search Space (shared base)
Definition ell_base.hpp:49
Ellipsoid Search Space (stable strategy)
Definition ell_stable.hpp:24
EllStable(const double alpha, Arr x)
Construct from a scaling factor and a center point (moved in).
Definition ell_stable.hpp:57
auto copy() const -> EllStable
Explicitly copy the EllStable object.
Definition ell_stable.hpp:79
static auto from_alpha(const double alpha, Arr x) -> EllStable
Named constructor: initial ellipsoid from a scaling factor.
Definition ell_stable.hpp:49
std::valarray< double > Vec
Definition ell_stable.hpp:28
static auto from_radii(const Vec &val, Arr x) -> EllStable
Named constructor: initial ellipsoid from per-axis radii.
Definition ell_stable.hpp:38
auto operator=(EllStable &&) noexcept -> EllStable &=default
Move assignment operator.
EllStable(EllStable &&E) noexcept=default
Move constructor.
EllStable(const Vec &val, Arr x)
Construct from a diagonal vector and a center point (moved in).
Definition ell_stable.hpp:54
auto invalid_value() -> T
Return an invalid/sentinel value for type T.
Definition cutting_plane.hpp:27
Shared ellipsoid search space base (compile-time Strategy)