NumCpp  2.14.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Iteration.hpp
Go to the documentation of this file.
1
33#pragma once
34
35#include <functional>
36
38#include "NumCpp/Core/Types.hpp"
39
40namespace nc::roots
41{
42 //================================================================================
43 // Class Description:
46 {
47 public:
48 //============================================================================
49 // Method Description:
54 explicit Iteration(double epsilon) noexcept :
55 epsilon_(epsilon)
56 {
57 }
58
59 //============================================================================
60 // Method Description:
71
72 //============================================================================
73 // Method Description:
77
78 //============================================================================
79 // Method Description:
88
89 protected:
90 //============================================================================
91 // Method Description:
98
99 //============================================================================
100 // Method Description:
104 {
107 {
109 "Maximum number of iterations has been reached; no root has been found within epsilon.");
110 }
111 }
112
113 //====================================Attributes==============================
114 const double epsilon_;
117 };
118} // namespace nc::roots
#define THROW_RUNTIME_ERROR(msg)
Definition Error.hpp:40
ABC for iteration classes to derive from.
Definition Iteration.hpp:46
Iteration(double epsilon) noexcept
Definition Iteration.hpp:54
virtual ~Iteration() noexcept=default
const double epsilon_
Definition Iteration.hpp:114
Iteration(double epsilon, uint32 maxNumIterations) noexcept
Definition Iteration.hpp:66
uint32 numIterations_
Definition Iteration.hpp:116
void resetNumberOfIterations() noexcept
Definition Iteration.hpp:94
uint32 maxNumIterations_
Definition Iteration.hpp:115
uint32 numIterations() const noexcept
Definition Iteration.hpp:84
void incrementNumberOfIterations()
Definition Iteration.hpp:103
Definition Bisection.hpp:43
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59
std::uint32_t uint32
Definition Types.hpp:40