00001 00002 /****************************************************************************** 00003 * MODULE : lpolynomial_naive.hpp 00004 * DESCRIPTION: Naive variant for lacunary polynomials 00005 * COPYRIGHT : (C) 2014 Gregoire Lecerf 00006 ******************************************************************************* 00007 * This program is free software: you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation, either version 3 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 ******************************************************************************/ 00020 00021 #ifndef __MMX_LPOLYNOMIAL_NAIVE_HPP 00022 #define __MMX_LPOLYNOMIAL_NAIVE_HPP 00023 00024 #include <basix/table.hpp> 00025 namespace mmx { 00026 00027 #define TMPL template<typename C, typename E, typename V> 00028 #define TMPLK template<typename C, typename E, typename V, typename K> 00029 #define Format format<C> 00030 #define Table table<C,E> 00031 00032 /****************************************************************************** 00033 * Naive variant for polynomials 00034 ******************************************************************************/ 00035 00036 struct lpolynomial_naive { 00037 typedef lpolynomial_naive Naive; // Naive variant 00038 typedef lpolynomial_naive Positive; // Multiplication without subtractions 00039 typedef lpolynomial_naive No_simd; // Variant without SIMD instructions 00040 typedef lpolynomial_naive No_thread; // Variant without threads 00041 typedef lpolynomial_naive No_scaled; // Variant without preconditioning 00042 }; 00043 00044 template<typename C, typename E> 00045 struct lpolynomial_variant_helper { 00046 typedef lpolynomial_naive PV; 00047 }; 00048 00049 /****************************************************************************** 00050 * Variable name storage, default is R[x] 00051 ******************************************************************************/ 00052 00053 struct lpolynomial_defaults {}; 00054 00055 template<typename V> 00056 struct implementation<lpolynomial_defaults,V,lpolynomial_naive> { 00057 template<typename P> 00058 class global_variables { 00059 static inline generic& dyn_name () { 00060 static generic name = "x"; 00061 return name; } 00062 public: 00063 static inline void set_variable_name (const generic& x) { dyn_name () = x; } 00064 static inline generic get_variable_name () { return dyn_name (); } 00065 }; 00066 00067 }; // implementation<lpolynomial_defaults,V,lpolynomial_naive> 00068 00069 #undef TMPL 00070 #undef TMPLK 00071 #undef Format 00072 #undef Table 00073 } // namespace mmx 00074 #endif // __MMX__LPOLYNOMIAL_NAIVE