ViennaCL - The Vienna Computing Library  1.5.0
Public Types | Public Member Functions
matrix< SCALARTYPE, F, ALIGNMENT > Class Template Reference

A dense matrix class. More...

#include <matrix.hpp>

Inheritance diagram for matrix< SCALARTYPE, F, ALIGNMENT >:
matrix_base< SCALARTYPE, F >

Public Types

typedef base_type::size_type size_type

Public Member Functions

 matrix ()
 The default constructor. Does not allocate any memory.
 matrix (size_type rows, size_type columns, viennacl::context ctx=viennacl::context())
 Creates the matrix with the given dimensions.
template<typename LHS , typename RHS , typename OP >
 matrix (matrix_expression< LHS, RHS, OP > const &proxy)
 matrix (identity_matrix< SCALARTYPE > const &m)
 Creates the matrix from the supplied identity matrix.
 matrix (zero_matrix< SCALARTYPE > const &m)
 Creates the matrix from the supplied zero matrix.
 matrix (scalar_matrix< SCALARTYPE > const &m)
 Creates the matrix from the supplied scalar matrix.
 matrix (const base_type &other)
 matrix (const self_type &other)
void resize (size_type rows, size_type columns, bool preserve=true)
 Resizes the matrix. Existing entries can optionally be preserved.

Detailed Description

template<class SCALARTYPE, typename F, unsigned int ALIGNMENT>
class viennacl::matrix< SCALARTYPE, F, ALIGNMENT >

A dense matrix class.

Template Parameters:
SCALARTYPEThe underlying scalar type (either float or double)
FStorage layout: Either row_major or column_major (at present only row_major is supported)
ALIGNMENTThe 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.

Member Typedef Documentation

Reimplemented from matrix_base< SCALARTYPE, F >.


Constructor & Destructor Documentation

matrix ( ) [inline, explicit]

The default constructor. Does not allocate any memory.

matrix ( size_type  rows,
size_type  columns,
viennacl::context  ctx = viennacl::context() 
) [inline, explicit]

Creates the matrix with the given dimensions.

Parameters:
rowsNumber of rows
columnsNumber of columns
ctxOptional context in which the matrix is created (one out of multiple OpenCL contexts, CUDA, host)
matrix ( matrix_expression< LHS, RHS, OP > const &  proxy) [inline]
matrix ( identity_matrix< SCALARTYPE > const &  m) [inline]

Creates the matrix from the supplied identity matrix.

matrix ( zero_matrix< SCALARTYPE > const &  m) [inline]

Creates the matrix from the supplied zero matrix.

matrix ( scalar_matrix< SCALARTYPE > const &  m) [inline]

Creates the matrix from the supplied scalar matrix.

matrix ( const base_type other) [inline]
matrix ( const self_type other) [inline]

Member Function Documentation

void resize ( size_type  rows,
size_type  columns,
bool  preserve = true 
) [inline]

Resizes the matrix. Existing entries can optionally be preserved.

Parameters:
rowsNew number of rows
columnsNew number of columns
preserveIf true, existing values are preserved.

Reimplemented from matrix_base< SCALARTYPE, F >.


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