ROL
src
status
ROL_CombinedStatusTest.hpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Rapid Optimization Library (ROL) Package
4
//
5
// Copyright 2014 NTESS and the ROL contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef ROL_COMBINEDSTATUSTEST_H
11
#define ROL_COMBINEDSTATUSTEST_H
12
13
#include "
ROL_StatusTest.hpp
"
14
18
19
20
namespace
ROL
{
21
22
template
<
typename
Real>
23
class
CombinedStatusTest
:
public
StatusTest
<Real> {
24
private
:
25
std::vector<Ptr<StatusTest<Real>>>
status_
;
26
27
public
:
28
CombinedStatusTest
(
void
) {
29
status_
.clear();
30
}
31
32
void
reset
(
void
) {
33
status_
.clear();
34
}
35
36
void
add
(
const
Ptr<
StatusTest<Real>
> &status) {
37
status_
.push_back(status);
38
}
39
40
bool
check
(
AlgorithmState<Real>
&state ) {
41
ROL_TEST_FOR_EXCEPTION(
status_
.empty(),std::logic_error,
42
">>> ROL::CombinedStatusTest::check : No status test has been added!"
);
43
44
bool
flag =
true
;
45
for
(
const
auto
& status :
status_
) {
46
flag = status->check(state);
47
if
(!flag)
break
;
48
}
49
50
// true = "continue iteration"
51
// false = "stop iteration"
52
return
flag;
53
}
54
55
};
// class CombinedStatusTest
56
57
}
// namespace ROL
58
59
#endif
ROL_StatusTest.hpp
ROL::CombinedStatusTest::check
bool check(AlgorithmState< Real > &state)
Definition
ROL_CombinedStatusTest.hpp:40
ROL::CombinedStatusTest::status_
std::vector< Ptr< StatusTest< Real > > > status_
Definition
ROL_CombinedStatusTest.hpp:25
ROL::CombinedStatusTest::CombinedStatusTest
CombinedStatusTest(void)
Definition
ROL_CombinedStatusTest.hpp:28
ROL::CombinedStatusTest::add
void add(const Ptr< StatusTest< Real > > &status)
Definition
ROL_CombinedStatusTest.hpp:36
ROL::CombinedStatusTest::reset
void reset(void)
Definition
ROL_CombinedStatusTest.hpp:32
ROL::ROL::StatusTest::StatusTest
StatusTest(ParameterList &parlist)
Definition
ROL_Constraint_SerialSimOpt.hpp:36
ROL
Definition
ROL_ElementwiseVector.hpp:27
ROL::AlgorithmState
State for algorithm class. Will be used for restarts.
Definition
ROL_Types.hpp:109
Generated by
1.15.0