CppADCodeGen 2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
Loading...
Searching...
No Matches
random_2d_index_pattern.hpp
1#ifndef CPPAD_CG_RANDOM_2D_INDEX_PATTERN_INCLUDED
2#define CPPAD_CG_RANDOM_2D_INDEX_PATTERN_INCLUDED
3/* --------------------------------------------------------------------------
4 * CppADCodeGen: C++ Algorithmic Differentiation with Source Code Generation:
5 * Copyright (C) 2013 Ciengis
6 * Copyright (C) 2018 Joao Leal
7 *
8 * CppADCodeGen is distributed under multiple licenses:
9 *
10 * - Eclipse Public License Version 1.0 (EPL1), and
11 * - GNU General Public License Version 3 (GPL3).
12 *
13 * EPL1 terms and conditions can be found in the file "epl-v10.txt", while
14 * terms and conditions for the GPL3 can be found in the file "gpl3.txt".
15 * ----------------------------------------------------------------------------
16 * Author: Joao Leal
17 */
18
19namespace CppAD {
20namespace cg {
21
26protected:
27 std::map<size_t, std::map<size_t, size_t> > indexes_;
28 std::string name_;
29public:
30
31 inline Random2DIndexPattern(const std::map<size_t, std::map<size_t, size_t> >& x2y2z) :
32 indexes_(x2y2z) {
33 CPPADCG_ASSERT_UNKNOWN(!indexes_.empty());
34 }
35
36 inline virtual ~Random2DIndexPattern() = default;
37
38 inline IndexPatternType getType() const override {
39 return IndexPatternType::Random2D;
40 }
41
42 inline const std::map<size_t, std::map<size_t, size_t> >& getValues() const {
43 return indexes_;
44 }
45
46};
47
48} // END cg namespace
49} // END CppAD namespace
50
51#endif