ROL
ROL_UpdateType.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_UPDATE_TYPE_HPP
11#define ROL_UPDATE_TYPE_HPP
12
13#include <cstdint>
14#include <string>
15
16namespace ROL {
17
18enum class UpdateType : std::uint8_t {
19 Initial = 0, // Update has not been called before
20 Accept, // This is the new iterate, trial must be called before
21 Revert, // Revert to the previous iterate, trial must be called before
22 Trial, // This is a candidate for the next iterate
23 Temp // For temporary uses including finite difference computations
24};
25
26
27inline std::string UpdateTypeToString(const UpdateType& type) {
28 std::string retString;
29 switch(type) {
30 case UpdateType::Initial: retString = "Initial"; break;
31 case UpdateType::Accept: retString = "Accept"; break;
32 case UpdateType::Revert: retString = "Revert"; break;
33 case UpdateType::Trial: retString = "Trial"; break;
34 case UpdateType::Temp: retString = "Temp"; break;
35 }
36 return retString;
37}
38
39} // namespace ROL
40
41#endif
std::string UpdateTypeToString(const UpdateType &type)