ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
test
step
krylov
step/krylov/test_02.cpp
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
13
14
#include "
ROL_StdLinearOperator.hpp
"
15
#include "
ROL_Lanczos.hpp
"
16
17
#include "
ROL_Stream.hpp
"
18
#include "ROL_GlobalMPISession.hpp"
19
20
#include<iomanip>
21
22
typedef
double
RealT
;
23
24
int
main
(
int
argc,
char
*argv[]) {
25
26
27
28
29
typedef
std::vector<RealT> vector;
30
typedef
ROL::StdVector<RealT>
SV;
31
32
typedef
typename
vector::size_type uint;
33
34
ROL::GlobalMPISession mpiSession(&argc, &argv);
35
36
int
iprint = argc - 1;
37
ROL::Ptr<std::ostream> outStream;
38
ROL::nullstream
bhs;
// outputs nothing
39
if
(iprint > 0)
40
outStream = ROL::makePtrFromRef(std::cout);
41
else
42
outStream = ROL::makePtrFromRef(bhs);
43
44
int
errorFlag = 0;
45
46
try
{
47
48
}
49
catch
(std::logic_error& err) {
50
*outStream << err.what() <<
"\n"
;
51
errorFlag = -1000;
52
};
// end try
53
54
if
(errorFlag != 0)
55
std::cout <<
"End Result: TEST FAILED\n"
;
56
else
57
std::cout <<
"End Result: TEST PASSED\n"
;
58
59
return
0;
60
}
ROL_Lanczos.hpp
ROL_StdLinearOperator.hpp
ROL_Stream.hpp
Defines a no-output stream class ROL::NullStream and a function makeStreamPtr which either wraps a re...
ROL::StdVector
Provides the ROL::Vector interface for scalar values, to be used, for example, with scalar constraint...
Definition
ROL_StdVector.hpp:27
RealT
double RealT
Definition
function/constraint/test_01.cpp:29
ROL::details::nullstream
basic_nullstream< char, std::char_traits< char > > nullstream
Definition
ROL_Stream.hpp:36
main
int main(int argc, char *argv[])
Definition
step/krylov/test_02.cpp:24
Generated by
1.17.0