ROL
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
15#include "ROL_Lanczos.hpp"
16
17#include "ROL_Stream.hpp"
18#include "Teuchos_GlobalMPISession.hpp"
19
20#include<iomanip>
21
22typedef double RealT;
23
24int 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 Teuchos::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}
Defines a no-output stream class ROL::NullStream and a function makeStreamPtr which either wraps a re...
Provides the ROL::Vector interface for scalar values, to be used, for example, with scalar constraint...
int main(int argc, char *argv[])
double RealT