Go to the documentation of this file.00001 #ifndef VIENNACL_LINALG_DETAIL_AMG_AMG_DEBUG_HPP
00002 #define VIENNACL_LINALG_DETAIL_AMG_AMG_DEBUG_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00026 #include <iostream>
00027 #include "viennacl/io/matrix_market.hpp"
00028
00029 #ifdef SMALL_SIZE
00030 #define VIENNACL_AMG_MATRIXTYPE boost::numeric::ublas::matrix<ScalarType>
00031 #else
00032 #define VIENNACL_AMG_MATRIXTYPE MatrixType
00033 #endif
00034
00035 namespace viennacl
00036 {
00037 namespace linalg
00038 {
00039 namespace detail
00040 {
00041 namespace amg
00042 {
00043
00044 template <typename MatrixType>
00045 void printmatrix(MatrixType & mat, int const value=-1)
00046 {
00047 typedef typename MatrixType::value_type ScalarType;
00048 typedef typename VIENNACL_AMG_MATRIXTYPE::iterator1 InternalRowIterator;
00049 typedef typename VIENNACL_AMG_MATRIXTYPE::iterator2 InternalColIterator;
00050
00051 #ifdef DEBUG
00052 VIENNACL_AMG_MATRIXTYPE mat2 = mat;
00053
00054 for (InternalRowIterator row_iter = mat2.begin1(); row_iter != mat2.end1(); ++row_iter)
00055 {
00056 for (InternalColIterator col_iter = row_iter.begin(); col_iter != row_iter.end(); ++col_iter)
00057 {
00058 std::cout << *col_iter << " ";
00059 }
00060 std::cout << std::endl;
00061 }
00062 std::cout << std::endl;
00063 #endif
00064 }
00065
00066 template <typename VectorType>
00067 void printvector(VectorType const & vec)
00068 {
00069 #ifdef DEBUGBENCH
00070 for (typename VectorType::const_iterator iter = vec.begin(); iter != vec.end(); ++iter)
00071 {
00072 std::cout << *iter << " ";
00073 }
00074 std::cout << std::endl;
00075 #endif
00076 }
00077
00078 }
00079 }
00080 }
00081 }
00082 #endif