static_sin_r2.cpp 742 Bytes
Newer Older
1
2
3
4
5
//
// Created by Dmitri Bagaev on 2019-03-29.
//

#include "static_sin_r2.h"
6
7

#include <cmath>
8
9
10
#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795
#endif
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

double StaticSinR2::invoke(double x, double y, int iteration) const noexcept {
    return -1.0 * std::sin(x) * std::cos(y) + 1.0;
}

double StaticSinR2::GetMinimumValue(int iteration) const noexcept {
    return 0;
}

std::pair<double, double> StaticSinR2::GetMinimumPoint(int iteration) const noexcept {
    return std::make_pair(M_PI / 2.0, 0);
}

std::pair<double, double> StaticSinR2::GetXRange() const noexcept {
    return std::make_pair(0, M_PI);
}

std::pair<double, double> StaticSinR2::GetYRange() const noexcept {
    return std::make_pair(-M_PI / 2.0, M_PI / 2.0);
}