Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
randomvariable_opcodes.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2023 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19#pragma once
20
21#include <string>
22#include <vector>
23
24namespace QuantExt {
25
27 static constexpr std::size_t None = 0;
28 static constexpr std::size_t Add = 1;
29 static constexpr std::size_t Subtract = 2;
30 static constexpr std::size_t Negative = 3;
31 static constexpr std::size_t Mult = 4;
32 static constexpr std::size_t Div = 5;
33 static constexpr std::size_t ConditionalExpectation = 6;
34 static constexpr std::size_t IndicatorEq = 7;
35 static constexpr std::size_t IndicatorGt = 8;
36 static constexpr std::size_t IndicatorGeq = 9;
37 static constexpr std::size_t Min = 10;
38 static constexpr std::size_t Max = 11;
39 static constexpr std::size_t Abs = 12;
40 static constexpr std::size_t Exp = 13;
41 static constexpr std::size_t Sqrt = 14;
42 static constexpr std::size_t Log = 15;
43 static constexpr std::size_t Pow = 16;
44 static constexpr std::size_t NormalCdf = 17;
45 static constexpr std::size_t NormalPdf = 18;
46};
47
48// random variable operation labels
49
50inline std::vector<std::string> getRandomVariableOpLabels() {
51 static std::vector<std::string> tmp = {
52 "None", "Add", "Subtract", "Negative", "Mult", "Div", "ConditionalExpectation",
53 "IndicatorEq", "IndicatorGt", "IndicatorGeq", "Min", "Max", "Abs", "Exp",
54 "Sqrt", "Log", "Pow", "NormalCdf", "NormalPdf"};
55
56 return tmp;
57}
58
59} // namespace QuantExt
std::vector< std::string > getRandomVariableOpLabels()
static constexpr std::size_t Sqrt
static constexpr std::size_t IndicatorEq
static constexpr std::size_t Max
static constexpr std::size_t Add
static constexpr std::size_t Mult
static constexpr std::size_t IndicatorGeq
static constexpr std::size_t Log
static constexpr std::size_t Pow
static constexpr std::size_t Min
static constexpr std::size_t Negative
static constexpr std::size_t Subtract
static constexpr std::size_t NormalCdf
static constexpr std::size_t NormalPdf
static constexpr std::size_t Abs
static constexpr std::size_t None
static constexpr std::size_t ConditionalExpectation
static constexpr std::size_t IndicatorGt
static constexpr std::size_t Div
static constexpr std::size_t Exp