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
mlz
Frida
Commits
1d504264
Commit
1d504264
authored
9 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
Merged core algorithm of mpaf with that of mpa.
parent
9a207a00
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pub/lib/manip.cpp
+7
-16
7 additions, 16 deletions
pub/lib/manip.cpp
pub/test/mpa.f2t
+11
-7
11 additions, 7 deletions
pub/test/mpa.f2t
with
18 additions
and
23 deletions
pub/lib/manip.cpp
+
7
−
16
View file @
1d504264
...
...
@@ -164,25 +164,16 @@ void NManip::points_rebin_by_factor()
for
(
int
j
=
0
;
j
<
fin
->
nJ
();
j
++
)
{
RSpec
sin
=
fin
->
VS
(
j
);
PSpec
sout
(
new
CSpec
()
);
sout
->
z
=
sin
->
z
;
if
(
sin
->
size
()
<
ng
)
int
nout
=
sin
->
size
()
/
ng
;
if
(
nout
<
1
)
throw
"not enough points in spectrum "
+
S
(
j
);
vector
<
int
>
breaks
(
nout
+
1
);
for
(
int
iout
=
0
;
iout
<
nout
+
1
;
++
iout
)
breaks
[
iout
]
=
iout
*
ng
;
PSpec
sout
=
sin
->
binned
(
breaks
);
for
(
int
iv
=
0
;
iv
<
sin
->
size
()
/
ng
;
++
iv
)
{
double
xg
=
0
,
yg
=
0
,
vg
=
0
;
for
(
int
i
=
iv
*
ng
;
i
<
(
iv
+
1
)
*
ng
;
++
i
)
{
xg
+=
sin
->
x
[
i
];
yg
+=
sin
->
y
[
i
];
if
(
sin
->
has_dy
()
)
vg
+=
SQR
(
sin
->
dy
[
i
]
);
}
if
(
sin
->
has_dy
()
)
sout
->
push_xyd
(
xg
/
ng
,
yg
/
ng
,
sqrt
(
vg
)
/
ng
);
else
sout
->
push_xy
(
xg
/
ng
,
yg
/
ng
);
}
fout
->
V
.
push_back
(
sout
);
}
NOlm
::
mem_store
(
fout
,
fiter
.
k
()
);
...
...
This diff is collapsed.
Click to expand it.
pub/test/mpa.f2t
+
11
−
7
View file @
1d504264
#!/usr/bin/env frida
fm
7 7
h
0 oy
j
+i
fm
9 1
h
0 oy
3
+i
1 mpa 0,3
throw_unless(abs(y[2,
3
,0]-(3+1))<1e-15,"mpa_test11")
throw_unless(abs(y[2,
3
,1]-(3+
4
.5))<1e-15,"mpa_test12")
throw_unless(abs(y[2,
0
,0]-(3+1))<1e-15,"mpa_test11")
throw_unless(abs(y[2,
0
,1]-(3+
5
.5))<1e-15,"mpa_test12")
1 mpaf 3
throw_unless(ni[3,3]==2,"mpa_test20")
throw_unless(abs(y[3,3,0]-(3+1))<1e-15,"mpa_test21")
throw_unless(abs(y[3,3,1]-(3+4))<1e-15,"mpa_test22")
throw_unless(ni[3,0]==3,"mpa_test20")
throw_unless(abs(y[3,0,0]-(3+1))<1e-15,"mpa_test21")
throw_unless(abs(y[3,0,2]-(3+7))<1e-15,"mpa_test22")
1 mpaf 4
throw_unless(ni[4,0]==2,"mpa_test30")
throw_unless(abs(y[4,0,0]-(3+1.5))<1e-15,"mpa_test31")
throw_unless(abs(y[4,0,1]-(3+5.5))<1e-15,"mpa_test32")
exit(1)
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