Go to the documentation of this file.00001 #ifndef VIENNACL_LINALG_DETAIL_SPAI_SPAI_TAG_HPP
00002 #define VIENNACL_LINALG_DETAIL_SPAI_SPAI_TAG_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00029
00030 #include <utility>
00031 #include <iostream>
00032 #include <fstream>
00033 #include <string>
00034 #include <algorithm>
00035 #include <vector>
00036 #include <math.h>
00037 #include <cmath>
00038 #include <sstream>
00039 #include "viennacl/ocl/backend.hpp"
00040 #include "boost/numeric/ublas/vector.hpp"
00041 #include "boost/numeric/ublas/matrix.hpp"
00042 #include "boost/numeric/ublas/matrix_proxy.hpp"
00043 #include "boost/numeric/ublas/storage.hpp"
00044 #include "boost/numeric/ublas/io.hpp"
00045 #include "boost/numeric/ublas/matrix_expression.hpp"
00046 #include "boost/numeric/ublas/detail/matrix_assign.hpp"
00047
00048 #include "viennacl/linalg/detail/spai/block_matrix.hpp"
00049 #include "viennacl/linalg/detail/spai/block_vector.hpp"
00050
00051 namespace viennacl
00052 {
00053 namespace linalg
00054 {
00055 namespace detail
00056 {
00057 namespace spai
00058 {
00059
00064 class spai_tag
00065 {
00073 public:
00074 spai_tag(
00075 double residual_norm_threshold = 1e-3,
00076 unsigned int iteration_limit = 5,
00077 double residual_threshold = 1e-2,
00078 bool is_static = false,
00079 bool is_right = false) :
00080 _residual_norm_threshold(residual_norm_threshold),
00081 _iteration_limit(iteration_limit),
00082 _residual_threshold(residual_threshold),
00083 _is_static(is_static),
00084 _is_right(is_right) {};
00085
00086 double getResidualNormThreshold() const
00087 { return _residual_norm_threshold; }
00088
00089 double getResidualThreshold() const
00090 { return _residual_threshold; }
00091
00092 unsigned int getIterationLimit () const
00093 { return _iteration_limit; }
00094
00095 bool getIsStatic() const
00096 { return _is_static; }
00097
00098 bool getIsRight() const
00099 { return _is_right; }
00100
00101 long getBegInd() const
00102 { return _beg_ind; }
00103
00104 long getEndInd() const
00105 { return _end_ind; }
00106
00107
00108
00109 void setResidualNormThreshold(double residual_norm_threshold)
00110 {
00111 if(residual_norm_threshold > 0)
00112 _residual_norm_threshold = residual_norm_threshold;
00113 }
00114
00115 void setResidualThreshold(double residual_threshold)
00116 {
00117 if(residual_threshold > 0)
00118 _residual_threshold = residual_threshold;
00119 }
00120
00121 void setIterationLimit(unsigned int iteration_limit)
00122 {
00123 if(iteration_limit > 0)
00124 _iteration_limit = iteration_limit;
00125 }
00126
00127 void setIsRight(bool is_right) { _is_right = is_right; }
00128
00129 void setIsStatic(bool is_static) { _is_static = is_static; }
00130
00131 void setBegInd(long beg_ind) { _beg_ind = beg_ind; }
00132
00133 void setEndInd(long end_ind){ _end_ind = end_ind; }
00134
00135
00136 private:
00137 double _residual_norm_threshold;
00138 unsigned int _iteration_limit;
00139 long _beg_ind, _end_ind;
00140 double _residual_threshold;
00141 bool _is_static;
00142 bool _is_right;
00143 };
00144
00145 }
00146 }
00147 }
00148 }
00149 #endif