00001 00002 /****************************************************************************** 00003 * MODULE : matrix_double.hpp 00004 * DESCRIPTION: matrices with (complex) double coefficients 00005 * COPYRIGHT : (C) 2007 Joris van der Hoeven 00006 ******************************************************************************* 00007 * This software falls under the GNU general public license and comes WITHOUT 00008 * ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details. 00009 * If you don't have this file, write to the Free Software Foundation, Inc., 00010 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00011 ******************************************************************************/ 00012 00013 #ifndef __MMX_MATRIX_DOUBLE_HPP 00014 #define __MMX_MATRIX_DOUBLE_HPP 00015 #include <numerix/complex_double.hpp> 00016 #include <algebramix/vector_unrolled.hpp> 00017 #include <algebramix/vector_simd.hpp> 00018 #include <algebramix/matrix_strassen.hpp> 00019 #include <algebramix/matrix_threads.hpp> 00020 #include <algebramix/matrix_simd.hpp> 00021 #include <algebramix/matrix_complex.hpp> 00022 namespace mmx { 00023 00024 /****************************************************************************** 00025 * Variant 00026 ******************************************************************************/ 00027 00028 DEFINE_VARIANT (matrix_double, 00029 matrix_strassen< 00030 matrix_threads< 00031 Matrix_simd_variant(double)> >) 00032 00033 STMPL 00034 struct matrix_variant_helper<double> { 00035 typedef matrix_double MV; 00036 }; 00037 00038 template<typename V> 00039 struct threshold_helper<double, 00040 matrix_multiply_threshold<matrix_strassen<V> > > { 00041 typedef fixed_value<nat,512> impl; 00042 }; 00043 00044 /****************************************************************************** 00045 * Pivoting strategy for doubles 00046 ******************************************************************************/ 00047 00048 STMPL 00049 struct pivot_helper<double> { 00050 static inline bool 00051 better (const double& x1, const double& x2) { 00052 return abs (x1) > abs (x2); } 00053 }; 00054 00055 STMPL 00056 struct pivot_helper<complex<double> > { 00057 static inline bool 00058 better (const complex<double>& x1, const complex<double>& x2) { 00059 return abs (x1) > abs (x2); } 00060 }; 00061 00062 } 00063 #endif // __MMX_MATRIX_DOUBLE_HPP