Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Frida
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coenen, Joachim
Frida
Commits
b73a6b86
Commit
b73a6b86
authored
11 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
AM_MAINTAINER_MODE([disable]) # work around rebuild rules
parent
534f3500
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pub/configure.ac
+1
-0
1 addition, 0 deletions
pub/configure.ac
pub/src/manip.cpp
+17
-18
17 additions, 18 deletions
pub/src/manip.cpp
with
18 additions
and
18 deletions
pub/configure.ac
+
1
−
0
View file @
b73a6b86
...
...
@@ -17,6 +17,7 @@ AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign]) # don't insert GNU blala files
AM_MAINTAINER_MODE([disable]) # work around rebuild rules
################################################################################
## Select compiler and preprocessors ##
...
...
This diff is collapsed.
Click to expand it.
pub/src/manip.cpp
+
17
−
18
View file @
b73a6b86
...
...
@@ -1164,33 +1164,33 @@ void NManip::Interpolate()
//* Histogramming *//
//****************************************************************************//
//! Create and fill histograms based on
y
values.
//! Create and fill histograms based on
x
values
and their y weights
.
void
NManip
::
HistoMake
()
{
// Determine range:
double
y
min
=
0
,
y
max
=
0
;
// initialized to prevent warning
double
x
min
=
0
,
x
max
=
0
;
// initialized to prevent warning
int
npts
=
0
;
NOlm
::
IterateD
fiter
;
while
(
POld
fin
=
fiter
()
)
{
for
(
int
j
=
0
;
j
<
fin
->
nJ
();
j
++
)
{
PSpec
sin
=
fin
->
VS
(
j
);
for
(
int
i
=
0
;
i
<
sin
->
size
();
i
++
)
{
double
y
=
sin
->
y
[
i
];
double
x
=
sin
->
x
[
i
];
if
(
!
npts
)
{
y
min
=
y
;
y
max
=
y
;
}
else
if
(
y
<
y
min
)
{
y
min
=
y
;
}
else
if
(
y
>
y
max
)
{
y
max
=
y
;
x
min
=
x
;
x
max
=
x
;
}
else
if
(
x
<
x
min
)
{
x
min
=
x
;
}
else
if
(
x
>
x
max
)
{
x
max
=
x
;
}
++
npts
;
}
}
}
cout
<<
"there are "
<<
npts
<<
" points extending from "
<<
y
min
<<
" to "
<<
y
max
<<
"
\n
"
;
cout
<<
"there are "
<<
npts
<<
" points extending from "
<<
x
min
<<
" to "
<<
x
max
<<
"
\n
"
;
// Obtain number of bins:
static
int
nbin
=
32
;
...
...
@@ -1202,9 +1202,9 @@ void NManip::HistoMake()
// Set output grid:
vector
<
double
>
xout
(
nbin
);
double
dx
=
(
y
max
-
y
min
)
/
(
nbin
-
1
);
double
dx
=
(
x
max
-
x
min
)
/
(
nbin
-
1
);
for
(
int
i
=
0
;
i
<
nbin
;
++
i
)
xout
[
i
]
=
y
min
+
dx
*
i
;
xout
[
i
]
=
x
min
+
dx
*
i
;
// Create and fill output histograms:
fiter
.
reset
();
...
...
@@ -1218,12 +1218,11 @@ void NManip::HistoMake()
sout
->
copy_z_base
(
sin
);
sout
->
x
=
xout
;
sout
->
y
=
vector
<
double
>
(
nbin
,
0.
);
const
vector
<
double
>&
y
=
sin
->
y
;
for
(
int
i
=
0
;
i
<
y
.
size
();
++
i
)
{
int
iout
=
lrint
(
floor
((
y
[
i
]
-
ymin
)
/
dx
+
0.5
)
);
for
(
int
i
=
0
;
i
<
sin
->
size
();
++
i
)
{
int
iout
=
lrint
(
floor
((
sin
->
x
[
i
]
-
xmin
)
/
dx
+
0.5
)
);
if
(
iout
<
0
||
iout
>=
nbin
)
throw
"BUG: invalid iout="
+
S
(
iout
)
+
" for y="
+
S
(
y
[
i
]);
sout
->
y
[
iout
]
+=
1
;
throw
"BUG: invalid iout="
+
S
(
iout
)
+
" for y="
+
S
(
sin
->
x
[
i
]);
sout
->
y
[
iout
]
+=
sin
->
y
[
i
]
;
}
fout
->
V
.
push_back
(
sout
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment