Optimist  0.0.0
A C++ library for optimization
Loading...
Searching...
No Matches
Sinh.hh
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 * Copyright (c) 2025, Davide Stocco, Mattia Piazza and Enrico Bertolazzi. *
3 * *
4 * The Optimist project is distributed under the BSD 2-Clause License. *
5 * *
6 * Davide Stocco Mattia Piazza Enrico Bertolazzi *
7 * University of Trento University of Trento University of Trento *
8 * davide.stocco@unitn.it mattia.piazza@unitn.it enrico.bertolazzi@unitn.it *
9\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
10
11#pragma once
12
13#ifndef OPTIMIST_SCALAR_FUNCTION_SINH_HH
14#define OPTIMIST_SCALAR_FUNCTION_SINH_HH
15
16#include "Optimist/TestSet.hh"
18
19namespace Optimist
20{
21
22 namespace TestSet
23 {
24
36 template <typename Real>
37 class Sinh : public ScalarFunction<Real, Sinh<Real>>
38 {
39 public:
41
42
46 {
47 this->m_solutions.emplace_back(0.0); // Zero
48 this->m_guesses.emplace_back(-10.0);
49 this->m_guesses.emplace_back(10.0);
50 }
51
56 std::string name_impl() const {return "Sinh";}
57
63 void evaluate_impl(Real x, Real & out) const {out = std::sinh(x);}
64
70 void first_derivative_impl(Real x, Real & out) const {out = std::cosh(x);}
71
77 void second_derivative_impl(Real x, Real & out) const {out = std::sinh(x);}
78
79 }; // class Sinh
80
81 } // namespace TestSet
82
83} // namespace Optimist
84
85#endif // OPTIMIST_SCALAR_FUNCTION_SINH_HH
#define OPTIMIST_BASIC_CONSTANTS(Real)
Definition Optimist.hh:70
std::vector< InputType > m_solutions
Definition Function.hh:52
std::vector< InputType > m_guesses
Definition Function.hh:53
ScalarFunction()
Definition ScalarFunction.hh:38
void first_derivative_impl(Real x, Real &out) const
Definition Sinh.hh:70
void evaluate_impl(Real x, Real &out) const
Definition Sinh.hh:63
void second_derivative_impl(Real x, Real &out) const
Definition Sinh.hh:77
std::string name_impl() const
Definition Sinh.hh:56
Sinh()
Definition Sinh.hh:45
Namespace for the Optimist library.
Definition Optimist.hh:87