All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
spai_tag.hpp
Go to the documentation of this file.
#ifndef VIENNACL_LINALG_DETAIL_SPAI_SPAI_TAG_HPP
#define VIENNACL_LINALG_DETAIL_SPAI_SPAI_TAG_HPP
/* =========================================================================
Copyright (c) 2010-2016, Institute for Microelectronics,
Institute for Analysis and Scientific Computing,
TU Wien.
Portions of this software are copyright by UChicago Argonne, LLC.
-----------------
ViennaCL - The Vienna Computing Library
-----------------
Project Head: Karl Rupp rupp@iue.tuwien.ac.at
(A list of authors and contributors can be found in the manual)
License: MIT (X11), see file LICENSE in the base directory
============================================================================= */
#include <utility>
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <cmath>
#include <sstream>
#include "viennacl/ocl/backend.hpp"
#include "boost/numeric/ublas/vector.hpp"
#include "boost/numeric/ublas/matrix.hpp"
#include "boost/numeric/ublas/matrix_proxy.hpp"
#include "boost/numeric/ublas/storage.hpp"
#include "boost/numeric/ublas/io.hpp"
#include "boost/numeric/ublas/matrix_expression.hpp"
#include "boost/numeric/ublas/detail/matrix_assign.hpp"
#include "viennacl/linalg/detail/spai/block_matrix.hpp"
#include "viennacl/linalg/detail/spai/block_vector.hpp"
namespace viennacl
{
namespace linalg
{
namespace detail
{
namespace spai
{
class spai_tag
{
public:
spai_tag(double residual_norm_threshold = 1e-3,
unsigned int iteration_limit = 5,
double residual_threshold = 1e-2,
bool is_static = false,
bool is_right = false)
: residual_norm_threshold_(residual_norm_threshold),
iteration_limit_(iteration_limit),
residual_threshold_(residual_threshold),
is_static_(is_static),
is_right_(is_right) {}
double getResidualNormThreshold() const { return residual_norm_threshold_; }
double getResidualThreshold() const { return residual_threshold_; }
unsigned int getIterationLimit () const { return iteration_limit_; }
bool getIsStatic() const { return is_static_; }
bool getIsRight() const { return is_right_; }
long getBegInd() const { return beg_ind_; }
long getEndInd() const { return end_ind_; }
void setResidualNormThreshold(double residual_norm_threshold)
{
if (residual_norm_threshold > 0)
residual_norm_threshold_ = residual_norm_threshold;
}
void setResidualThreshold(double residual_threshold)
{
if (residual_threshold > 0)
residual_threshold_ = residual_threshold;
}
void setIterationLimit(unsigned int iteration_limit)
{
if (iteration_limit > 0)
iteration_limit_ = iteration_limit;
}
void setIsRight(bool is_right) { is_right_ = is_right; }
void setIsStatic(bool is_static) { is_static_ = is_static; }
void setBegInd(long beg_ind) { beg_ind_ = beg_ind; }
void setEndInd(long end_ind){ end_ind_ = end_ind; }
private:
double residual_norm_threshold_;
unsigned int iteration_limit_;
long beg_ind_;
long end_ind_;
double residual_threshold_;
bool is_static_;
bool is_right_;
};
}
}
}
}
#endif
viennacl::linalg::detail::spai::spai_tag::setBegInd
void setBegInd(long beg_ind)
Definition: spai_tag.hpp:124
viennacl::linalg::detail::spai::spai_tag::setIsRight
void setIsRight(bool is_right)
Definition: spai_tag.hpp:120
viennacl::linalg::detail::spai::spai_tag
A tag for SPAI.
Definition: spai_tag.hpp:64
block_matrix.hpp
Implementation of a bunch of (small) matrices on GPU. Experimental.
viennacl::linalg::detail::spai::spai_tag::getEndInd
long getEndInd() const
Definition: spai_tag.hpp:98
viennacl::linalg::detail::spai::spai_tag::getIsRight
bool getIsRight() const
Definition: spai_tag.hpp:94
block_vector.hpp
Implementation of a bunch of vectors on GPU. Experimental.
viennacl::linalg::detail::spai::spai_tag::getBegInd
long getBegInd() const
Definition: spai_tag.hpp:96
viennacl::linalg::detail::spai::spai_tag::spai_tag
spai_tag(double residual_norm_threshold=1e-3, unsigned int iteration_limit=5, double residual_threshold=1e-2, bool is_static=false, bool is_right=false)
Constructor.
Definition: spai_tag.hpp:75
viennacl::linalg::detail::spai::spai_tag::setIterationLimit
void setIterationLimit(unsigned int iteration_limit)
Definition: spai_tag.hpp:114
viennacl::linalg::detail::spai::spai_tag::getResidualNormThreshold
double getResidualNormThreshold() const
Definition: spai_tag.hpp:86
backend.hpp
Implementations of the OpenCL backend, where all contexts are stored in.
viennacl::linalg::detail::spai::spai_tag::getIsStatic
bool getIsStatic() const
Definition: spai_tag.hpp:92
viennacl::linalg::detail::spai::spai_tag::setEndInd
void setEndInd(long end_ind)
Definition: spai_tag.hpp:126
viennacl::linalg::detail::spai::spai_tag::setResidualThreshold
void setResidualThreshold(double residual_threshold)
Definition: spai_tag.hpp:108
viennacl::linalg::detail::spai::spai_tag::setResidualNormThreshold
void setResidualNormThreshold(double residual_norm_threshold)
Definition: spai_tag.hpp:102
viennacl::linalg::detail::spai::spai_tag::getIterationLimit
unsigned int getIterationLimit() const
Definition: spai_tag.hpp:90
viennacl::linalg::detail::spai::spai_tag::setIsStatic
void setIsStatic(bool is_static)
Definition: spai_tag.hpp:122
viennacl::linalg::detail::spai::spai_tag::getResidualThreshold
double getResidualThreshold() const
Definition: spai_tag.hpp:88