numerical-collection-cpp
0.10.0
A collection of algorithms in numerical analysis implemented in C++
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
w
Variables
a
b
c
d
f
g
h
i
m
n
o
p
r
s
t
w
z
Typedefs
a
c
d
e
g
i
l
n
r
s
t
v
Enumerations
Enumerator
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
v
w
Enumerations
Enumerator
Files
File List
File Members
All
Macros
▼
numerical-collection-cpp
Documentation
Repositories
Installation
►
How to Build in the Repository
Profiling
License
Todo List
Bibliography
►
Namespaces
►
Concepts
►
Classes
▼
Files
▼
File List
►
doc
►
include
▼
problems
►
doc
▼
include
▼
num_prob_collect
►
linear
►
ode
►
opt
►
regularization
▼
roots
►
cubic_root_test_function.h
►
double_cubic_test_function.h
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
Concepts
Loading...
Searching...
No Matches
cubic_root_test_function.h
Go to the documentation of this file.
1
/*
2
* Copyright 2021 MusicScience37 (Kenta Kabashima)
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
20
#pragma once
21
22
namespace
num_prob_collect::roots
{
23
27
class
cubic_root_test_function
{
28
public
:
30
using
variable_type
= double;
31
33
using
jacobian_type
= double;
34
40
explicit
cubic_root_test_function
(
variable_type
target) :
target_
(target) {}
41
47
void
evaluate_on
(
const
variable_type
& variable) {
48
value_
= variable * variable * variable -
target_
;
49
jacobian_
= 3.0 * variable * variable;
// NOLINT
50
}
47
void
evaluate_on
(
const
variable_type
& variable) {
…
}
51
57
[[nodiscard]]
auto
value
() const noexcept -> const
variable_type
& {
58
return
value_
;
59
}
57
[[nodiscard]]
auto
value
() const noexcept -> const
variable_type
& {
…
}
60
66
[[nodiscard]]
auto
jacobian
() const noexcept -> const
jacobian_type
& {
67
return
jacobian_
;
68
}
66
[[nodiscard]]
auto
jacobian
() const noexcept -> const
jacobian_type
& {
…
}
69
70
private
:
72
variable_type
target_
;
73
75
variable_type
value_
{};
76
78
jacobian_type
jacobian_
{};
79
};
27
class
cubic_root_test_function
{
…
};
80
81
}
// namespace num_prob_collect::roots
num_prob_collect::roots::cubic_root_test_function::evaluate_on
void evaluate_on(const variable_type &variable)
Evaluate on a variable.
Definition
cubic_root_test_function.h:47
num_prob_collect::roots::cubic_root_test_function::jacobian_
jacobian_type jacobian_
Jacobian matrix.
Definition
cubic_root_test_function.h:78
num_prob_collect::roots::cubic_root_test_function::variable_type
double variable_type
Type of variables.
Definition
cubic_root_test_function.h:30
num_prob_collect::roots::cubic_root_test_function::cubic_root_test_function
cubic_root_test_function(variable_type target)
Constructor.
Definition
cubic_root_test_function.h:40
num_prob_collect::roots::cubic_root_test_function::jacobian_type
double jacobian_type
Type of Jacobian.
Definition
cubic_root_test_function.h:33
num_prob_collect::roots::cubic_root_test_function::value_
variable_type value_
Function value.
Definition
cubic_root_test_function.h:75
num_prob_collect::roots::cubic_root_test_function::target_
variable_type target_
Value to calculate cubic root of.
Definition
cubic_root_test_function.h:72
num_prob_collect::roots::cubic_root_test_function::jacobian
auto jacobian() const noexcept -> const jacobian_type &
Get Jacobian matrix.
Definition
cubic_root_test_function.h:66
num_prob_collect::roots::cubic_root_test_function::value
auto value() const noexcept -> const variable_type &
Get function value.
Definition
cubic_root_test_function.h:57
num_prob_collect::roots
Namespace of root-finding problems.
Definition
namespaces.h:31
problems
include
num_prob_collect
roots
cubic_root_test_function.h
Generated on Fri Apr 4 2025 06:22:58 for numerical-collection-cpp by
1.13.2