Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
BornAgain
Commits
c4536e80
Commit
c4536e80
authored
8 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Plain Diff
Merge commit '
02188c06
' into develop
parents
666640b1
02188c06
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Core/Parametrization/ParameterPool.cpp
+8
-12
8 additions, 12 deletions
Core/Parametrization/ParameterPool.cpp
with
8 additions
and
12 deletions
Core/Parametrization/ParameterPool.cpp
+
8
−
12
View file @
c4536e80
...
@@ -110,7 +110,7 @@ RealParameter* ParameterPool::getParameter(const std::string& name)
...
@@ -110,7 +110,7 @@ RealParameter* ParameterPool::getParameter(const std::string& name)
"ParameterPool::getParameter() -> Warning. No parameter with name '"
+
name
+
"'"
);
"ParameterPool::getParameter() -> Warning. No parameter with name '"
+
name
+
"'"
);
}
}
//! Returns vector of parameters that match the _pattern_ (
wildcards
'*' allowed).
//! Returns
nonempty
vector of parameters that match the _pattern_ ('*' allowed)
, or throws
.
std
::
vector
<
RealParameter
*>
ParameterPool
::
getMatchedParameters
(
const
std
::
string
&
pattern
)
const
std
::
vector
<
RealParameter
*>
ParameterPool
::
getMatchedParameters
(
const
std
::
string
&
pattern
)
const
{
{
...
@@ -143,19 +143,15 @@ void ParameterPool::setParameterValue(const std::string& name, double value)
...
@@ -143,19 +143,15 @@ void ParameterPool::setParameterValue(const std::string& name, double value)
int
ParameterPool
::
setMatchedParametersValue
(
const
std
::
string
&
pattern
,
double
value
)
int
ParameterPool
::
setMatchedParametersValue
(
const
std
::
string
&
pattern
,
double
value
)
{
{
int
npars
(
0
);
int
npars
=
0
;
for
(
auto
*
par
:
m_params
)
{
for
(
RealParameter
*
par
:
getMatchedParameters
(
pattern
))
{
if
(
Utils
::
String
::
matchesPattern
(
par
->
getName
(),
pattern
)
)
{
try
{
try
{
par
->
setValue
(
value
);
par
->
setValue
(
value
);
npars
++
;
npars
++
;
}
catch
(
std
::
runtime_error
)
{
}
catch
(
std
::
runtime_error
)
{
report_set_value_error
(
par
->
getName
(),
value
);
report_set_value_error
(
par
->
getName
(),
value
);
}
}
}
}
}
if
(
npars
==
0
)
report_find_matched_parameters_error
(
pattern
);
return
npars
;
return
npars
;
}
}
...
...
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