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

/export/development/ViennaMath/viennamath/compiletime/operations/ct_variable.hpp

Go to the documentation of this file.
00001 #ifndef VIENNAMATH_COMPILETIME_OPERATIONS_CT_VARIABLE_HPP
00002 #define VIENNAMATH_COMPILETIME_OPERATIONS_CT_VARIABLE_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/compiletime/ct_constant.hpp"
00021 #include "viennamath/compiletime/ct_variable.hpp"
00022 #include "viennamath/compiletime/ct_binary_expr.hpp"
00023 
00024 #include <assert.h>
00025 
00030 namespace viennamath
00031 {
00032 
00034   
00036 
00037   template <id_type id>
00038   ct_binary_expr<ct_constant<2>,
00039                  op_mult<default_numeric_type>,
00040                  ct_variable<id> >
00041   operator+(ct_variable<id> const & lhs,
00042             ct_variable<id> const & other)
00043   {
00044     return ct_binary_expr<ct_constant<2>,
00045                           op_mult<default_numeric_type>,
00046                           ct_variable<id> >(ct_constant<2>(), lhs);
00047   }
00048 
00050 
00052   template <id_type id>
00053   ct_constant<0>
00054   operator-(ct_variable<id> const & lhs,
00055             ct_variable<id> const & other)
00056   {
00057     return ct_constant<0>();
00058   }
00059 
00060 
00061 
00063 
00064 
00066 
00068   template <id_type id>
00069   ct_constant<1>
00070   operator/(ct_variable<id> const & lhs,
00071             ct_variable<id> const & other)
00072   {
00073     return ct_constant<1>();
00074   }
00075 
00076 }
00077 
00078 #endif

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