Jpp  15.0.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
JTOOLS::JConstantFunction1D< JArgument_t, JResult_t > Class Template Reference

Template implementation of function object in one dimension returning a constant value. More...

#include <JConstantFunction1D.hh>

Inheritance diagram for JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >:
JTOOLS::JFunction1D< JArgument_t, JResult_t > JTOOLS::JFunction< JArgument_t, JResult_t > JTOOLS::JFunctional< JArgument_t, JResult_t >

Public Types

typedef JFunction1D
< JArgument_t, JResult_t > 
function_type
 
typedef
function_type::argument_type 
argument_type
 
typedef function_type::result_type result_type
 
enum  { NUMBER_OF_DIMENSIONS = 1 }
 
typedef JFunctional
< JArgument_t, JResult_t > 
functional_type
 
typedef JSupervisor supervisor_type
 

Public Member Functions

 JConstantFunction1D ()
 Default constructor. More...
 
 JConstantFunction1D (const result_type y)
 Constructor. More...
 
 JConstantFunction1D (const JMATH::JZero &y)
 Constructor. More...
 
JConstantFunction1Dadd (typename JLANG::JClass< result_type >::argument_type value)
 Add offset. More...
 
JConstantFunction1Dsub (typename JLANG::JClass< result_type >::argument_type value)
 Subtract offset. More...
 
JConstantFunction1Dmul (const double value)
 Scale contents. More...
 
JConstantFunction1Ddiv (const double value)
 Scale contents. More...
 
JConstantFunction1Dadd (const JConstantFunction1D &function)
 Add function. More...
 
JConstantFunction1Dsub (const JConstantFunction1D &function)
 Subtract function. More...
 
result_type getY () const
 Function value. More...
 
virtual result_type evaluate (const argument_type *pX) const override
 Function value evaluation. More...
 
result_type operator() (const argument_type x) const
 Function value evaluation. More...
 
JSupervisor getSupervisor () const
 Get supervisor. More...
 
const JExceptionHandlergetExceptionHandler () const
 Get exception handler. More...
 
void setExceptionHandler (const JSupervisor &supervisor)
 Set the supervisor for handling of exceptions. More...
 

Static Public Member Functions

static result_type getValue (const JFunctional &function, const argument_type *pX)
 Recursive function value evaluation. More...
 
static JClass< result_type >
::argument_type 
getValue (typename JClass< result_type >::argument_type value, const argument_type *pX)
 Termination of recursive function value evaluation. More...
 

Protected Member Functions

virtual void do_compile () override
 Function compilation. More...
 

Protected Attributes

JSupervisor supervisor
 

Private Attributes

result_type __y
 

Friends

JReaderoperator>> (JReader &in, JConstantFunction1D &function)
 Read function from input. More...
 
JWriteroperator<< (JWriter &out, const JConstantFunction1D &function)
 Write function to output. More...
 

Detailed Description

template<class JArgument_t, class JResult_t>
class JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >

Template implementation of function object in one dimension returning a constant value.

This class implements the JFunction1D interface.

Definition at line 26 of file JConstantFunction1D.hh.

Member Typedef Documentation

template<class JArgument_t, class JResult_t>
typedef JFunction1D<JArgument_t, JResult_t> JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::function_type

Definition at line 31 of file JConstantFunction1D.hh.

template<class JArgument_t, class JResult_t>
typedef function_type::argument_type JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::argument_type

Definition at line 32 of file JConstantFunction1D.hh.

template<class JArgument_t, class JResult_t>
typedef function_type::result_type JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::result_type

Definition at line 33 of file JConstantFunction1D.hh.

template<class JArgument_t, class JResult_t>
typedef JFunctional<JArgument_t, JResult_t> JTOOLS::JFunction1D< JArgument_t, JResult_t >::functional_type
inherited

Definition at line 322 of file JFunctional.hh.

template<class JArgument_t = JNullType, class JResult_t = JNullType>
typedef JSupervisor JTOOLS::JFunctional< JArgument_t, JResult_t >::supervisor_type
inherited

Definition at line 89 of file JFunctional.hh.

Member Enumeration Documentation

template<class JArgument_t, class JResult_t>
anonymous enum
inherited
Enumerator
NUMBER_OF_DIMENSIONS 

Definition at line 320 of file JFunctional.hh.

Constructor & Destructor Documentation

template<class JArgument_t, class JResult_t>
JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::JConstantFunction1D ( )
inline

Default constructor.

Definition at line 39 of file JConstantFunction1D.hh.

39  :
40  function_type(),
41  __y()
42  {}
JFunction1D< JArgument_t, JResult_t > function_type
template<class JArgument_t, class JResult_t>
JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::JConstantFunction1D ( const result_type  y)
inline

Constructor.

Parameters
yvalue

Definition at line 50 of file JConstantFunction1D.hh.

50  :
51  function_type(),
52  __y(y)
53  {}
JFunction1D< JArgument_t, JResult_t > function_type
template<class JArgument_t, class JResult_t>
JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::JConstantFunction1D ( const JMATH::JZero y)
inline

Constructor.

Parameters
yzero

Definition at line 61 of file JConstantFunction1D.hh.

61  :
62  function_type(),
63  __y(y)
64  {}
JFunction1D< JArgument_t, JResult_t > function_type

Member Function Documentation

template<class JArgument_t, class JResult_t>
JConstantFunction1D& JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::add ( typename JLANG::JClass< result_type >::argument_type  value)
inline

Add offset.

Parameters
valueoffset

Definition at line 72 of file JConstantFunction1D.hh.

73  {
74  __y += value;
75 
76  return *this;
77  }
template<class JArgument_t, class JResult_t>
JConstantFunction1D& JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::sub ( typename JLANG::JClass< result_type >::argument_type  value)
inline

Subtract offset.

Parameters
valueoffset

Definition at line 85 of file JConstantFunction1D.hh.

86  {
87  __y -= value;
88 
89  return *this;
90  }
template<class JArgument_t, class JResult_t>
JConstantFunction1D& JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::mul ( const double  value)
inline

Scale contents.

Parameters
valuemultiplication factor

Definition at line 98 of file JConstantFunction1D.hh.

99  {
100  __y *= value;
101 
102  return *this;
103  }
template<class JArgument_t, class JResult_t>
JConstantFunction1D& JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::div ( const double  value)
inline

Scale contents.

Parameters
valuedivision factor

Definition at line 111 of file JConstantFunction1D.hh.

112  {
113  __y /= value;
114 
115  return *this;
116  }
template<class JArgument_t, class JResult_t>
JConstantFunction1D& JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::add ( const JConstantFunction1D< JArgument_t, JResult_t > &  function)
inline

Add function.

Parameters
functionfunction

Definition at line 124 of file JConstantFunction1D.hh.

125  {
126  __y += function.getY();
127 
128  return *this;
129  }
template<class JArgument_t, class JResult_t>
JConstantFunction1D& JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::sub ( const JConstantFunction1D< JArgument_t, JResult_t > &  function)
inline

Subtract function.

Parameters
functionfunction

Definition at line 137 of file JConstantFunction1D.hh.

138  {
139  __y -= function.getY();
140 
141  return *this;
142  }
template<class JArgument_t, class JResult_t>
result_type JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::getY ( ) const
inline

Function value.

Returns
function value

Definition at line 150 of file JConstantFunction1D.hh.

151  {
152  return __y;
153  }
template<class JArgument_t, class JResult_t>
virtual result_type JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::evaluate ( const argument_type pX) const
inlineoverridevirtual

Function value evaluation.

Parameters
pXpointer to abscissa values
Returns
function value

Implements JTOOLS::JFunctional< JArgument_t, JResult_t >.

Definition at line 162 of file JConstantFunction1D.hh.

163  {
164  return __y;
165  }
template<class JArgument_t, class JResult_t>
virtual void JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::do_compile ( )
inlineoverrideprotectedvirtual

Function compilation.

Definition at line 198 of file JConstantFunction1D.hh.

199  {}
template<class JArgument_t, class JResult_t>
result_type JTOOLS::JFunction1D< JArgument_t, JResult_t >::operator() ( const argument_type  x) const
inlineinherited

Function value evaluation.

Parameters
xargument value
Returns
function value

Definition at line 333 of file JFunctional.hh.

334  {
335  return this->evaluate(&x);
336  }
virtual result_type evaluate(const argument_type *pX) const =0
Recursive function value evaluation.
template<class JArgument_t = JNullType, class JResult_t = JNullType>
static result_type JTOOLS::JFunctional< JArgument_t, JResult_t >::getValue ( const JFunctional< JArgument_t, JResult_t > &  function,
const argument_type pX 
)
inlinestaticinherited

Recursive function value evaluation.

Parameters
functionfunction
pXpointer to abscissa values

Definition at line 107 of file JFunctional.hh.

109  {
110  return function.evaluate(pX);
111  }
template<class JArgument_t = JNullType, class JResult_t = JNullType>
static JClass<result_type>::argument_type JTOOLS::JFunctional< JArgument_t, JResult_t >::getValue ( typename JClass< result_type >::argument_type  value,
const argument_type pX 
)
inlinestaticinherited

Termination of recursive function value evaluation.

Parameters
valueresult
pXpointer to abscissa values

Definition at line 121 of file JFunctional.hh.

123  {
124  return value;
125  }
template<class JArgument_t = JNullType, class JResult_t = JNullType>
JSupervisor JTOOLS::JFunctional< JArgument_t, JResult_t >::getSupervisor ( ) const
inlineinherited

Get supervisor.

Returns
supervisor

Definition at line 266 of file JFunctional.hh.

267  {
268  return supervisor;
269  }
JSupervisor supervisor
Definition: JFunctional.hh:295
template<class JArgument_t = JNullType, class JResult_t = JNullType>
const JExceptionHandler& JTOOLS::JFunctional< JArgument_t, JResult_t >::getExceptionHandler ( ) const
inlineinherited

Get exception handler.

Returns
exception handler

Definition at line 277 of file JFunctional.hh.

278  {
279  return *supervisor;
280  }
JSupervisor supervisor
Definition: JFunctional.hh:295
template<class JArgument_t = JNullType, class JResult_t = JNullType>
void JTOOLS::JFunctional< JArgument_t, JResult_t >::setExceptionHandler ( const JSupervisor supervisor)
inlineinherited

Set the supervisor for handling of exceptions.

Parameters
supervisorsupervisor

Definition at line 288 of file JFunctional.hh.

289  {
290  this->supervisor = supervisor;
291  }
JSupervisor supervisor
Definition: JFunctional.hh:295

Friends And Related Function Documentation

template<class JArgument_t, class JResult_t>
JReader& operator>> ( JReader in,
JConstantFunction1D< JArgument_t, JResult_t > &  function 
)
friend

Read function from input.

Parameters
inreader
functionfunction
Returns
reader

Definition at line 175 of file JConstantFunction1D.hh.

176  {
177  return in >> function.__y;
178  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:41
template<class JArgument_t, class JResult_t>
JWriter& operator<< ( JWriter out,
const JConstantFunction1D< JArgument_t, JResult_t > &  function 
)
friend

Write function to output.

Parameters
outwriter
functionfunction
Returns
writer

Definition at line 188 of file JConstantFunction1D.hh.

189  {
190  return out << function.__y;
191  }

Member Data Documentation

template<class JArgument_t, class JResult_t>
result_type JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >::__y
private

Definition at line 202 of file JConstantFunction1D.hh.

template<class JArgument_t = JNullType, class JResult_t = JNullType>
JSupervisor JTOOLS::JFunctional< JArgument_t, JResult_t >::supervisor
protectedinherited

Definition at line 295 of file JFunctional.hh.


The documentation for this class was generated from the following file: