Back to index

texmacs  1.0.7.15
properties.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : properties.hpp
00004 * DESCRIPTION: Properties of mathematical data types
00005 * COPYRIGHT  : (C) 2006  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef PROPERTIES_HPP
00013 #define PROPERTIES_HPP
00014 #include "math_tree.hpp"
00015 
00016 template<typename T>
00017 class unary_properties {
00018 public:
00019   typedef T scalar_type;
00020   typedef T norm_type;
00021   typedef int index_type;
00022   static inline tree index_name (index_type i) {
00023     (void) i; return "x"; }
00024   static inline scalar_type access (T x, index_type var) {
00025     return x; }
00026 };
00027 
00028 template<typename T, typename U>
00029 class binary_properties {
00030 public:
00031   typedef U product_type;
00032 };
00033 
00034 #endif // PROPERTIES_H