Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
be5c480b
Commit
be5c480b
authored
May 24, 2013
by
Steve Taylor
Browse files
Made changes to the tolerance stopping criteria in impl_adapt_simp_stop.
parent
e032a77e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
dlib/numerical_integration/integrate_function_adapt_simpson.h
.../numerical_integration/integrate_function_adapt_simpson.h
+3
-3
No files found.
dlib/numerical_integration/integrate_function_adapt_simpson.h
View file @
be5c480b
...
@@ -18,7 +18,7 @@ T impl_adapt_simp_stop(const funct& f, T a, T b, T fa, T fm, T fb, T is, int cnt
...
@@ -18,7 +18,7 @@ T impl_adapt_simp_stop(const funct& f, T a, T b, T fa, T fm, T fb, T is, int cnt
i1
=
(
16.0
*
i2
-
i1
)
/
15.0
;
i1
=
(
16.0
*
i2
-
i1
)
/
15.0
;
T
Q
=
0
;
T
Q
=
0
;
if
((
std
::
abs
(
i1
-
i2
)
<=
std
::
numeric_limits
<
double
>::
epsilon
(
))
||
(
m
<=
a
)
||
(
b
<=
m
))
if
((
std
::
abs
(
i1
-
i2
)
<=
std
::
abs
(
is
))
||
(
m
<=
a
)
||
(
b
<=
m
))
{
{
Q
=
i1
;
Q
=
i1
;
}
}
...
@@ -36,7 +36,7 @@ T impl_adapt_simp_stop(const funct& f, T a, T b, T fa, T fm, T fb, T is, int cnt
...
@@ -36,7 +36,7 @@ T impl_adapt_simp_stop(const funct& f, T a, T b, T fa, T fm, T fb, T is, int cnt
}
}
template
<
typename
T
,
typename
funct
>
template
<
typename
T
,
typename
funct
>
T
integrate_function_adapt_simp
(
const
funct
&
f
,
T
a
,
T
b
,
T
tol
=
1e-10
)
T
integrate_function_adapt_simp
(
const
funct
&
f
,
T
a
,
T
b
,
T
tol
)
{
{
T
eps
=
std
::
numeric_limits
<
double
>::
epsilon
();
T
eps
=
std
::
numeric_limits
<
double
>::
epsilon
();
...
@@ -58,7 +58,7 @@ T integrate_function_adapt_simp(const funct& f, T a, T b, T tol = 1e-10)
...
@@ -58,7 +58,7 @@ T integrate_function_adapt_simp(const funct& f, T a, T b, T tol = 1e-10)
is
=
b
-
a
;
is
=
b
-
a
;
}
}
is
=
is
*
tol
/
eps
;
is
=
is
*
tol
;
int
cnt
=
0
;
int
cnt
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment