Namespaces | Functions

/data/development/ViennaCL/dev/viennacl/linalg/matrix_operations.hpp File Reference

Implementations of dense matrix related operations. also matrix-vector products. More...

#include "viennacl/forwards.h"
#include "viennacl/ocl/device.hpp"
#include "viennacl/ocl/handle.hpp"
#include "viennacl/ocl/kernel.hpp"
#include "viennacl/scalar.hpp"
#include "viennacl/vector.hpp"
#include "viennacl/tools/tools.hpp"
#include "viennacl/meta/predicate.hpp"
#include "viennacl/traits/size.hpp"
#include "viennacl/traits/start.hpp"
#include "viennacl/traits/handle.hpp"
#include "viennacl/tools/matrix_kernel_class_deducer.hpp"
#include "viennacl/tools/matrix_prod_kernel_class_deducer.hpp"
#include "viennacl/linalg/kernels/vector_kernels.h"
#include "viennacl/linalg/kernels/matrix_row_kernels.h"
#include "viennacl/linalg/kernels/matrix_col_kernels.h"
#include "viennacl/linalg/kernels/matrix_prod_col_col_col_kernels.h"
#include "viennacl/linalg/kernels/matrix_prod_col_col_row_kernels.h"
#include "viennacl/linalg/kernels/matrix_prod_col_row_col_kernels.h"
#include "viennacl/linalg/kernels/matrix_prod_col_row_row_kernels.h"
#include "viennacl/linalg/kernels/matrix_prod_row_col_col_kernels.h"
#include "viennacl/linalg/kernels/matrix_prod_row_col_row_kernels.h"
#include "viennacl/linalg/kernels/matrix_prod_row_row_col_kernels.h"
#include "viennacl/linalg/kernels/matrix_prod_row_row_row_kernels.h"

Go to the source code of this file.

Namespaces

namespace  viennacl
namespace  viennacl::linalg

Functions

template<class TYPE , typename F , unsigned int ALIGNMENT>
void add (const viennacl::matrix< TYPE, F, ALIGNMENT > &mat1, const viennacl::matrix< TYPE, F, ALIGNMENT > &mat2, viennacl::matrix< TYPE, F, ALIGNMENT > &result)
 Adds two dense matrices and writes the result to a third matrix.
template<typename M1 , typename M2 >
viennacl::enable_if
< viennacl::is_matrix< M1 >
::value &&viennacl::is_matrix
< M2 >::value >::type 
inplace_add (M1 &result, M2 const &mat2)
 Adds a dense matrix to another.
template<class TYPE , typename F , unsigned int ALIGNMENT>
void sub (const viennacl::matrix< TYPE, F, ALIGNMENT > &mat1, const viennacl::matrix< TYPE, F, ALIGNMENT > &mat2, viennacl::matrix< TYPE, F, ALIGNMENT > &result)
 Adds a dense matrix to another.
template<class TYPE , typename F , unsigned int ALIGNMENT>
void inplace_sub (viennacl::matrix< TYPE, F, ALIGNMENT > &result, const viennacl::matrix< TYPE, F, ALIGNMENT > &mat2)
 Subtracts a dense matrix from another.
template<class SCALARTYPE , typename F , unsigned int ALIGNMENT>
void inplace_mult (viennacl::matrix< SCALARTYPE, F, ALIGNMENT > &result, SCALARTYPE val)
 Multiplies a dense matrix by a scalar.
template<class SCALARTYPE , typename F , unsigned int ALIGNMENT>
void inplace_mult (viennacl::matrix< SCALARTYPE, F, ALIGNMENT > &result, viennacl::scalar< SCALARTYPE > const &val)
 Multiplies a dense matrix by a scalar.
template<class SCALARTYPE , typename F , unsigned int ALIGNMENT>
void inplace_divide (viennacl::matrix< SCALARTYPE, F, ALIGNMENT > &result, viennacl::scalar< SCALARTYPE > const &val)
 Multiplies a dense matrix by a scalar.
template<class SCALARTYPE , typename F , unsigned int ALIGNMENT, unsigned int VECTOR_ALIGNMENT>
viennacl::vector_expression
< const viennacl::matrix
< SCALARTYPE, F, ALIGNMENT >
, const viennacl::vector
< SCALARTYPE, VECTOR_ALIGNMENT >
, op_prod > 
prod_impl (const viennacl::matrix< SCALARTYPE, F, ALIGNMENT > &mat, const viennacl::vector< SCALARTYPE, VECTOR_ALIGNMENT > &vec)
 Returns a proxy class that represents matrix-vector multiplication.
template<class TYPE , typename F , unsigned int ALIGNMENT, unsigned int VECTOR_ALIGNMENT>
void prod_impl (const viennacl::matrix< TYPE, F, ALIGNMENT > &mat, const viennacl::vector< TYPE, VECTOR_ALIGNMENT > &vec, viennacl::vector< TYPE, VECTOR_ALIGNMENT > &result)
 Carries out matrix-vector multiplication.
template<class SCALARTYPE , typename F , unsigned int ALIGNMENT, unsigned int VECTOR_ALIGNMENT>
viennacl::vector_expression
< const
viennacl::matrix_expression
< const matrix< SCALARTYPE, F,
ALIGNMENT >, const matrix
< SCALARTYPE, F, ALIGNMENT >
, op_trans >, const
viennacl::vector< SCALARTYPE,
VECTOR_ALIGNMENT >, op_prod > 
prod_impl (const viennacl::matrix_expression< const matrix< SCALARTYPE, F, ALIGNMENT >, const matrix< SCALARTYPE, F, ALIGNMENT >, op_trans > &proxy, const viennacl::vector< SCALARTYPE, VECTOR_ALIGNMENT > &vec)
 Returns a proxy class that represents matrix-vector multiplication with a transposed matrix.
template<class SCALARTYPE , typename F , unsigned int ALIGNMENT, unsigned int VECTOR_ALIGNMENT>
void prod_impl (const viennacl::matrix_expression< const matrix< SCALARTYPE, F, ALIGNMENT >, const matrix< SCALARTYPE, F, ALIGNMENT >, op_trans > &mat, const viennacl::vector< SCALARTYPE, VECTOR_ALIGNMENT > &vec, viennacl::vector< SCALARTYPE, VECTOR_ALIGNMENT > &result)
 Unwraps the transposed matrix proxy and forwards to trans_prod_impl().
template<class SCALARTYPE , typename F , unsigned int ALIGNMENT, unsigned int VECTOR_ALIGNMENT>
void trans_prod_impl (const matrix< SCALARTYPE, F, ALIGNMENT > &mat, const viennacl::vector< SCALARTYPE, VECTOR_ALIGNMENT > &vec, viennacl::vector< SCALARTYPE, VECTOR_ALIGNMENT > &result)
 Carries out matrix-vector multiplication with a transposed matrix.
template<class TYPE , typename F1 , typename F2 , typename F3 , unsigned int ALIGNMENT>
void prod_impl (const viennacl::matrix< TYPE, F1, ALIGNMENT > &A, const viennacl::matrix< TYPE, F2, ALIGNMENT > &B, viennacl::matrix< TYPE, F3, ALIGNMENT > &C, int block_size=15)
 Carries out matrix-matrix multiplication.
template<typename T1 , typename T2 , typename T3 >
void prod_impl (const viennacl::matrix_range< T1 > &A, const viennacl::matrix_range< T2 > &B, viennacl::matrix_range< T3 > &C, int block_size=15)
 Carries out matrix-matrix multiplication for submatrices.
template<class TYPE , typename F1 , typename F2 , typename F3 , unsigned int ALIGNMENT>
void prod_impl (const viennacl::matrix_expression< const matrix< TYPE, F1, ALIGNMENT >, const matrix< TYPE, F1, ALIGNMENT >, op_trans > &A, const viennacl::matrix< TYPE, F2, ALIGNMENT > &B, viennacl::matrix< TYPE, F3, ALIGNMENT > &C)
 Carries out matrix-matrix multiplication.
template<typename M1 , typename M2 , typename M3 >
void prod_impl (const viennacl::matrix_expression< const matrix_range< M1 >, const matrix_range< M1 >, op_trans > &A_trans, const viennacl::matrix_range< M2 > &B, viennacl::matrix_range< M3 > &C)
 Carries out matrix-matrix multiplication for submatrices.
template<class TYPE , typename F1 , typename F2 , typename F3 , unsigned int ALIGNMENT>
void prod_impl (const viennacl::matrix< TYPE, F1, ALIGNMENT > &A, const viennacl::matrix_expression< const matrix< TYPE, F2, ALIGNMENT >, const matrix< TYPE, F2, ALIGNMENT >, op_trans > &B, viennacl::matrix< TYPE, F3, ALIGNMENT > &C)
 Carries out matrix-matrix multiplication.
template<typename M1 , typename M2 , typename M3 >
void prod_impl (const viennacl::matrix_range< M1 > &A, const viennacl::matrix_expression< const matrix_range< M2 >, const matrix_range< M2 >, op_trans > &B_trans, viennacl::matrix_range< M3 > &C)
 Carries out matrix-matrix multiplication for submatrices.
template<class TYPE , typename F1 , typename F2 , typename F3 , unsigned int ALIGNMENT>
void prod_impl (const viennacl::matrix_expression< const matrix< TYPE, F1, ALIGNMENT >, const matrix< TYPE, F1, ALIGNMENT >, op_trans > &A, const viennacl::matrix_expression< const matrix< TYPE, F2, ALIGNMENT >, const matrix< TYPE, F2, ALIGNMENT >, op_trans > &B, viennacl::matrix< TYPE, F3, ALIGNMENT > &C)
 Carries out matrix-matrix multiplication.
template<typename M1 , typename M2 , typename M3 >
void prod_impl (const viennacl::matrix_expression< const matrix_range< M1 >, const matrix_range< M1 >, op_trans > &A_trans, const viennacl::matrix_expression< const matrix_range< M2 >, const matrix_range< M2 >, op_trans > &B_trans, viennacl::matrix_range< M3 > &C)
 Carries out matrix-matrix multiplication for submatrices.
template<class SCALARTYPE , unsigned int VA1, unsigned int VA2>
viennacl::matrix_expression
< const viennacl::vector
< SCALARTYPE, VA1 >, const
viennacl::vector< SCALARTYPE,
VA2 >, op_prod > 
outer_prod (const viennacl::vector< SCALARTYPE, VA1 > &vec1, const viennacl::vector< SCALARTYPE, VA2 > &vec2)
 Returns a proxy class for the operation mat += vec1 * vec2^T, i.e. a rank 1 update.
template<class SCALARTYPE , typename F , unsigned int ALIGNMENT>
void rank_1_update (viennacl::matrix< SCALARTYPE, F, ALIGNMENT > &mat1, const viennacl::vector< SCALARTYPE, ALIGNMENT > &vec1, const viennacl::vector< SCALARTYPE, ALIGNMENT > &vec2)
 The implementation of the operation mat += vec1 * vec2^T, i.e. a rank 1 update.
template<class SCALARTYPE , typename F , unsigned int ALIGNMENT>
void scaled_rank_1_update (viennacl::matrix< SCALARTYPE, F, ALIGNMENT > &mat1, SCALARTYPE val, const viennacl::vector< SCALARTYPE, ALIGNMENT > &vec1, const viennacl::vector< SCALARTYPE, ALIGNMENT > &vec2)
 The implementation of the operation mat += alpha * vec1 * vec2^T, i.e. a scaled rank 1 update.

Detailed Description

Implementations of dense matrix related operations. also matrix-vector products.