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

Fix domain of CircularConvexFunction

For a single-step bisection we need [-2pi,+2pi]
parent 761d41d5
No related branches found
No related tags found
No related merge requests found
......@@ -42,8 +42,8 @@ template <class NonlinearityType> class CircularConvexFunction {
}
void domain(Interval<double> &domain) const {
domain[0] = -M_PI;
domain[1] = M_PI;
domain[0] = -2 * M_PI;
domain[1] = 2 * M_PI;
}
void cartesian(double m, VectorType &y) const {
......
......@@ -57,19 +57,16 @@ int main() {
}
double const intervals = 10000;
double const iterations = 2;
for (size_t i = 0; i < intervals; ++i) {
double alpha = i / (double)intervals * 2 * M_PI;
SmallVector x;
x[0] = scale * std::sin(alpha);
x[1] = scale * std::cos(alpha);
SmallVector descDir;
for (int i = 0; i < iterations; ++i) {
descDir[0] = x[1];
descDir[1] = -x[0];
tangentialMinimisation(J, x, descDir, bisection);
}
SmallVector descDir;
descDir[0] = x[1];
descDir[1] = -x[0];
tangentialMinimisation(J, x, descDir, bisection);
bool minimum_hit(false);
for (auto const &minimum : minima) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment