1 #ifndef VIENNACL_TOOLS_MATRIX_SIZE_DEDUCER_HPP_
2 #define VIENNACL_TOOLS_MATRIX_SIZE_DEDUCER_HPP_
46 template<
typename LHS,
typename RHS,
typename OP>
56 template<
typename ScalarType>
70 template<
typename LHS,
typename RHS,
typename OP,
typename ScalarType>
71 struct MATRIX_SIZE_DEDUCER<const
viennacl::matrix_expression<const LHS, const RHS, OP>,
83 template<
typename T,
typename ScalarType>
84 struct MATRIX_SIZE_DEDUCER<const
viennacl::matrix_base<T>,
97 template<
typename LHS,
typename RHS,
typename OP,
typename ScalarType>
98 struct MATRIX_SIZE_DEDUCER<const
viennacl::matrix_expression<const LHS, const RHS, OP>,
110 template<
typename T,
typename ScalarType>
111 struct MATRIX_SIZE_DEDUCER<const
viennacl::matrix_base<T>,
124 struct MATRIX_SIZE_DEDUCER<const
viennacl::vector_base<T>,
129 const int k) {
return lhs.
size() +
static_cast<vcl_size_t>(std::fabs(
double(k))); }
132 const int k) {
return lhs.
size() +
static_cast<vcl_size_t>(std::fabs(
double(k))); }
136 template<
typename MatrixType>
137 struct MATRIX_SIZE_DEDUCER<MatrixType,
142 const MatrixType & ) {
return lhs.size2(); }
144 const MatrixType & ) {
return lhs.size1(); }
148 template<
typename ScalarType,
typename T1>
149 struct MATRIX_SIZE_DEDUCER<const
viennacl::matrix_expression<T1,
156 op_trans>
const & lhs,
166 template<
typename ScalarType,
typename T2>
167 struct MATRIX_SIZE_DEDUCER<const
viennacl::matrix_base<ScalarType>,
175 op_trans>
const & ) {
return lhs.
size1(); }
179 op_trans>
const & rhs) {
return rhs.lhs().size1(); }
183 template<
typename T1,
typename T2>
184 struct MATRIX_SIZE_DEDUCER<const
viennacl::matrix_expression<T1,
194 RHSType
const & ) {
return lhs.lhs().size2(); }
196 RHSType
const & rhs) {
return rhs.lhs().size1(); }
A tag class representing multiplication by a scalar.
Adapter classes for sparse matrices made of the STL type std::vector >
A tag class representing a matrix given by a vector placed on a certain (off-)diagonal.
Expression template class for representing a tree of expressions which ultimately result in a matrix...
This file provides the forward declarations for the main types used within ViennaCL.
A tag class representing division.
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
Common base class for dense vectors, vector ranges, and vector slices.
A tag class representing matrix-matrix products.
size_type size2() const
Returns the number of columns.
size_type size1() const
Returns the number of rows.
RHS & rhs() const
Get right hand side operand.
A tag class representing matrix-vector products and element-wise multiplications. ...
size_type size() const
Returns the length of the vector (cf. std::vector)
LHS & lhs() const
Get left hand side operand.