EllAlgo 1.6.13
Loading...
Searching...
No Matches
ell1d.hpp
Go to the documentation of this file.
1
6// -*- coding: utf-8 -*-
7#pragma once
8
9#include <utility> // for std::pair
10
11// forward declaration
12enum class CutStatus;
13
18class ell1d {
19 public:
21
22 // Rule of Five: explicitly default special member functions
23 ~ell1d() = default;
24 ell1d& operator=(const ell1d&) = default;
27
28 private:
29 double _r;
30 double _xc;
31 double _tsq = 0.0;
32
33 public:
40 ell1d(const double l, const double u) noexcept : _r{(u - l) / 2}, _xc{l + _r} {}
41
47 explicit ell1d(const ell1d& E) = default;
48
54 auto xc() const noexcept -> double { return _xc; }
55
61 auto set_xc(const double xc) noexcept -> void { _xc = xc; }
62
68 constexpr auto tsq() const -> double { return this->_tsq; }
69
80 auto update(const std::pair<double, double>& cut) noexcept -> CutStatus;
81
92 auto update_central_cut(const std::pair<double, double>& cut) noexcept -> CutStatus;
93}; // } ell1d
Ellipsoid Method for special 1D case.
Definition ell1d.hpp:18
ell1d(ell1d &&) noexcept=default
double ArrayType
Definition ell1d.hpp:20
auto update_central_cut(const std::pair< double, double > &cut) noexcept -> CutStatus
Update the 1D ellipsoid using a central cut.
auto xc() const noexcept -> double
Get the center of the ellipsoid.
Definition ell1d.hpp:54
ell1d & operator=(const ell1d &)=default
auto set_xc(const double xc) noexcept -> void
Set the xc object.
Definition ell1d.hpp:61
ell1d(const ell1d &E)=default
Construct a new ell1d object.
auto update(const std::pair< double, double > &cut) noexcept -> CutStatus
Update the 1D ellipsoid using a deep cut.
constexpr auto tsq() const -> double
Get the squared radius of the ellipsoid.
Definition ell1d.hpp:68
~ell1d()=default
auto invalid_value() -> T
Return an invalid/sentinel value for type T.
Definition cutting_plane.hpp:27
CutStatus
Status of cutting plane operations.
Definition ell_config.hpp:47