6 #include "GeoGenericFunctions/Rectangular.h" 7 #include "GeoGenericFunctions/FixedConstant.h" 11 FUNCTION_OBJECT_IMP(Rectangular)
13 Rectangular::Rectangular():
14 _x0("x0", -1.0, -10, 0),
15 _x1("x1", 1.0, 0, 10),
16 _baseline("baseline", 0,-10, 10),
17 _height("height",1, -10, 10)
20 Rectangular::Rectangular(
const Rectangular & right) :
24 _baseline(right._baseline),
25 _height(right._height)
29 Rectangular::~Rectangular() {
32 double Rectangular::operator() (
double x)
const {
33 if (x<_x0.getValue()) {
34 return _baseline.getValue();
36 else if (x<_x1.getValue()) {
37 return _height.getValue();
40 return _baseline.getValue();
44 Parameter & Rectangular::x0() {
48 Parameter & Rectangular::x1() {
52 Parameter & Rectangular::baseline() {
56 Parameter & Rectangular::height() {
60 const Parameter & Rectangular::x0()
const {
64 const Parameter & Rectangular::x1()
const {
68 const Parameter & Rectangular::baseline()
const {
72 const Parameter & Rectangular::height()
const{
78 #if __GNUC__ > 3 && __GNUC_MINOR__ > 6 79 #pragma GCC diagnostic push 80 #pragma GCC diagnostic ignored "-Wunused-parameter" 84 #pragma clang diagnostic push 85 #pragma clang diagnostic ignored "-Wunused-parameter" 87 Derivative Rectangular::partial(
unsigned int index)
const {
89 const AbsFunction & fPrime = FixedConstant(0);;
90 return Derivative(&fPrime);
93 #if __GNUC__ > 3 && __GNUC_MINOR__ > 6 94 #pragma GCC diagnostic pop 98 #pragma clang diagnostic pop