Skip to content
Snippets Groups Projects
Commit 8f2912a5 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Cleanup

parent ec6b597a
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,8 @@ int main() { ...@@ -42,6 +42,8 @@ int main() {
M[0][0] += 2; M[0][0] += 2;
M[1][1] += 2; M[1][1] += 2;
double ret1;
{
Functional::SmallVector start = b; Functional::SmallVector start = b;
start *= 17; start *= 17;
...@@ -52,15 +54,26 @@ int main() { ...@@ -52,15 +54,26 @@ int main() {
J.descentDirection(start, numerical_descent); J.descentDirection(start, numerical_descent);
assert(two_distance<dim>(numerical_descent, analytic_descent) < 1e-10); assert(two_distance<dim>(numerical_descent, analytic_descent) < 1e-10);
double const ret1 = functionTester(J, start, 6); ret1 = functionTester(J, start, 6);
assert(two_distance<dim>(start, solution) < 1e-6); assert(two_distance<dim>(start, solution) < 1e-6);
}
double ret2;
{
// Something random // Something random
Functional::SmallVector start;
start[0] = 279; start[0] = 279;
start[1] = -96; start[1] = -96;
double const ret2 = functionTester(J, start, 15); Functional::SmallVector analytic_descent = b;
assert(two_distance<dim>(start, solution) < 1e-6); M.mmv(start, analytic_descent);
Functional::SmallVector numerical_descent;
J.descentDirection(start, numerical_descent);
assert(two_distance<dim>(numerical_descent, analytic_descent) < 1e-10);
ret2 = functionTester(J, start, 15);
assert(two_distance<dim>(start, solution) < 1e-6);
}
assert(std::abs(ret1 - ret2) < 1e-11); assert(std::abs(ret1 - ret2) < 1e-11);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment