Skip to content
Snippets Groups Projects
Select Git revision
  • 82b3115696f546d7f7920912addb51b08956cec0
  • master default protected
  • 6.x protected
  • madysson
  • 5.x protected
  • asm
  • time-varying-information-set
  • 4.6 protected
  • dynare_minreal
  • dragonfly
  • various_fixes
  • 4.5 protected
  • clang+openmp
  • exo_steady_state
  • declare_vars_in_model_block
  • julia
  • error_msg_undeclared_model_vars
  • static_aux_vars
  • slice
  • aux_func
  • penalty
  • 6.4 protected
  • 6.3 protected
  • 6.2 protected
  • 6.1 protected
  • 6.0 protected
  • 6-beta2 protected
  • 6-beta1 protected
  • 5.5 protected
  • 5.4 protected
  • 5.3 protected
  • 5.2 protected
  • 5.1 protected
  • 5.0 protected
  • 5.0-rc1 protected
  • 4.7-beta3 protected
  • 4.7-beta2 protected
  • 4.7-beta1 protected
  • 4.6.4 protected
  • 4.6.3 protected
  • 4.6.2 protected
41 results

ExprNode.hh

Blame
  • ExprNode.hh 56.19 KiB
    /*
     * Copyright (C) 2007-2014 Dynare Team
     *
     * This file is part of Dynare.
     *
     * Dynare is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * Dynare is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
     */
    
    #ifndef _EXPR_NODE_HH
    #define _EXPR_NODE_HH
    
    #include <set>
    #include <map>
    #include <vector>
    #include <ostream>
    
    using namespace std;
    
    #include "SymbolTable.hh"
    #include "CodeInterpreter.hh"
    #include "ExternalFunctionsTable.hh"
    
    class DataTree;
    class VariableNode;
    class BinaryOpNode;
    
    typedef class ExprNode *expr_t;
    
    struct Model_Block;
    
    struct ExprNodeLess;
    
    //! Type for set of temporary terms
    /*! They are ordered by index number thanks to ExprNodeLess */
    typedef set<expr_t, ExprNodeLess> temporary_terms_t;
    
    //! set of temporary terms used in a block
    typedef set<int> temporary_terms_inuse_t;
    
    typedef map<int, int> map_idx_t;
    
    //! Type for evaluation contexts
    /*! The key is a symbol id. Lags are assumed to be null */
    typedef map<int, double> eval_context_t;
    
    //! Type for tracking first/second derivative functions that have already been written as temporary terms
    typedef map<pair<int, vector<expr_t> >, int> deriv_node_temp_terms_t;
    
    //! Possible types of output when writing ExprNode(s)
    enum ExprNodeOutputType
      {
        oMatlabStaticModel,                           //!< Matlab code, static model
        oMatlabDynamicModel,                          //!< Matlab code, dynamic model
        oMatlabStaticModelSparse,                     //!< Matlab code, static block decomposed model
        oMatlabDynamicModelSparse,                    //!< Matlab code, dynamic block decomposed model
        oCDynamicModel,                               //!< C code, dynamic model
        oCStaticModel,                                //!< C code, static model
        oMatlabOutsideModel,                          //!< Matlab code, outside model block (for example in initval)
        oLatexStaticModel,                            //!< LaTeX code, static model