Jpp
18.0.0-rc.3
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
JTools
JHesseMatrix.hh
Go to the documentation of this file.
1
#ifndef __JTOOLS__JHESSEMATRIX__
2
#define __JTOOLS__JHESSEMATRIX__
3
4
#include "
JTools/JTable2D.hh
"
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
/**
19
* Hessian matrix.
20
*/
21
template
<
unsigned
int
N,
class
JData_t =
double
>
22
struct
JHesseMatrix
:
23
public
JTable2D
<N, N, JData_t>
24
{
25
/**
26
* Default constructor.
27
*/
28
JHesseMatrix
()
29
{}
30
31
32
/**
33
* Constructor.
34
*
35
* \param result Hesse result
36
*/
37
template
<
class
JResult_t>
38
JHesseMatrix
(
const
JResultHesse<JResult_t>
&
result
)
39
{
40
set
(result);
41
}
42
43
44
/**
45
* Set matrix according given result.
46
*
47
* \param result Hesse result
48
*/
49
template
<
class
JResult_t>
50
void
set
(
const
JResultHesse<JResult_t>
&
result
)
51
{
52
set
(0, result);
53
54
for
(
unsigned
int
i = 1; i !=
N
; ++i) {
55
for
(
unsigned
int
j
= 0;
j
!= i; ++
j
) {
56
this->
data
[i][
j
] = this->
data
[
j
][i];
57
}
58
}
59
}
60
61
private
:
62
/**
63
* Set final element.
64
*
65
* \param pivot pivot
66
* \param result Hesse result
67
*/
68
void
set
(
unsigned
int
pivot,
69
const
JResultHesse<JData_t>
&
result
)
70
{
71
this->
data
[pivot][pivot] = result.
fpp
;
72
}
73
74
75
/**
76
* Set final element.
77
*
78
* \param row row
79
* \param col col
80
* \param result Hesse result
81
*/
82
void
set
(
unsigned
int
row,
83
unsigned
int
col,
84
const
JResultHesse<JData_t>
&
result
)
85
{
86
this->
data
[row][col] = result.
fp
;
87
}
88
89
90
/**
91
* Recursivaly set elements.
92
*
93
* \param pivot pivot
94
* \param result Hesse result
95
*/
96
template
<
class
JResult_t>
97
void
set
(
unsigned
int
pivot,
98
const
JResultHesse<JResult_t>
&
result
)
99
{
100
this->
data
[pivot][pivot] =
get_value
(result.
fpp
);
101
102
set
(pivot, pivot + 1, result.
fp
);
103
set
(pivot + 1, result.
f
);
104
}
105
106
107
/**
108
* Recursivaly set elements.
109
*
110
* \param row row
111
* \param col col
112
* \param result Hesse result
113
*/
114
template
<
class
JResult_t>
115
void
set
(
unsigned
int
row,
116
unsigned
int
col,
117
const
JResultHesse<JResult_t>
&
result
)
118
{
119
this->
data
[row][col] =
get_value
(result.
fp
);
120
121
set
(row, col + 1, result.
f
);
122
}
123
};
124
}
125
126
#endif
JResult.hh
This include file containes various data structures that can be used as specific return types for the...
JTOOLS::JHesseMatrix::JHesseMatrix
JHesseMatrix()
Default constructor.
Definition:
JHesseMatrix.hh:28
JTOOLS::JHesseMatrix::JHesseMatrix
JHesseMatrix(const JResultHesse< JResult_t > &result)
Constructor.
Definition:
JHesseMatrix.hh:38
JTOOLS::JHesseMatrix::set
void set(unsigned int pivot, const JResultHesse< JData_t > &result)
Set final element.
Definition:
JHesseMatrix.hh:68
JTOOLS::JHesseMatrix::set
void set(unsigned int row, unsigned int col, const JResultHesse< JResult_t > &result)
Recursivaly set elements.
Definition:
JHesseMatrix.hh:115
JTOOLS::JResultDerivative::fp
JResult_t fp
first derivative
Definition:
JResult.hh:195
JTOOLS::JResultDerivative::f
JResult_t f
function value
Definition:
JResult.hh:194
JTOOLS::JTable2D< N, N, JData_t >::data
data_type data[NX][NY]
Definition:
JTable2D.hh:219
JTOOLS::JHesseMatrix::set
void set(const JResultHesse< JResult_t > &result)
Set matrix according given result.
Definition:
JHesseMatrix.hh:50
JTOOLS::JHesseMatrix::set
void set(unsigned int row, unsigned int col, const JResultHesse< JData_t > &result)
Set final element.
Definition:
JHesseMatrix.hh:82
JTOOLS::JTable2D
2D table with arithmetic capabilities.
Definition:
JTable2D.hh:27
JTOOLS::JResultHesse::fpp
JResult_t fpp
second derivative
Definition:
JResult.hh:318
JTOOLS::JHesseMatrix::set
void set(unsigned int pivot, const JResultHesse< JResult_t > &result)
Recursivaly set elements.
Definition:
JHesseMatrix.hh:97
JTable2D.hh
N
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition:
JMuonPostfit.sh:36
JTOOLS::JHesseMatrix
Hessian matrix.
Definition:
JHesseMatrix.hh:22
makedeclinationtable.result
list result
Definition:
makedeclinationtable.py:52
JTOOLS::j
int j
Definition:
JPolint.hh:703
JTOOLS::JResultHesse
Data structure for result including value and first derivative of function.
Definition:
JResult.hh:212
JTOOLS::get_value
JResultEvaluator< JResult_t >::result_type get_value(const JResult_t &value)
Helper method to recursively evaluate a to function value.
Definition:
JResult.hh:998
Generated by
1.8.5