CppADCodeGen  HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
augment_path.hpp
1 #ifndef CPPAD_CG_AUGMENTPATH_INCLUDED
2 #define CPPAD_CG_AUGMENTPATH_INCLUDED
3 /* --------------------------------------------------------------------------
4  * CppADCodeGen: C++ Algorithmic Differentiation with Source Code Generation:
5  * Copyright (C) 2016 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 #include <cppad/cg/dae_index_reduction/bipartite_nodes.hpp>
19 #include <cppad/cg/dae_index_reduction/dae_equation_info.hpp>
20 #include <cppad/cg/dae_index_reduction/simple_logger.hpp>
21 
22 namespace CppAD {
23 namespace cg {
24 
29 template<class Base>
30 class AugmentPath {
31 protected:
33  using ADCG = CppAD::AD<CGBase>;
34 protected:
35  SimpleLogger defaultLogger_;
36  // logger
37  SimpleLogger* logger_;
38 public:
39  inline AugmentPath() :
40  logger_(&defaultLogger_) {
41  }
42 
43  inline virtual ~AugmentPath() {
44  }
45 
51  virtual bool augmentPath(Enode<Base>& i) = 0;
52 
53  inline void setLogger(SimpleLogger& logger) {
54  logger_ = &logger;
55  }
56 
57  inline SimpleLogger& getLogger() const {
58  return *logger_;
59  }
60 };
61 
62 } // END cg namespace
63 } // END CppAD namespace
64 
65 #endif
virtual bool augmentPath(Enode< Base > &i)=0