Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
1a5fc963
Commit
1a5fc963
authored
4 months ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Use detected number of parameters in first DEDFB line to discriminate application type
parent
167a64a2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libnptm/Configuration.cpp
+19
-12
19 additions, 12 deletions
src/libnptm/Configuration.cpp
with
19 additions
and
12 deletions
src/libnptm/Configuration.cpp
+
19
−
12
View file @
1a5fc963
...
@@ -222,13 +222,18 @@ GeometryConfiguration* GeometryConfiguration::from_legacy(const std::string& fil
...
@@ -222,13 +222,18 @@ GeometryConfiguration* GeometryConfiguration::from_legacy(const std::string& fil
throw
ex
;
throw
ex
;
}
}
int
_nsph
=
0
,
_lm
=
0
,
_in_pol
=
0
,
_npnt
=
0
,
_npntts
=
0
,
_isam
=
0
;
int
_nsph
=
0
,
_lm
=
0
,
_in_pol
=
0
,
_npnt
=
0
,
_npntts
=
0
,
_isam
=
0
;
int
_li
=
0
,
_le
=
0
,
_iavm
=
0
;
int
_li
=
0
,
_le
=
0
,
_iavm
=
0
,
num_params
=
0
;
np_int
_mxndm
=
0
;
np_int
_mxndm
=
0
;
regex
re
=
regex
(
"-?[0-9]+"
);
regex
re
=
regex
(
"-?[0-9]+"
);
str_target
=
file_lines
[
last_read_line
];
while
(
regex_search
(
str_target
,
m
,
re
))
{
str_target
=
m
.
suffix
().
str
();
num_params
++
;
}
str_target
=
file_lines
[
last_read_line
++
];
str_target
=
file_lines
[
last_read_line
++
];
regex_search
(
str_target
,
m
,
re
);
regex_search
(
str_target
,
m
,
re
);
_nsph
=
stoi
(
m
.
str
());
_nsph
=
stoi
(
m
.
str
());
if
(
_nsph
==
1
)
{
if
(
num_params
==
6
)
{
for
(
int
ri
=
0
;
ri
<
5
;
ri
++
)
{
for
(
int
ri
=
0
;
ri
<
5
;
ri
++
)
{
str_target
=
m
.
suffix
().
str
();
str_target
=
m
.
suffix
().
str
();
regex_search
(
str_target
,
m
,
re
);
regex_search
(
str_target
,
m
,
re
);
...
@@ -238,7 +243,7 @@ GeometryConfiguration* GeometryConfiguration::from_legacy(const std::string& fil
...
@@ -238,7 +243,7 @@ GeometryConfiguration* GeometryConfiguration::from_legacy(const std::string& fil
if
(
ri
==
3
)
_npntts
=
stoi
(
m
.
str
());
if
(
ri
==
3
)
_npntts
=
stoi
(
m
.
str
());
if
(
ri
==
4
)
_isam
=
stoi
(
m
.
str
());
if
(
ri
==
4
)
_isam
=
stoi
(
m
.
str
());
}
}
}
else
{
}
else
if
(
num_params
==
9
)
{
for
(
int
ri
=
0
;
ri
<
8
;
ri
++
)
{
for
(
int
ri
=
0
;
ri
<
8
;
ri
++
)
{
str_target
=
m
.
suffix
().
str
();
str_target
=
m
.
suffix
().
str
();
regex_search
(
str_target
,
m
,
re
);
regex_search
(
str_target
,
m
,
re
);
...
@@ -251,6 +256,9 @@ GeometryConfiguration* GeometryConfiguration::from_legacy(const std::string& fil
...
@@ -251,6 +256,9 @@ GeometryConfiguration* GeometryConfiguration::from_legacy(const std::string& fil
if
(
ri
==
6
)
_iavm
=
stoi
(
m
.
str
());
if
(
ri
==
6
)
_iavm
=
stoi
(
m
.
str
());
if
(
ri
==
7
)
_isam
=
stoi
(
m
.
str
());
if
(
ri
==
7
)
_isam
=
stoi
(
m
.
str
());
}
}
}
else
{
OpenConfigurationFileException
ex
(
"ERROR: "
+
file_name
+
" is not a recognized input file."
);
throw
ex
;
}
}
double
*
x
,
*
y
,
*
z
;
double
*
x
,
*
y
,
*
z
;
x
=
new
double
[
_nsph
];
x
=
new
double
[
_nsph
];
...
@@ -313,8 +321,7 @@ GeometryConfiguration* GeometryConfiguration::from_legacy(const std::string& fil
...
@@ -313,8 +321,7 @@ GeometryConfiguration* GeometryConfiguration::from_legacy(const std::string& fil
fjwtm
=
stoi
(
m
.
str
());
fjwtm
=
stoi
(
m
.
str
());
GeometryConfiguration
*
conf
=
new
GeometryConfiguration
(
GeometryConfiguration
*
conf
=
new
GeometryConfiguration
(
_nsph
,
_lm
,
_in_pol
,
_npnt
,
_npntts
,
_isam
,
_nsph
,
_lm
,
_in_pol
,
_npnt
,
_npntts
,
_isam
,
_li
,
_le
,
_mxndm
,
_iavm
,
_li
,
_le
,
_mxndm
,
_iavm
,
x
,
y
,
z
,
x
,
y
,
z
,
in_th_start
,
in_th_step
,
in_th_end
,
in_th_start
,
in_th_step
,
in_th_end
,
sc_th_start
,
sc_th_step
,
sc_th_end
,
sc_th_start
,
sc_th_step
,
sc_th_end
,
in_ph_start
,
in_ph_step
,
in_ph_end
,
in_ph_start
,
in_ph_step
,
in_ph_end
,
...
...
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