Square root of x.  
 More...
#include <JMathlib.hh>
 | 
|   | JSqrt () | 
|   | Default constructor.  
  | 
|   | 
| double  | getValue (const double x) const | 
|   | Function value.  
  | 
|   | 
| double  | getDerivative (const double x) const | 
|   | Derivative value.  
  | 
|   | 
| const JSqrt &  | getGradient (const double x) const | 
|   | Get gradient.  
  | 
|   | 
| double  | operator() (const Args &...args) const | 
|   | Function value.  
  | 
|   | 
| JSqrt< _vF > &  | negate () | 
|   | Negate function.  
  | 
|   | 
| JSqrt< _vF > &  | add (const JSqrt< _vF > &f1) | 
|   | Add function.  
  | 
|   | 
| JSqrt< _vF > &  | sub (const JSqrt< _vF > &f1) | 
|   | Subtract function.  
  | 
|   | 
| JSqrt< _vF > &  | mul (const double factor) | 
|   | Scale function.  
  | 
|   | 
| JSqrt< _vF > &  | div (const double factor) | 
|   | Scale function.  
  | 
|   | 
Square root of x. 
Definition at line 2146 of file JMathlib.hh.
 
◆ JSqrt()
◆ getValue()
  
  
      
        
          | double JMATH::JSqrt< _vF >::getValue  | 
          ( | 
          const double |           x | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Function value. 
- Parameters
 - 
  
  
 
- Returns
 - function value 
 
Definition at line 2166 of file JMathlib.hh.
 2167    {
 2168      return sqrt(x);
 2169    }
 
 
 
◆ getDerivative()
  
  
      
        
          | double JMATH::JSqrt< _vF >::getDerivative  | 
          ( | 
          const double |           x | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Derivative value. 
- Parameters
 - 
  
  
 
- Returns
 - derivative value 
 
Definition at line 2178 of file JMathlib.hh.
 2179    {
 2180      return 0.5 / sqrt(x);
 2181    }
 
 
 
◆ getGradient()
Get gradient. 
- Parameters
 - 
  
  
 
- Returns
 - gradient 
 
Definition at line 2190 of file JMathlib.hh.
 2191    {
 2192      static JSqrt gradient;
 
 2193 
 2194      return gradient;
 2195    }
JSqrt()
Default constructor.
 
 
 
 
◆ operator()()
Function value. 
- Parameters
 - 
  
  
 
- Returns
 - function value 
 
Definition at line 362 of file JMathlib.hh.
  363    {
  364      return static_cast<const JF1_t&
>(*this).getValue(
args...);
 
  365    }
 
 
 
◆ negate()
Negate function. 
- Returns
 - this function 
 
Definition at line 203 of file JMathlib.hh.
  204    {
  205      for (const auto& i : JF1_t::parameters) {
  206        static_cast<JF1_t&>(*this).*i = -(static_cast<JF1_t&>(*this).*i);
  207      }
  208 
  209      return static_cast<JF1_t&>(*this);
  210    }
 
 
 
◆ add()
Add function. 
- Parameters
 - 
  
  
 
- Returns
 - this function 
 
Definition at line 219 of file JMathlib.hh.
  220    {
  221      for (const auto& i : JF1_t::parameters) {
  222        static_cast<JF1_t&
>(*this).*i += 
f1.*i;
 
  223      }
  224 
  225      return static_cast<JF1_t&>(*this);
  226    }
const JPolynome f1(1.0, 2.0, 3.0)
Function.
 
 
 
 
◆ sub()
Subtract function. 
- Parameters
 - 
  
  
 
- Returns
 - this function 
 
Definition at line 235 of file JMathlib.hh.
  236    {
  237      for (const auto& i : JF1_t::parameters) {
  238        static_cast<JF1_t&
>(*this).*i -= 
f1.*i;
 
  239      }
  240 
  241      return static_cast<JF1_t&>(*this);
  242    }
 
 
 
◆ mul()
Scale function. 
- Parameters
 - 
  
  
 
- Returns
 - this function 
 
Definition at line 251 of file JMathlib.hh.
  252    {
  253      for (const auto& i : JF1_t::parameters) {
  254        static_cast<JF1_t&>(*this).*i *= factor;
  255      }
  256 
  257      return static_cast<JF1_t&>(*this);
  258    }
 
 
 
◆ div()
Scale function. 
- Parameters
 - 
  
  
 
- Returns
 - this function 
 
Definition at line 267 of file JMathlib.hh.
  268    {
  269      for (const auto& i : JF1_t::parameters) {
  270        static_cast<JF1_t&>(*this).*i /= factor;
  271      }
  272 
  273      return static_cast<JF1_t&>(*this);
  274    }
 
 
 
◆ parameters
The documentation for this struct was generated from the following file: