Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DP3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ResearchAndDevelopment
DP3
Commits
ffaefc5e
Verified
Commit
ffaefc5e
authored
Apr 12, 2021
by
Maik Nijhuis
Browse files
Options
Downloads
Patches
Plain Diff
Use range-based loop in ApplyConstraints.
parent
cfbb76c3
No related branches found
No related tags found
No related merge requests found
Pipeline
#11689
passed
Apr 12, 2021
Stage: prepare
Stage: build
Stage: linting
Stage: test
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ddecal/gain_solvers/SolverBase.cc
+7
-6
7 additions, 6 deletions
ddecal/gain_solvers/SolverBase.cc
with
7 additions
and
6 deletions
ddecal/gain_solvers/SolverBase.cc
+
7
−
6
View file @
ffaefc5e
...
@@ -99,16 +99,17 @@ bool SolverBase::ApplyConstraints(
...
@@ -99,16 +99,17 @@ bool SolverBase::ApplyConstraints(
bool
constraints_satisfied
=
true
;
bool
constraints_satisfied
=
true
;
result
.
results
.
resize
(
constraints_
.
size
());
result
.
results
.
resize
(
constraints_
.
size
());
auto
result_iterator
=
result
.
results
.
begin
();
for
(
size_t
i
=
0
;
i
!=
constraints_
.
size
();
++
i
)
{
for
(
const
std
::
unique_ptr
<
Constraint
>&
c
:
constraints_
)
{
Constraint
&
c
=
*
constraints_
[
i
];
// PrepareIteration() might change Satisfied(), and since we always want
// PrepareIteration() might change Satisfied(), and since we always want
// to iterate at least once more when a constraint is not yet satisfied,
// to iterate at least once more when a constraint is not yet satisfied,
// we evaluate Satisfied() before preparing.
// we evaluate Satisfied() before preparing.
constraints_satisfied
=
c
.
Satisfied
()
&&
constraints_satisfied
;
constraints_satisfied
=
c
->
Satisfied
()
&&
constraints_satisfied
;
c
.
PrepareIteration
(
has_previously_converged
,
iteration
,
c
->
PrepareIteration
(
has_previously_converged
,
iteration
,
iteration
+
1
>=
GetMaxIterations
());
iteration
+
1
>=
GetMaxIterations
());
result
.
results
[
i
]
=
c
.
Apply
(
next_solutions
,
time
,
stat_stream
);
*
result_iterator
=
c
->
Apply
(
next_solutions
,
time
,
stat_stream
);
++
result_iterator
;
}
}
// If still not satisfied, at least iteration+1 constrained iterations
// If still not satisfied, at least iteration+1 constrained iterations
...
...
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