• Main Page
  • Namespaces
  • Data Structures
  • Files
  • File List

/export/development/ViennaMath/viennamath/manipulation/drop_dependent_terms.hpp

Go to the documentation of this file.
00001 #ifndef VIENNAMATH_MANIPULATION_DROP_DEPENDENT_TERMS_HPP
00002 #define VIENNAMATH_MANIPULATION_DROP_DEPENDENT_TERMS_HPP
00003 
00004 /* =======================================================================
00005    Copyright (c) 2012, Institute for Microelectronics,
00006                        Institute for Analysis and Scientific Computing,
00007                        TU Wien.
00008                              -----------------
00009                ViennaMath - Symbolic and Numerical Math in C++
00010                              -----------------
00011 
00012    Author:     Karl Rupp                          rupp@iue.tuwien.ac.at
00013 
00014    License:    MIT (X11), see file LICENSE in the ViennaMath base directory
00015 ======================================================================= */
00016 
00017 
00018 
00019 
00020 #include "viennamath/forwards.h"
00021 #include "viennamath/manipulation/expand.hpp"
00022 #include "viennamath/manipulation/substitute.hpp"
00023 #include "viennamath/manipulation/simplify.hpp"
00024 
00029 namespace viennamath
00030 {
00031   
00033   
00034   namespace result_of
00035   {
00036     
00037     // Reuse existing functionality: Replace FactorType by ct_constant<0>, then optimize:
00038 
00044     template <typename FactorType,
00045               typename ExpressionType>
00046     struct drop_dependent_terms
00047     {
00048       typedef typename viennamath::result_of::expand<ExpressionType>::type    expanded_expression; //[KR]: Is it actually necessary to expand here?
00049 
00050       typedef typename viennamath::result_of::substitute<FactorType, ct_constant<0>, expanded_expression>::type    substituted_expression;
00051       
00052       typedef typename viennamath::result_of::simplify<substituted_expression>::type    type;
00053     };
00054   }
00055   
00056   //interface function:
00064   template <typename FactorType,
00065             typename ExpressionType>
00066   typename result_of::drop_dependent_terms<FactorType, ExpressionType>::type
00067   drop_dependent_terms(FactorType const & f, ExpressionType const & e)
00068   {
00069     return typename result_of::drop_dependent_terms<FactorType, ExpressionType>::type();
00070   }
00071     
00073   
00074   // Not yet available
00075 }
00076 
00077 #endif

Generated on Wed Feb 29 2012 21:50:43 for ViennaMath by  doxygen 1.7.1