Public Member Functions

circulant_matrix< SCALARTYPE, ALIGNMENT > Class Template Reference

A Circulant matrix class. More...

#include <circulant_matrix.hpp>

Public Member Functions

 circulant_matrix ()
 The default constructor. Does not allocate any memory.
 circulant_matrix (std::size_t rows, std::size_t cols)
 Creates the matrix with the given size.
void resize (size_t sz, bool preserve=true)
 Resizes the matrix. Existing entries can be preserved.
viennacl::ocl::handle< cl_mem > handle () const
 Returns the OpenCL handle.
viennacl::vector< SCALARTYPE,
ALIGNMENT > & 
elements ()
 Returns an internal viennacl::vector, which represents a circulant matrix elements.
viennacl::vector< SCALARTYPE,
ALIGNMENT > const & 
elements () const
std::size_t size1 () const
 Returns the number of rows of the matrix.
std::size_t size2 () const
 Returns the number of columns of the matrix.
std::size_t internal_size () const
 Returns the internal size of matrix representtion. Usually required for launching OpenCL kernels only.
entry_proxy< SCALARTYPE > operator() (std::size_t row_index, std::size_t col_index)
 Read-write access to a single element of the matrix.
circulant_matrix< SCALARTYPE,
ALIGNMENT > & 
operator+= (circulant_matrix< SCALARTYPE, ALIGNMENT > &that)
 += operation for circulant matrices

Detailed Description

template<class SCALARTYPE, unsigned int ALIGNMENT>
class viennacl::circulant_matrix< SCALARTYPE, ALIGNMENT >

A Circulant matrix class.

Template Parameters:
SCALARTYPE The underlying scalar type (either float or double)
ALIGNMENT The internal memory size is given by (size()/ALIGNMENT + 1) * ALIGNMENT. ALIGNMENT must be a power of two. Best values or usually 4, 8 or 16, higher values are usually a waste of memory.

Constructor & Destructor Documentation

circulant_matrix (  )  [inline, explicit]

The default constructor. Does not allocate any memory.

circulant_matrix ( std::size_t  rows,
std::size_t  cols 
) [inline, explicit]

Creates the matrix with the given size.

Parameters:
rows Number of rows of the matrix
cols Number of columns of the matrix

Member Function Documentation

viennacl::vector<SCALARTYPE, ALIGNMENT>& elements (  )  [inline]

Returns an internal viennacl::vector, which represents a circulant matrix elements.

viennacl::vector<SCALARTYPE, ALIGNMENT> const& elements (  )  const [inline]
viennacl::ocl::handle<cl_mem> handle (  )  const [inline]

Returns the OpenCL handle.

Returns:
OpenCL handle
std::size_t internal_size (  )  const [inline]

Returns the internal size of matrix representtion. Usually required for launching OpenCL kernels only.

Returns:
Internal size of matrix representation
entry_proxy<SCALARTYPE> operator() ( std::size_t  row_index,
std::size_t  col_index 
) [inline]

Read-write access to a single element of the matrix.

Parameters:
row_index Row index of accessed element
col_index Column index of accessed element
Returns:
Proxy for matrix entry
circulant_matrix<SCALARTYPE, ALIGNMENT>& operator+= ( circulant_matrix< SCALARTYPE, ALIGNMENT > &  that  )  [inline]

+= operation for circulant matrices

Parameters:
that Matrix which will be added
Returns:
Result of addition
void resize ( size_t  sz,
bool  preserve = true 
) [inline]

Resizes the matrix. Existing entries can be preserved.

Parameters:
sz New size of matrix
preserve If true, existing values are preserved.
std::size_t size1 (  )  const [inline]

Returns the number of rows of the matrix.

std::size_t size2 (  )  const [inline]

Returns the number of columns of the matrix.


The documentation for this class was generated from the following file: