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
nomad-lab
cpp_sisso
Commits
5ee4fe61
Commit
5ee4fe61
authored
Apr 16, 2021
by
Thomas Purcell
Browse files
Add option for InputParser to not need all lists defined in the input file
If a key is not in the file just return and empty vector
parent
85fd624d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/inputs/InputParser.hpp
View file @
5ee4fe61
...
...
@@ -118,6 +118,9 @@ template <typename T>
std
::
vector
<
T
>
as_vector
(
pt
::
ptree
const
&
pt
,
pt
::
ptree
::
key_type
const
&
key
)
{
std
::
vector
<
T
>
r
;
if
(
pt
.
count
(
key
)
==
0
)
return
r
;
for
(
auto
&
item
:
pt
.
get_child
(
key
))
r
.
push_back
(
item
.
second
.
get_value
<
T
>
());
return
r
;
...
...
tests/exec_test/default/sisso.json
View file @
5ee4fe61
...
...
@@ -10,6 +10,5 @@
"n_models_store"
:
1
,
"leave_out_inds"
:
[
0
,
1
,
2
,
60
,
61
],
"opset"
:
[
"add"
,
"sub"
,
"abs_diff"
,
"mult"
,
"div"
,
"inv"
,
"abs"
,
"exp"
,
"log"
,
"sin"
,
"cos"
,
"sq"
,
"cb"
,
"six_pow"
,
"sqrt"
,
"cbrt"
,
"neg_exp"
],
"param_opset"
:
[],
"fix_intercept"
:
false
}
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