Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CT-INT-FGOTH
QMC_Master
Commits
be8ee609
Commit
be8ee609
authored
Jun 18, 2012
by
Florian Goth
Browse files
some fixes.
parent
4772ea07
Changes
2
Hide whitespace changes
Inline
Side-by-side
common/filevector.h
View file @
be8ee609
...
...
@@ -1155,7 +1155,7 @@ private:
std
::
string
filename
;
///< the bins are stored under this filename
uint32_t
len
;
///< this is the length of a single valarray
uint32_t
functions
;
///< this is the number of functions that a single function makes up
uint32_t
binsize
;
///< the length of a bin bytes
uint32_t
binsize
;
///< the length of a bin
in
bytes
static
const
size_type
offs
=
2
*
sizeof
(
uint32_t
);
///< where starts the beginning of the file
FileVector_Private
::
Lock
*
lock
;
off64_t
curpos
;
///<< here we store the current position. That way we get sometmes rid of an expensive sync that is incurred by fseek
...
...
common/jackknife.h
View file @
be8ee609
...
...
@@ -34,11 +34,11 @@ this function calculates the expectation value of the samples stored in the cont
@param len the length of the array
@return the average value of the stored samples
*/
template
<
typename
T
>
T
expectationvalue
(
const
T
*
const
cont
,
unsigned
int
len
)
template
<
typename
T
,
typename
IntType
>
T
expectationvalue
(
const
T
*
const
cont
,
IntType
len
)
{
T
retval
(
cont
[
0
]);
for
(
unsigned
int
k
=
1
;
k
<
len
;
++
k
)
for
(
IntType
k
=
1
;
k
<
len
;
++
k
)
retval
+=
cont
[
k
];
return
retval
/
static_cast
<
typename
ToScalar
<
T
>::
RetType
>
(
len
);
}
...
...
@@ -129,7 +129,7 @@ errordata<typename Func::res_t > vecjackknife(Func func, const Cont& data, unsig
{
typedef
typename
Cont
::
value_type
::
value_type
ElementType
;
typedef
typename
Func
::
res_t
RetType
;
unsigned
int
len
=
data
[
0
].
size
();
//we assume all datasets have the same length. this is the number of functions not the number of bins!!!
auto
len
=
data
[
0
].
size
();
//we assume all datasets have the same length. this is the number of functions not the number of bins!!!
auto
mean
=
mc_analysis
::
mean
(
data
);
//mean now contains the averages of each dataset
auto
x_J
=
mean
;
...
...
@@ -163,6 +163,7 @@ errordata<typename Func::res_t > vecjackknife(Func func, const Cont& data, unsig
double
start
=
omp_get_wtime
();
#endif
std
::
valarray
<
typename
ToScalar
<
RetType
>::
RetType
>
cov
(
numcont
*
numcont
);
#pragma omp parallel for schedule(dynamic)
for
(
uint
y
=
0
;
y
<
numcont
;
++
y
)
{
for
(
uint
x
=
0
;
x
<
numcont
;
++
x
)
...
...
@@ -175,7 +176,7 @@ errordata<typename Func::res_t > vecjackknife(Func func, const Cont& data, unsig
}
}
#ifdef _OPENMP
std
::
cout
<<
"calculation took "
<<
omp_get_wtime
()
-
start
<<
" s."
<<
std
::
endl
;
std
::
cout
<<
"calculation
of covariance
took "
<<
omp_get_wtime
()
-
start
<<
" s."
<<
std
::
endl
;
#endif
retval
.
setCov
(
cov
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment