All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
forwards.h
Go to the documentation of this file.
#ifndef VIENNACL_FORWARDS_H
#define VIENNACL_FORWARDS_H
/* =========================================================================
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
============================================================================= */
//compatibility defines:
#ifdef VIENNACL_HAVE_UBLAS
#define VIENNACL_WITH_UBLAS
#endif
#ifdef VIENNACL_HAVE_EIGEN
#define VIENNACL_WITH_EIGEN
#endif
#ifdef VIENNACL_HAVE_MTL4
#define VIENNACL_WITH_MTL4
#endif
#include <cstddef>
#include <cassert>
#include <string>
#include <stdexcept>
#include "viennacl/meta/enable_if.hpp"
#include "viennacl/version.hpp"
namespace viennacl
{
typedef std::size_t vcl_size_t;
typedef std::ptrdiff_t vcl_ptrdiff_t;
struct op_assign {};
struct op_inplace_add {};
struct op_inplace_sub {};
struct op_add {};
struct op_sub {};
struct op_mult {};
struct op_prod {};
struct op_mat_mat_prod {};
struct op_div {};
struct op_pow {};
struct op_eq {};
struct op_neq {};
struct op_greater {};
struct op_less {};
struct op_geq {};
struct op_leq {};
struct op_sum {};
struct op_row_sum {};
struct op_col_sum {};
template<typename OP>
struct op_element_cast {};
template<typename OP>
struct op_element_binary {};
template<typename OP>
struct op_element_unary {};
struct op_abs {};
struct op_acos {};
struct op_asin {};
struct op_argmax {};
struct op_argmin {};
struct op_atan {};
struct op_atan2 {};
struct op_ceil {};
struct op_cos {};
struct op_cosh {};
struct op_exp {};
struct op_fabs {};
struct op_fdim {};
struct op_floor {};
struct op_fmax {};
struct op_fmin {};
struct op_fmod {};
struct op_log {};
struct op_log10 {};
struct op_sin {};
struct op_sinh {};
struct op_sqrt {};
struct op_tan {};
struct op_tanh {};
struct op_matrix_diag {};
struct op_vector_diag {};
struct op_row {};
struct op_column {};
struct op_inner_prod {};
struct op_norm_1 {};
struct op_norm_2 {};
struct op_norm_inf {};
struct op_max {};
struct op_min {};
struct op_norm_frobenius {};
struct op_trans {};
struct op_flip_sign {};
//forward declaration of basic types:
template<class TYPE>
class scalar;
template<typename LHS, typename RHS, typename OP>
class scalar_expression;
template<typename SCALARTYPE>
class entry_proxy;
template<typename SCALARTYPE>
class const_entry_proxy;
template<typename LHS, typename RHS, typename OP>
class vector_expression;
template<class SCALARTYPE, unsigned int ALIGNMENT>
class vector_iterator;
template<class SCALARTYPE, unsigned int ALIGNMENT>
class const_vector_iterator;
template<typename SCALARTYPE>
class implicit_vector_base;
template<typename SCALARTYPE>
struct zero_vector;
template<typename SCALARTYPE>
struct unit_vector;
template<typename SCALARTYPE>
struct one_vector;
template<typename SCALARTYPE>
struct scalar_vector;
template<class SCALARTYPE, typename SizeType = vcl_size_t, typename DistanceType = vcl_ptrdiff_t>
class vector_base;
template<class SCALARTYPE, unsigned int ALIGNMENT = 1>
class vector;
template<typename ScalarT>
class vector_tuple;
//the following forwards are needed for GMRES
template<typename SCALARTYPE, unsigned int ALIGNMENT, typename CPU_ITERATOR>
void copy(CPU_ITERATOR const & cpu_begin,
CPU_ITERATOR const & cpu_end,
vector_iterator<SCALARTYPE, ALIGNMENT> gpu_begin);
template<typename SCALARTYPE, unsigned int ALIGNMENT_SRC, unsigned int ALIGNMENT_DEST>
void copy(const_vector_iterator<SCALARTYPE, ALIGNMENT_SRC> const & gpu_src_begin,
const_vector_iterator<SCALARTYPE, ALIGNMENT_SRC> const & gpu_src_end,
vector_iterator<SCALARTYPE, ALIGNMENT_DEST> gpu_dest_begin);
template<typename SCALARTYPE, unsigned int ALIGNMENT_SRC, unsigned int ALIGNMENT_DEST>
void copy(const_vector_iterator<SCALARTYPE, ALIGNMENT_SRC> const & gpu_src_begin,
const_vector_iterator<SCALARTYPE, ALIGNMENT_SRC> const & gpu_src_end,
const_vector_iterator<SCALARTYPE, ALIGNMENT_DEST> gpu_dest_begin);
template<typename SCALARTYPE, unsigned int ALIGNMENT, typename CPU_ITERATOR>
void fast_copy(const const_vector_iterator<SCALARTYPE, ALIGNMENT> & gpu_begin,
const const_vector_iterator<SCALARTYPE, ALIGNMENT> & gpu_end,
CPU_ITERATOR cpu_begin );
template<typename CPU_ITERATOR, typename SCALARTYPE, unsigned int ALIGNMENT>
void fast_copy(CPU_ITERATOR const & cpu_begin,
CPU_ITERATOR const & cpu_end,
vector_iterator<SCALARTYPE, ALIGNMENT> gpu_begin);
struct row_major_tag {};
struct column_major_tag {};
struct row_major
{
typedef row_major_tag orientation_category;
static vcl_size_t mem_index(vcl_size_t i, vcl_size_t j, vcl_size_t /* num_rows */, vcl_size_t num_cols)
{
return i * num_cols + j;
}
};
struct column_major
{
typedef column_major_tag orientation_category;
static vcl_size_t mem_index(vcl_size_t i, vcl_size_t j, vcl_size_t num_rows, vcl_size_t /* num_cols */)
{
return i + j * num_rows;
}
};
struct row_iteration;
struct col_iteration;
template<typename LHS, typename RHS, typename OP>
class matrix_expression;
class context;
enum memory_types
{
MEMORY_NOT_INITIALIZED
, MAIN_MEMORY
, OPENCL_MEMORY
, CUDA_MEMORY
};
namespace backend
{
class mem_handle;
}
//
// Matrix types:
//
static const vcl_size_t dense_padding_size = 128;
template<typename ROWCOL, typename MATRIXTYPE>
class matrix_iterator;
template<class SCALARTYPE, typename SizeType = vcl_size_t, typename DistanceType = vcl_ptrdiff_t>
class matrix_base;
template<class SCALARTYPE, typename F = row_major, unsigned int ALIGNMENT = 1>
class matrix;
template<typename SCALARTYPE>
class implicit_matrix_base;
template<class SCALARTYPE>
class identity_matrix;
template<class SCALARTYPE>
class zero_matrix;
template<class SCALARTYPE>
class scalar_matrix;
template<class SCALARTYPE, unsigned int ALIGNMENT = 1>
class compressed_matrix;
template<class SCALARTYPE>
class compressed_compressed_matrix;
template<class SCALARTYPE, unsigned int ALIGNMENT = 128>
class coordinate_matrix;
template<class SCALARTYPE, unsigned int ALIGNMENT = 1>
class ell_matrix;
template<typename ScalarT, typename IndexT = unsigned int>
class sliced_ell_matrix;
template<class SCALARTYPE, unsigned int ALIGNMENT = 1>
class hyb_matrix;
template<class SCALARTYPE, unsigned int ALIGNMENT = 1>
class circulant_matrix;
template<class SCALARTYPE, unsigned int ALIGNMENT = 1>
class hankel_matrix;
template<class SCALARTYPE, unsigned int ALIGNMENT = 1>
class toeplitz_matrix;
template<class SCALARTYPE, unsigned int ALIGNMENT = 1>
class vandermonde_matrix;
//
// Proxies:
//
template<typename SizeType = vcl_size_t, typename DistanceType = std::ptrdiff_t>
class basic_range;
typedef basic_range<> range;
template<typename SizeType = vcl_size_t, typename DistanceType = std::ptrdiff_t>
class basic_slice;
typedef basic_slice<> slice;
template<typename VectorType>
class vector_range;
template<typename VectorType>
class vector_slice;
template<typename MatrixType>
class matrix_range;
template<typename MatrixType>
class matrix_slice;
template<typename T>
struct is_cpu_scalar
{
enum { value = false };
};
template<typename T>
struct is_scalar
{
enum { value = false };
};
template<typename T>
struct is_flip_sign_scalar
{
enum { value = false };
};
template<typename T>
struct is_any_scalar
{
enum { value = (is_scalar<T>::value || is_cpu_scalar<T>::value || is_flip_sign_scalar<T>::value )};
};
template<typename T>
struct is_any_vector { enum { value = 0 }; };
template<typename T>
struct is_any_dense_matrix { enum { value = 0 }; };
template<typename T>
struct is_row_major
{
enum { value = false };
};
template<typename T>
struct is_compressed_matrix
{
enum { value = false };
};
template<typename T>
struct is_coordinate_matrix
{
enum { value = false };
};
template<typename T>
struct is_ell_matrix
{
enum { value = false };
};
template<typename T>
struct is_sliced_ell_matrix
{
enum { value = false };
};
template<typename T>
struct is_hyb_matrix
{
enum { value = false };
};
template<typename T>
struct is_any_sparse_matrix
{
enum { value = false };
};
template<typename T>
struct is_circulant_matrix
{
enum { value = false };
};
template<typename T>
struct is_hankel_matrix
{
enum { value = false };
};
template<typename T>
struct is_toeplitz_matrix
{
enum { value = false };
};
template<typename T>
struct is_vandermonde_matrix
{
enum { value = false };
};
template<typename T>
struct is_any_dense_structured_matrix
{
enum { value = viennacl::is_circulant_matrix<T>::value || viennacl::is_hankel_matrix<T>::value || viennacl::is_toeplitz_matrix<T>::value || viennacl::is_vandermonde_matrix<T>::value };
};
class memory_exception : public std::exception
{
public:
memory_exception() : message_() {}
memory_exception(std::string message) : message_("ViennaCL: Internal memory error: " + message) {}
virtual const char* what() const throw() { return message_.c_str(); }
virtual ~memory_exception() throw() {}
private:
std::string message_;
};
class cuda_not_available_exception : public std::exception
{
public:
cuda_not_available_exception() : message_("ViennaCL was compiled without CUDA support, but CUDA functionality required for this operation.") {}
virtual const char* what() const throw() { return message_.c_str(); }
virtual ~cuda_not_available_exception() throw() {}
private:
std::string message_;
};
class zero_on_diagonal_exception : public std::runtime_error
{
public:
zero_on_diagonal_exception(std::string const & what_arg) : std::runtime_error(what_arg) {}
};
class unknown_norm_exception : public std::runtime_error
{
public:
unknown_norm_exception(std::string const & what_arg) : std::runtime_error(what_arg) {}
};
namespace tools
{
//helper for matrix row/col iterators
//must be specialized for every viennacl matrix type
template<typename ROWCOL, typename MATRIXTYPE>
struct MATRIX_ITERATOR_INCREMENTER
{
typedef typename MATRIXTYPE::ERROR_SPECIALIZATION_FOR_THIS_MATRIX_TYPE_MISSING ErrorIndicator;
static void apply(const MATRIXTYPE & /*mat*/, unsigned int & /*row*/, unsigned int & /*col*/) {}
};
}
namespace linalg
{
#if !defined(_MSC_VER) || defined(__CUDACC__)
template<class SCALARTYPE, unsigned int ALIGNMENT>
void convolve_i(viennacl::vector<SCALARTYPE, ALIGNMENT>& input1,
viennacl::vector<SCALARTYPE, ALIGNMENT>& input2,
viennacl::vector<SCALARTYPE, ALIGNMENT>& output);
template<typename T>
viennacl::vector_expression<const vector_base<T>, const vector_base<T>, op_element_binary<op_prod> >
element_prod(vector_base<T> const & v1, vector_base<T> const & v2);
template<typename T>
viennacl::vector_expression<const vector_base<T>, const vector_base<T>, op_element_binary<op_div> >
element_div(vector_base<T> const & v1, vector_base<T> const & v2);
template<typename T>
void inner_prod_impl(vector_base<T> const & vec1,
vector_base<T> const & vec2,
scalar<T> & result);
template<typename LHS, typename RHS, typename OP, typename T>
void inner_prod_impl(viennacl::vector_expression<LHS, RHS, OP> const & vec1,
vector_base<T> const & vec2,
scalar<T> & result);
template<typename T, typename LHS, typename RHS, typename OP>
void inner_prod_impl(vector_base<T> const & vec1,
viennacl::vector_expression<LHS, RHS, OP> const & vec2,
scalar<T> & result);
template<typename LHS1, typename RHS1, typename OP1,
typename LHS2, typename RHS2, typename OP2, typename T>
void inner_prod_impl(viennacl::vector_expression<LHS1, RHS1, OP1> const & vec1,
viennacl::vector_expression<LHS2, RHS2, OP2> const & vec2,
scalar<T> & result);
template<typename T>
void inner_prod_cpu(vector_base<T> const & vec1,
vector_base<T> const & vec2,
T & result);
template<typename LHS, typename RHS, typename OP, typename T>
void inner_prod_cpu(viennacl::vector_expression<LHS, RHS, OP> const & vec1,
vector_base<T> const & vec2,
T & result);
template<typename T, typename LHS, typename RHS, typename OP>
void inner_prod_cpu(vector_base<T> const & vec1,
viennacl::vector_expression<LHS, RHS, OP> const & vec2,
T & result);
template<typename LHS1, typename RHS1, typename OP1,
typename LHS2, typename RHS2, typename OP2, typename S3>
void inner_prod_cpu(viennacl::vector_expression<LHS1, RHS1, OP1> const & vec1,
viennacl::vector_expression<LHS2, RHS2, OP2> const & vec2,
S3 & result);
//forward definition of norm_1_impl function
template<typename T>
void norm_1_impl(vector_base<T> const & vec, scalar<T> & result);
template<typename LHS, typename RHS, typename OP, typename T>
void norm_1_impl(viennacl::vector_expression<LHS, RHS, OP> const & vec,
scalar<T> & result);
template<typename T>
void norm_1_cpu(vector_base<T> const & vec,
T & result);
template<typename LHS, typename RHS, typename OP, typename S2>
void norm_1_cpu(viennacl::vector_expression<LHS, RHS, OP> const & vec,
S2 & result);
//forward definition of norm_2_impl function
template<typename T>
void norm_2_impl(vector_base<T> const & vec, scalar<T> & result);
template<typename LHS, typename RHS, typename OP, typename T>
void norm_2_impl(viennacl::vector_expression<LHS, RHS, OP> const & vec,
scalar<T> & result);
template<typename T>
void norm_2_cpu(vector_base<T> const & vec, T & result);
template<typename LHS, typename RHS, typename OP, typename S2>
void norm_2_cpu(viennacl::vector_expression<LHS, RHS, OP> const & vec,
S2 & result);
//forward definition of norm_inf_impl function
template<typename T>
void norm_inf_impl(vector_base<T> const & vec, scalar<T> & result);
template<typename LHS, typename RHS, typename OP, typename T>
void norm_inf_impl(viennacl::vector_expression<LHS, RHS, OP> const & vec,
scalar<T> & result);
template<typename T>
void norm_inf_cpu(vector_base<T> const & vec, T & result);
template<typename LHS, typename RHS, typename OP, typename S2>
void norm_inf_cpu(viennacl::vector_expression<LHS, RHS, OP> const & vec,
S2 & result);
//forward definition of max()-related functions
template<typename T>
void max_impl(vector_base<T> const & vec, scalar<T> & result);
template<typename LHS, typename RHS, typename OP, typename T>
void max_impl(viennacl::vector_expression<LHS, RHS, OP> const & vec,
scalar<T> & result);
template<typename T>
void max_cpu(vector_base<T> const & vec, T & result);
template<typename LHS, typename RHS, typename OP, typename S2>
void max_cpu(viennacl::vector_expression<LHS, RHS, OP> const & vec,
S2 & result);
//forward definition of min()-related functions
template<typename T>
void min_impl(vector_base<T> const & vec, scalar<T> & result);
template<typename LHS, typename RHS, typename OP, typename T>
void min_impl(viennacl::vector_expression<LHS, RHS, OP> const & vec,
scalar<T> & result);
template<typename T>
void min_cpu(vector_base<T> const & vec, T & result);
template<typename LHS, typename RHS, typename OP, typename S2>
void min_cpu(viennacl::vector_expression<LHS, RHS, OP> const & vec,
S2 & result);
//forward definition of sum()-related functions
template<typename T>
void sum_impl(vector_base<T> const & vec, scalar<T> & result);
template<typename LHS, typename RHS, typename OP, typename T>
void sum_impl(viennacl::vector_expression<LHS, RHS, OP> const & vec,
scalar<T> & result);
template<typename T>
void sum_cpu(vector_base<T> const & vec, T & result);
template<typename LHS, typename RHS, typename OP, typename S2>
void sum_cpu(viennacl::vector_expression<LHS, RHS, OP> const & vec,
S2 & result);
// forward definition of frobenius norm:
template<typename T>
void norm_frobenius_impl(matrix_base<T> const & vec, scalar<T> & result);
template<typename T>
void norm_frobenius_cpu(matrix_base<T> const & vec, T & result);
template<typename T>
vcl_size_t index_norm_inf(vector_base<T> const & vec);
template<typename LHS, typename RHS, typename OP>
vcl_size_t index_norm_inf(viennacl::vector_expression<LHS, RHS, OP> const & vec);
//forward definition of prod_impl functions
template<typename NumericT>
void prod_impl(const matrix_base<NumericT> & mat,
const vector_base<NumericT> & vec,
vector_base<NumericT> & result);
template<typename NumericT>
void prod_impl(const matrix_expression< const matrix_base<NumericT>, const matrix_base<NumericT>, op_trans> & mat_trans,
const vector_base<NumericT> & vec,
vector_base<NumericT> & result);
template<typename SparseMatrixType, class SCALARTYPE, unsigned int ALIGNMENT>
typename viennacl::enable_if< viennacl::is_any_sparse_matrix<SparseMatrixType>::value,
vector_expression<const SparseMatrixType,
const vector<SCALARTYPE, ALIGNMENT>,
op_prod >
>::type
prod_impl(const SparseMatrixType & mat,
const vector<SCALARTYPE, ALIGNMENT> & vec);
// forward definition of summation routines for matrices:
template<typename NumericT>
void row_sum_impl(const matrix_base<NumericT> & A,
vector_base<NumericT> & result);
template<typename NumericT>
void column_sum_impl(const matrix_base<NumericT> & A,
vector_base<NumericT> & result);
#endif
namespace detail
{
enum row_info_types
{
SPARSE_ROW_NORM_INF = 0,
SPARSE_ROW_NORM_1,
SPARSE_ROW_NORM_2,
SPARSE_ROW_DIAGONAL
};
}
struct lower_tag
{
static const char * name() { return "lower"; }
}; //lower triangular matrix
struct upper_tag
{
static const char * name() { return "upper"; }
}; //upper triangular matrix
struct unit_lower_tag
{
static const char * name() { return "unit_lower"; }
}; //unit lower triangular matrix
struct unit_upper_tag
{
static const char * name() { return "unit_upper"; }
}; //unit upper triangular matrix
//preconditioner tags
class ilut_tag;
class no_precond
{
public:
template<typename VectorType>
void apply(VectorType &) const {}
};
} //namespace linalg
//
// More namespace comments to follow:
//
namespace backend
{
namespace cpu_ram
{
namespace detail {}
}
namespace cuda
{
namespace detail {}
}
namespace detail {}
namespace opencl
{
namespace detail {}
}
}
namespace detail
{
namespace fft
{
namespace FFT_DATA_ORDER {}
}
}
namespace device_specific
{
namespace autotune {}
namespace detail {}
namespace profiles {}
namespace utils {}
}
namespace io
{
namespace detail {}
namespace tag {}
namespace val {}
}
namespace linalg
{
namespace cuda
{
namespace detail {}
}
namespace detail
{
namespace amg {}
namespace spai {}
}
namespace host_based
{
namespace detail {}
}
namespace kernels {}
namespace opencl
{
namespace detail {}
namespace kernels
{
namespace detail {}
}
}
}
namespace ocl {}
namespace result_of {}
namespace tools
{
namespace detail {}
}
namespace traits {}
namespace scheduler
{
namespace detail {}
namespace result_of {}
}
} //namespace viennacl
#endif
viennacl::linalg::norm_frobenius_cpu
void norm_frobenius_cpu(matrix_base< T > const &vec, T &result)
Computes the Frobenius norm of a vector with final reduction on the CPU.
Definition: matrix_operations.hpp:399
viennacl::hyb_matrix
Sparse matrix class using a hybrid format composed of the ELL and CSR format for storing the nonzeros...
Definition: forwards.h:406
viennacl::linalg::row_sum_impl
void row_sum_impl(const matrix_base< NumericT > &A, vector_base< NumericT > &result)
Definition: matrix_operations.hpp:679
viennacl::enable_if
Simple enable-if variant that uses the SFINAE pattern.
Definition: enable_if.hpp:30
viennacl::linalg::inner_prod_cpu
void inner_prod_cpu(viennacl::vector_expression< LHS1, RHS1, OP1 > const &vec1, viennacl::vector_expression< LHS2, RHS2, OP2 > const &vec2, S3 &result)
Definition: vector_operations.hpp:512
viennacl::op_mult
A tag class representing multiplication by a scalar.
Definition: forwards.h:92
viennacl::linalg::element_div
viennacl::vector_expression< const vector_base< T >, const vector_base< T >, op_element_binary< op_div > > element_div(vector_base< T > const &v1, vector_base< T > const &v2)
viennacl::op_cosh
A tag class representing the cosh() function.
Definition: forwards.h:155
viennacl::op_col_sum
A tag class representing the summation of all columns of a matrix.
Definition: forwards.h:122
viennacl::zero_on_diagonal_exception
Definition: forwards.h:597
viennacl::const_vector_iterator
A STL-type const-iterator for vector elements. Elements can be accessed, but cannot be manipulated...
Definition: forwards.h:245
viennacl::op_eq
A tag class representing equality.
Definition: forwards.h:103
viennacl::row_major::mem_index
static vcl_size_t mem_index(vcl_size_t i, vcl_size_t j, vcl_size_t, vcl_size_t num_cols)
Returns the memory offset for entry (i,j) of a dense matrix.
Definition: forwards.h:314
viennacl::cuda_not_available_exception
Definition: forwards.h:585
viennacl::op_tan
A tag class representing the tan() function.
Definition: forwards.h:181
viennacl::scalar
This class represents a single scalar value on the GPU and behaves mostly like a built-in scalar type...
Definition: forwards.h:227
viennacl::linalg::lower_tag::name
static const char * name()
Definition: forwards.h:851
viennacl::linalg::unit_lower_tag::name
static const char * name()
Definition: forwards.h:861
viennacl::linalg::detail::row_info_types
row_info_types
Definition: forwards.h:837
viennacl::linalg::detail::SPARSE_ROW_NORM_2
Definition: forwards.h:841
viennacl::const_entry_proxy
A proxy class for a single element of a vector or matrix. This proxy should not be noticed by end-use...
Definition: forwards.h:236
viennacl::op_sum
A tag class representing the summation of a vector.
Definition: forwards.h:116
viennacl::is_any_dense_matrix
Checks for either matrix_base or implicit_matrix_base.
Definition: forwards.h:480
viennacl::memory_exception
Exception class in case of memory errors.
Definition: forwards.h:572
viennacl::is_compressed_matrix
Helper class for checking whether a matrix is a compressed_matrix (CSR format)
Definition: forwards.h:491
viennacl::op_less
A tag class representing less-than.
Definition: forwards.h:109
viennacl::is_hyb_matrix
Helper class for checking whether a matrix is a hyb_matrix (hybrid format: ELL plus CSR) ...
Definition: forwards.h:520
viennacl::op_row_sum
A tag class representing the summation of all rows of a matrix.
Definition: forwards.h:119
viennacl::matrix_slice
Class for representing strided submatrices of a bigger matrix A.
Definition: forwards.h:443
viennacl::is_any_sparse_matrix
Helper class for checking whether the provided type is one of the sparse matrix types (compressed_mat...
Definition: forwards.h:527
viennacl::is_row_major
Helper class for checking whether a matrix has a row-major layout.
Definition: forwards.h:484
viennacl::is_flip_sign_scalar::value
Definition: forwards.h:464
viennacl::is_flip_sign_scalar
Helper struct for checking whether a type represents a sign flip on a viennacl::scalar<> ...
Definition: forwards.h:462
viennacl::op_column
A tag class representing the extraction of a matrix column to a vector.
Definition: forwards.h:195
viennacl::op_vector_diag
A tag class representing a matrix given by a vector placed on a certain (off-)diagonal.
Definition: forwards.h:189
viennacl::linalg::lower_tag
A tag class representing a lower triangular matrix.
Definition: forwards.h:849
viennacl::op_sub
A tag class representing subtraction.
Definition: forwards.h:90
viennacl::cuda_not_available_exception::cuda_not_available_exception
cuda_not_available_exception()
Definition: forwards.h:588
viennacl::op_assign
A tag class representing assignment.
Definition: forwards.h:81
viennacl::is_toeplitz_matrix
Helper class for checking whether a matrix is a Toeplitz matrix.
Definition: forwards.h:549
viennacl::OPENCL_MEMORY
Definition: forwards.h:349
viennacl::matrix_base
Definition: matrix_def.hpp:103
viennacl::op_abs
A tag class representing the modulus function for integers.
Definition: forwards.h:137
viennacl::matrix_expression
Expression template class for representing a tree of expressions which ultimately result in a matrix...
Definition: forwards.h:341
viennacl::op_ceil
A tag class representing the ceil() function.
Definition: forwards.h:151
viennacl::linalg::inner_prod_impl
void inner_prod_impl(viennacl::vector_expression< LHS1, RHS1, OP1 > const &vec1, viennacl::vector_expression< LHS2, RHS2, OP2 > const &vec2, scalar< T > &result)
Definition: vector_operations.hpp:440
viennacl::zero_vector
Definition: vector_def.hpp:93
viennacl::hankel_matrix
A Hankel matrix class.
Definition: forwards.h:412
viennacl::matrix
A dense matrix class.
Definition: forwards.h:375
viennacl::linalg::max_impl
void max_impl(viennacl::vector_expression< LHS, RHS, OP > const &vec, scalar< T > &result)
viennacl::op_div
A tag class representing division.
Definition: forwards.h:98
viennacl::identity_matrix
Represents a vector consisting of 1 at a given index and zeros otherwise. To be used as an initialize...
Definition: matrix_def.hpp:69
viennacl::linalg::norm_1_impl
void norm_1_impl(viennacl::vector_expression< LHS, RHS, OP > const &vec, scalar< T > &result)
viennacl::scalar_expression
A proxy for scalar expressions (e.g. from inner vector products)
Definition: forwards.h:230
viennacl::vector_expression
An expression template class that represents a binary operation that yields a vector.
Definition: forwards.h:239
viennacl::op_log
A tag class representing the log() function.
Definition: forwards.h:171
viennacl::memory_exception::memory_exception
memory_exception()
Definition: forwards.h:575
viennacl::memory_exception::memory_exception
memory_exception(std::string message)
Definition: forwards.h:576
viennacl::zero_on_diagonal_exception::zero_on_diagonal_exception
zero_on_diagonal_exception(std::string const &what_arg)
Definition: forwards.h:600
viennacl::op_inplace_add
A tag class representing inplace addition.
Definition: forwards.h:83
viennacl::op_tanh
A tag class representing the tanh() function.
Definition: forwards.h:183
viennacl::op_fabs
A tag class representing the fabs() function.
Definition: forwards.h:159
viennacl::op_max
A tag class representing the maximum of a vector.
Definition: forwards.h:210
viennacl::op_atan2
A tag class representing the atan2() function.
Definition: forwards.h:149
viennacl::vandermonde_matrix
A Vandermonde matrix class.
Definition: forwards.h:418
viennacl::op_matrix_diag
A tag class representing the (off-)diagonal of a matrix.
Definition: forwards.h:186
viennacl::context
Represents a generic 'context' similar to an OpenCL context, but is backend-agnostic and thus also su...
Definition: context.hpp:39
viennacl::op_atan
A tag class representing the atan() function.
Definition: forwards.h:147
viennacl::range
basic_range range
Definition: forwards.h:424
viennacl::is_sliced_ell_matrix
Helper class for checking whether a matrix is a sliced_ell_matrix (SELL-C- format) ...
Definition: forwards.h:512
viennacl::op_sinh
A tag class representing the sinh() function.
Definition: forwards.h:177
viennacl::linalg::norm_frobenius_impl
void norm_frobenius_impl(matrix_base< T > const &vec, scalar< T > &result)
Computes the Frobenius norm of a matrix - dispatcher interface.
Definition: matrix_operations.hpp:369
v1
viennacl::vector< float > v1
Definition: global_variables.cpp:60
viennacl::linalg::detail::SPARSE_ROW_NORM_INF
Definition: forwards.h:839
viennacl::is_any_vector
Checks for a type being either vector_base or implicit_vector_base.
Definition: forwards.h:476
viennacl::column_major::orientation_category
column_major_tag orientation_category
Definition: forwards.h:323
viennacl::implicit_matrix_base
Base class for representing matrices where the individual entries are not all stored explicitly...
Definition: matrix_def.hpp:35
viennacl::is_cpu_scalar
Helper struct for checking whether a type is a host scalar type (e.g. float, double) ...
Definition: forwards.h:448
viennacl::op_fmax
A tag class representing the fmax() function.
Definition: forwards.h:165
viennacl::vector_range
Class for representing non-strided subvectors of a bigger vector x.
Definition: forwards.h:434
viennacl::MEMORY_NOT_INITIALIZED
Definition: forwards.h:347
viennacl::is_circulant_matrix
Helper class for checking whether a matrix is a circulant matrix.
Definition: forwards.h:535
viennacl::ell_matrix
Sparse matrix class using the ELLPACK format for storing the nonzeros.
Definition: ell_matrix.hpp:53
viennacl::CUDA_MEMORY
Definition: forwards.h:350
viennacl::linalg::no_precond
A tag class representing the use of no preconditioner.
Definition: forwards.h:873
viennacl::op_fmod
A tag class representing the fmod() function.
Definition: forwards.h:169
viennacl::op_exp
A tag class representing the exp() function.
Definition: forwards.h:157
viennacl::op_geq
A tag class representing greater-than-or-equal-to.
Definition: forwards.h:111
viennacl::linalg::upper_tag
A tag class representing an upper triangular matrix.
Definition: forwards.h:854
viennacl::linalg::min_cpu
void min_cpu(viennacl::vector_expression< LHS, RHS, OP > const &vec, S2 &result)
Computes the supremum norm of a vector with final reduction on the CPU - interface for a vector expre...
Definition: vector_operations.hpp:1045
viennacl::vector_tuple
Tuple class holding pointers to multiple vectors. Mainly used as a temporary object returned from vie...
Definition: forwards.h:269
viennacl::cuda_not_available_exception::what
virtual const char * what() const
Definition: forwards.h:590
viennacl::is_any_scalar
Helper struct for checking whether the provided type represents a scalar (either host, from ViennaCL, or a flip-sign proxy)
Definition: forwards.h:469
viennacl::linalg::sum_impl
void sum_impl(viennacl::vector_expression< LHS, RHS, OP > const &vec, scalar< T > &result)
viennacl::sliced_ell_matrix
Sparse matrix class using the sliced ELLPACK with parameters C, .
Definition: forwards.h:403
viennacl::op_neq
A tag class representing inequality.
Definition: forwards.h:105
viennacl::vector_iterator
A STL-type iterator for vector elements. Elements can be accessed and manipulated. VERY SLOW!!
Definition: forwards.h:242
viennacl::linalg::sum_cpu
void sum_cpu(viennacl::vector_expression< LHS, RHS, OP > const &vec, S2 &result)
Computes the sum of a vector with final reduction on the CPU - interface for a vector expression...
Definition: vector_operations.hpp:1132
viennacl::op_leq
A tag class representing less-than-or-equal-to.
Definition: forwards.h:113
viennacl::is_cpu_scalar::value
Definition: forwards.h:450
viennacl::compressed_compressed_matrix
A sparse square matrix in compressed sparse rows format optimized for the case that only a few rows c...
Definition: compressed_compressed_matrix.hpp:265
viennacl::vector_slice
Class for representing strided subvectors of a bigger vector x.
Definition: forwards.h:437
viennacl::op_add
A tag class representing addition.
Definition: forwards.h:88
viennacl::scalar_matrix
Represents a vector consisting of scalars 's' only, i.e. v[i] = s for all i. To be used as an initial...
Definition: matrix_def.hpp:93
viennacl::vector_base
Common base class for dense vectors, vector ranges, and vector slices.
Definition: vector_def.hpp:104
viennacl::linalg::prod_impl
viennacl::enable_if< viennacl::is_any_sparse_matrix< SparseMatrixType >::value, vector_expression< const SparseMatrixType, const vector< SCALARTYPE, ALIGNMENT >, op_prod > >::type prod_impl(const SparseMatrixType &mat, const vector< SCALARTYPE, ALIGNMENT > &vec)
viennacl::op_sqrt
A tag class representing the sqrt() function.
Definition: forwards.h:179
viennacl::linalg::min_impl
void min_impl(viennacl::vector_expression< LHS, RHS, OP > const &vec, scalar< T > &result)
viennacl::column_major_tag
Tag class for indicating column-major layout of a matrix. Not passed to the matrix directly...
Definition: forwards.h:301
viennacl::op_mat_mat_prod
A tag class representing matrix-matrix products.
Definition: forwards.h:96
viennacl::linalg::index_norm_inf
vcl_size_t index_norm_inf(viennacl::vector_expression< LHS, RHS, OP > const &vec)
Computes the supremum norm of a vector with final reduction on the CPU - interface for a vector expre...
Definition: vector_operations.hpp:871
viennacl::vcl_size_t
std::size_t vcl_size_t
Definition: forwards.h:75
viennacl::linalg::unit_upper_tag::name
static const char * name()
Definition: forwards.h:866
viennacl::vector
Definition: forwards.h:266
viennacl::zero_matrix
Represents a vector consisting of zeros only. To be used as an initializer for viennacl::vector, vector_range, or vector_slize only.
Definition: matrix_def.hpp:81
viennacl::op_min
A tag class representing the minimum of a vector.
Definition: forwards.h:213
viennacl::linalg::norm_2_cpu
void norm_2_cpu(viennacl::vector_expression< LHS, RHS, OP > const &vec, S2 &result)
Computes the l^2-norm of a vector with final reduction on the CPU - interface for a vector expression...
Definition: vector_operations.hpp:736
viennacl::linalg::convolve_i
void convolve_i(viennacl::vector< SCALARTYPE, ALIGNMENT > &input1, viennacl::vector< SCALARTYPE, ALIGNMENT > &input2, viennacl::vector< SCALARTYPE, ALIGNMENT > &output)
viennacl::linalg::no_precond::apply
void apply(VectorType &) const
Definition: forwards.h:877
viennacl::op_sin
A tag class representing the sin() function.
Definition: forwards.h:175
viennacl::linalg::norm_2_impl
void norm_2_impl(viennacl::vector_expression< LHS, RHS, OP > const &vec, scalar< T > &result)
Computes the l^2-norm of a vector - interface for a vector expression. Creates a temporary.
Definition: vector_operations.hpp:691
viennacl::tools::MATRIX_ITERATOR_INCREMENTER::ErrorIndicator
MATRIXTYPE::ERROR_SPECIALIZATION_FOR_THIS_MATRIX_TYPE_MISSING ErrorIndicator
Definition: forwards.h:619
viennacl::MAIN_MEMORY
Definition: forwards.h:348
viennacl::is_hankel_matrix
Helper class for checking whether a matrix is a Hankel matrix.
Definition: forwards.h:542
viennacl::op_fmin
A tag class representing the fmin() function.
Definition: forwards.h:167
viennacl::op_inplace_sub
A tag class representing inplace subtraction.
Definition: forwards.h:85
viennacl::is_any_dense_structured_matrix
Helper class for checking whether the provided type is any of the dense structured matrix types (circ...
Definition: forwards.h:563
viennacl::op_norm_1
A tag class representing the 1-norm of a vector.
Definition: forwards.h:201
viennacl::op_prod
A tag class representing matrix-vector products and element-wise multiplications. ...
Definition: forwards.h:94
viennacl::is_scalar
Helper struct for checking whether a type is a viennacl::scalar<>
Definition: forwards.h:455
viennacl::is_any_scalar::value
Definition: forwards.h:471
viennacl::linalg::norm_1_cpu
void norm_1_cpu(viennacl::vector_expression< LHS, RHS, OP > const &vec, S2 &result)
Computes the l^1-norm of a vector with final reduction on the CPU - interface for a vector expression...
Definition: vector_operations.hpp:644
viennacl::row_major_tag
Tag class for indicating row-major layout of a matrix. Not passed to the matrix directly, see row_major type.
Definition: forwards.h:299
viennacl::unit_vector
Represents a vector consisting of 1 at a given index and zeros otherwise.
Definition: vector_def.hpp:76
v2
viennacl::vector< int > v2
Definition: global_variables.cpp:61
viennacl::one_vector
Definition: forwards.h:257
viennacl::matrix_iterator
A dense matrix class.
Definition: forwards.h:369
viennacl::slice
basic_slice slice
Definition: forwards.h:429
viennacl::linalg::detail::SPARSE_ROW_DIAGONAL
Definition: forwards.h:842
viennacl::scalar_vector
Represents a vector consisting of scalars 's' only, i.e. v[i] = s for all i. To be used as an initial...
Definition: vector_def.hpp:87
viennacl::copy
void copy(std::vector< NumericT > &cpu_vec, circulant_matrix< NumericT, AlignmentV > &gpu_mat)
Copies a circulant matrix from the std::vector to the OpenCL device (either GPU or multi-core CPU) ...
Definition: circulant_matrix.hpp:150
viennacl::op_floor
A tag class representing the floor() function.
Definition: forwards.h:163
viennacl::op_asin
A tag class representing the asin() function.
Definition: forwards.h:141
viennacl::is_scalar::value
Definition: forwards.h:457
viennacl::basic_range
A range class that refers to an interval [start, stop), where 'start' is included, and 'stop' is excluded.
Definition: forwards.h:424
viennacl::memory_exception::what
virtual const char * what() const
Definition: forwards.h:578
viennacl::linalg::unit_lower_tag
A tag class representing a lower triangular matrix with unit diagonal.
Definition: forwards.h:859
viennacl::linalg::element_prod
viennacl::vector_expression< const vector_base< T >, const vector_base< T >, op_element_binary< op_prod > > element_prod(vector_base< T > const &v1, vector_base< T > const &v2)
viennacl::toeplitz_matrix
A Toeplitz matrix class.
Definition: forwards.h:415
viennacl::op_argmax
A tag class for representing the argmax() function.
Definition: forwards.h:143
viennacl::op_trans
A tag class representing transposed matrices.
Definition: forwards.h:220
viennacl::compressed_matrix
A sparse square matrix in compressed sparse rows format.
Definition: compressed_matrix.hpp:559
viennacl::linalg::detail::SPARSE_ROW_NORM_1
Definition: forwards.h:840
viennacl::op_norm_frobenius
A tag class representing the Frobenius-norm of a matrix.
Definition: forwards.h:217
viennacl::column_major
A tag for column-major storage of a dense matrix.
Definition: forwards.h:321
viennacl::op_element_binary
A tag class representing element-wise binary operations (like multiplication) on vectors or matrices...
Definition: forwards.h:130
viennacl::unknown_norm_exception
Definition: forwards.h:603
viennacl::circulant_matrix
A Circulant matrix class.
Definition: circulant_matrix.hpp:41
viennacl::matrix_range
Class for representing non-strided submatrices of a bigger matrix A.
Definition: forwards.h:440
viennacl::is_coordinate_matrix
Helper class for checking whether a matrix is a coordinate_matrix (COO format)
Definition: forwards.h:498
viennacl::linalg::upper_tag::name
static const char * name()
Definition: forwards.h:856
viennacl::tools::MATRIX_ITERATOR_INCREMENTER
Helper class for incrementing an iterator in a dense matrix.
Definition: forwards.h:617
viennacl::column_major::mem_index
static vcl_size_t mem_index(vcl_size_t i, vcl_size_t j, vcl_size_t num_rows, vcl_size_t)
Returns the memory offset for entry (i,j) of a dense matrix.
Definition: forwards.h:331
viennacl::linalg::norm_inf_cpu
void norm_inf_cpu(viennacl::vector_expression< LHS, RHS, OP > const &vec, S2 &result)
Computes the supremum norm of a vector with final reduction on the CPU - interface for a vector expre...
Definition: vector_operations.hpp:828
viennacl::implicit_vector_base
Common base class for representing vectors where the entries are not all stored explicitly.
Definition: vector_def.hpp:36
viennacl::op_flip_sign
A tag class representing sign flips (for scalars only. Vectors and matrices use the standard multipli...
Definition: forwards.h:223
viennacl::is_vandermonde_matrix
Helper class for checking whether a matrix is a Vandermonde matrix.
Definition: forwards.h:556
viennacl::op_acos
A tag class representing the acos() function.
Definition: forwards.h:139
viennacl::memory_types
memory_types
Definition: forwards.h:345
viennacl::op_fdim
A tag class representing the fdim() function.
Definition: forwards.h:161
viennacl::op_inner_prod
A tag class representing inner products of two vectors.
Definition: forwards.h:198
viennacl::op_row
A tag class representing the extraction of a matrix row to a vector.
Definition: forwards.h:192
viennacl::op_pow
A tag class representing the power function.
Definition: forwards.h:100
viennacl::basic_slice
A slice class that refers to an interval [start, stop), where 'start' is included, and 'stop' is excluded.
Definition: forwards.h:429
viennacl::entry_proxy
A proxy class for a single element of a vector or matrix. This proxy should not be noticed by end-use...
Definition: forwards.h:233
viennacl::op_norm_inf
A tag class representing the inf-norm of a vector.
Definition: forwards.h:207
viennacl::op_log10
A tag class representing the log10() function.
Definition: forwards.h:173
viennacl::op_element_unary
A tag class representing element-wise unary operations (like sin()) on vectors or matrices...
Definition: forwards.h:134
viennacl::linalg::norm_inf_impl
void norm_inf_impl(viennacl::vector_expression< LHS, RHS, OP > const &vec, scalar< T > &result)
Computes the supremum norm of a vector - interface for a vector expression. Creates a temporary...
Definition: vector_operations.hpp:783
viennacl::tools::MATRIX_ITERATOR_INCREMENTER::apply
static void apply(const MATRIXTYPE &, unsigned int &, unsigned int &)
Definition: forwards.h:621
viennacl::cuda_not_available_exception::~cuda_not_available_exception
virtual ~cuda_not_available_exception()
Definition: forwards.h:592
viennacl::op_norm_2
A tag class representing the 2-norm of a vector.
Definition: forwards.h:204
version.hpp
Provides version information for detecting different versions of ViennaCL.
viennacl::linalg::max_cpu
void max_cpu(viennacl::vector_expression< LHS, RHS, OP > const &vec, S2 &result)
Computes the supremum norm of a vector with final reduction on the CPU - interface for a vector expre...
Definition: vector_operations.hpp:958
viennacl::row_major
A tag for row-major storage of a dense matrix.
Definition: forwards.h:304
viennacl::op_argmin
A tag class for representing the argmin() function.
Definition: forwards.h:145
viennacl::is_ell_matrix
Helper class for checking whether a matrix is an ell_matrix (ELL format)
Definition: forwards.h:505
viennacl::op_greater
A tag class representing greater-than.
Definition: forwards.h:107
viennacl::op_cos
A tag class representing the cos() function.
Definition: forwards.h:153
viennacl::row_major::orientation_category
row_major_tag orientation_category
Definition: forwards.h:306
enable_if.hpp
Simple enable-if variant that uses the SFINAE pattern.
viennacl::linalg::unit_upper_tag
A tag class representing an upper triangular matrix with unit diagonal.
Definition: forwards.h:864
viennacl::vcl_ptrdiff_t
std::ptrdiff_t vcl_ptrdiff_t
Definition: forwards.h:76
viennacl::unknown_norm_exception::unknown_norm_exception
unknown_norm_exception(std::string const &what_arg)
Definition: forwards.h:606
viennacl::coordinate_matrix
A sparse square matrix, where entries are stored as triplets (i,j, val), where i and j are the row an...
Definition: coordinate_matrix.hpp:186
viennacl::linalg::column_sum_impl
void column_sum_impl(const matrix_base< NumericT > &A, vector_base< NumericT > &result)
Definition: matrix_operations.hpp:686
fft
ScalarType fft(std::vector< ScalarType > &in, std::vector< ScalarType > &out, unsigned int, unsigned int, unsigned int batch_size)
Definition: fft_1d.cpp:719
viennacl::memory_exception::~memory_exception
virtual ~memory_exception()
Definition: forwards.h:580
viennacl::op_element_cast
A tag class representing element-wise casting operations on vectors and matrices. ...
Definition: forwards.h:126
viennacl::fast_copy
void fast_copy(const const_vector_iterator< SCALARTYPE, ALIGNMENT > &gpu_begin, const const_vector_iterator< SCALARTYPE, ALIGNMENT > &gpu_end, CPU_ITERATOR cpu_begin)