Jpp  18.0.1-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JResultTransformer.hh
Go to the documentation of this file.
1 #ifndef __JTOOLS__JRESULTTRANSFORMER__
2 #define __JTOOLS__JRESULTTRANSFORMER__
3 
5 #include "JTools/JResult.hh"
6 
7 
8 /**
9  * \author mdejong
10  */
11 
12 namespace JTOOLS {}
13 namespace JPP { using namespace JTOOLS; }
14 
15 namespace JTOOLS {
16 
17  /**
18  * Auxiliary class to handle multidimensional map transformations for given result type.
19  */
20  template<class JResult_t>
22 
23  typedef JResult_t result_type;
24 
25  template<unsigned int N, class JArgument_t>
28  const result_type& result)
29  {
30  return result;
31  }
32  };
33 
34 
35  /**
36  * Auxiliary class to handle multidimensional map transformations for given result type.
37  */
38  template<class JResult_t>
39  struct JResultTransformer< JResultHesse<JResult_t> > {
40 
42 
43  template<unsigned int N, class JArgument_t>
46  const result_type& result)
47  {
48  const JArgument_t z = transformer.getXn(array, 1.0) - transformer.getXn(array, 0.0);
49 
50  result_type value(result);
51 
52  value.fp /= z;
53 
54  return value;
55  }
56  };
57 
58 
59  /**
60  * Auxiliary class to handle multidimensional map transformations for given result type.
61  */
62  template<class JResult_t>
63  struct JResultTransformer< JResultPDF<JResult_t> > {
64 
66 
67  template<unsigned int N, class JArgument_t>
70  const result_type& result)
71  {
72  typedef JArgument_t argument_type;
73 
74  const argument_type z = transformer.getXn(array, 1.0) - transformer.getXn(array, 0.0);
75 
76  result_type value(result);
77 
78  value.fp /= z;
79  value.v *= z;
80  value.V *= z;
81 
82  return value;
83  }
84  };
85 }
86 
87 #endif
This include file containes various data structures that can be used as specific return types for the...
JResult_t fp
first derivative
Definition: JResult.hh:514
static result_type transform(const JMultiMapTransformer< N, JArgument_t > &transformer, typename JMultiMapTransformer< N, JArgument_t >::const_array_type array, const result_type &result)
JResult_t V
integral &lt;xmin,xmax&gt;
Definition: JResult.hh:516
JResult_t fp
first derivative
Definition: JResult.hh:195
Data structure for result including value, first derivative and integrals of function.
Definition: JResult.hh:337
JResult_t v
integral &lt;xmin,x]
Definition: JResult.hh:515
One dimensional array of template objects with fixed length.
Definition: JArray.hh:40
static result_type transform(const JMultiMapTransformer< N, JArgument_t > &transformer, typename JMultiMapTransformer< N, JArgument_t >::const_array_type array, const result_type &result)
Interface for weight application and coordinate transformation of function.
virtual argument_type getXn(const_array_type &buffer, const argument_type xn) const =0
Evaluate xn value as a function of {x0, ..., xn-1}.
static result_type transform(const JMultiMapTransformer< N, JArgument_t > &transformer, typename JMultiMapTransformer< N, JArgument_t >::const_array_type array, const result_type &result)
Data structure for result including value and first derivative of function.
Definition: JResult.hh:212
Auxiliary class to handle multidimensional map transformations for given result type.