GeoModel - GeoModelCore
Theta.cpp
1 //==========================================================================//
2 // Imported from the QAT library (qat.pitt.edu) by the copyright holder //
3 // Joe Boudreau. Software licensed under the terms and conditions of the //
4 // GNU Lesser Public License v3. //
5 //==========================================================================//
6 #include "GeoGenericFunctions/Theta.h"
7 #include "GeoGenericFunctions/FixedConstant.h"
8 #include <stdexcept>
9 namespace GeoGenfun {
10 FUNCTION_OBJECT_IMP(Theta)
11 
12 Theta::Theta()
13 {}
14 
15 Theta::~Theta() {
16 }
17 
18 Theta::Theta(const Theta & right) : AbsFunction(right)
19 { }
20 
21 
22 double Theta::operator() (double x) const {
23  return (x>=0) ? 1.0:0.0;
24 }
25 
26 
27 
28 Derivative Theta::partial(unsigned int index) const {
29  if (index!=0) throw std::runtime_error("Theta::Partial: index out of range");
30  const AbsFunction & fPrime = FixedConstant(0.0);
31  return Derivative(& fPrime);
32 }
33 
34 } // namespace GeoGenfun
Definition: Abs.h:15