CppADCodeGen  HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
dae_equation_info.hpp
1 #ifndef CPPAD_CG_DAE_EQUATION_INFO_HPP
2 #define CPPAD_CG_DAE_EQUATION_INFO_HPP
3 /* --------------------------------------------------------------------------
4  * CppADCodeGen: C++ Algorithmic Differentiation with Source Code Generation:
5  * Copyright (C) 2013 Ciengis
6  *
7  * CppADCodeGen is distributed under multiple licenses:
8  *
9  * - Eclipse Public License Version 1.0 (EPL1), and
10  * - GNU General Public License Version 3 (GPL3).
11  *
12  * EPL1 terms and conditions can be found in the file "epl-v10.txt", while
13  * terms and conditions for the GPL3 can be found in the file "gpl3.txt".
14  * ----------------------------------------------------------------------------
15  * Author: Joao Leal
16  */
17 
18 
19 namespace CppAD {
20 namespace cg {
21 
26 private:
30  size_t id_;
34  int originalIndex_;
40  int antiDerivative_;
45  int assignedVarIndex_;
49  bool explicit_;
50 public:
51 
52  inline DaeEquationInfo() :
53  id_(0),
54  originalIndex_(-1),
55  antiDerivative_(-1),
56  assignedVarIndex_(-1),
57  explicit_(false) {
58  }
59 
60  inline DaeEquationInfo(size_t id,
61  int originalIndex,
62  int derivativeOf,
63  int assignedVarIndex,
64  bool explicitEq = false) :
65  id_(id),
66  originalIndex_(originalIndex),
67  antiDerivative_(derivativeOf),
68  assignedVarIndex_(assignedVarIndex),
69  explicit_(explicitEq) {
70  }
71 
77  inline size_t getId() const {
78  return id_;
79  }
80 
81  inline void setId(size_t id) {
82  id_ = id;
83  }
84 
85  inline int getAntiDerivative() const {
86  return antiDerivative_;
87  }
88 
89  inline void setAntiDerivative(int derivativeOf) {
90  antiDerivative_ = derivativeOf;
91  }
92 
93  inline int getAssignedVarIndex() const {
94  return assignedVarIndex_;
95  }
96 
97  inline void setAssignedVarIndex(int assignedVarIndex) {
98  assignedVarIndex_ = assignedVarIndex;
99  }
100 
101  inline int getOriginalIndex() const {
102  return originalIndex_;
103  }
104 
105  inline bool isExplicit() const {
106  return explicit_;
107  }
108 
109  inline void setExplicit(bool explicitEq) {
110  explicit_ = explicitEq;
111  }
112 
113  inline virtual ~DaeEquationInfo() {
114  }
115 };
116 
117 } // END cg namespace
118 } // END CppAD namespace
119 
120 #endif