OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Types.h
Go to the documentation of this file.
1//
2// File Types
3//
4// Copyright (c) 2010 - 2013, Yves Ineichen, ETH Zürich
5// All rights reserved
6//
7// Implemented as part of the PhD thesis
8// "Toward massively parallel multi-objective optimization with application to
9// particle accelerators" (https://doi.org/10.3929/ethz-a-009792359)
10//
11// This file is part of OPAL.
12//
13// OPAL is free software: you can redistribute it and/or modify
14// it under the terms of the GNU General Public License as published by
15// the Free Software Foundation, either version 3 of the License, or
16// (at your option) any later version.
17//
18// You should have received a copy of the GNU General Public License
19// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
20//
21#ifndef __TYPES_H__
22#define __TYPES_H__
23
24#include <map>
25#include <tuple>
26#include <utility>
27#include <vector>
28
30
31//FIXME: add namespaces
32
35
36
37// Variables
38
39// information the optimizer can request: either wants a derivative or a
40// function evaluation.
43
44typedef std::pair<std::string, double> namedVariable_t;
45typedef std::map<std::string, double> namedVariableCollection_t;
46
49
52//typedef std::variant< double, std::tuple<double, double, double> >
53 //reqVarValue_t;
54
55//FIXME: do we need InfoType_t ?
64typedef struct reqVarInfo {
66 std::vector<double> value;
68
69 template<class Archive>
70 void serialize(Archive & ar, const unsigned int /*version*/) {
71 ar & type;
72 ar & value;
73 ar & is_valid;
74 }
76
77typedef std::pair<std::string, reqVarInfo_t> namedReqVar_t;
78typedef std::map<std::string, reqVarInfo_t> reqVarContainer_t;
79
81typedef std::tuple<std::string, double, double> DVar_t;
82
88
89typedef std::pair<std::string, DVar_t> namedDVar_t;
90typedef std::map<std::string, DVar_t> DVarContainer_t;
91
92#endif
std::map< std::string, double > namedVariableCollection_t
Definition Types.h:45
Position_t
Definition Types.h:42
@ POSITION
Definition Types.h:42
@ TIME
Definition Types.h:42
std::map< std::string, DVar_t > DVarContainer_t
Definition Types.h:90
namedVariableCollection_t variableDictionary_t
Definition Types.h:48
std::tuple< std::string, double, double > DVar_t
type of design variables
Definition Types.h:81
InfoType_t
Definition Types.h:41
@ EVALUATE
Definition Types.h:41
@ DERIVATE
Definition Types.h:41
Role_t
roles a processor can attain
Definition Types.h:34
@ POLLER
Definition Types.h:34
@ UNASSIGNED
Definition Types.h:34
@ OPTIMIZER
Definition Types.h:34
@ WORKER
Definition Types.h:34
std::pair< std::string, double > namedVariable_t
Definition Types.h:44
std::map< std::string, reqVarInfo_t > reqVarContainer_t
Definition Types.h:78
DVar_tIdx
Definition Types.h:83
@ LOWER_BOUND
Definition Types.h:85
@ UPPER_BOUND
Definition Types.h:86
@ VAR_NAME
Definition Types.h:84
struct reqVarInfo reqVarInfo_t
namedVariableCollection_t Param_t
Definition Types.h:47
std::pair< std::string, DVar_t > namedDVar_t
Definition Types.h:89
std::pair< std::string, reqVarInfo_t > namedReqVar_t
Definition Types.h:77
std::vector< double > value
Definition Types.h:66
InfoType_t type
Definition Types.h:65
bool is_valid
Definition Types.h:67
void serialize(Archive &ar, const unsigned int)
Definition Types.h:70