1 #ifndef VIENNACL_LINALG_LU_HPP
2 #define VIENNACL_LINALG_LU_HPP
41 template<
typename NumericT>
48 std::vector<NumericT> temp_buffer(A.
internal_size2() * max_block_size);
51 for (
vcl_size_t panel_id = 0; panel_id < num_blocks; ++panel_id)
53 vcl_size_t row_start = panel_id * max_block_size;
54 vcl_size_t current_block_size = std::min<vcl_size_t>(A.
size1() - row_start, max_block_size);
71 for (
vcl_size_t k=0; k < current_block_size - 1; ++k)
73 for (
vcl_size_t i=k+1; i < current_block_size; ++i)
90 if (remainder_range.size() > 0)
117 template<
typename NumericT>
124 std::vector<NumericT> temp_buffer(A.
internal_size1() * max_block_size);
127 for (
vcl_size_t panel_id = 0; panel_id < num_blocks; ++panel_id)
129 vcl_size_t col_start = panel_id * max_block_size;
130 vcl_size_t current_block_size = std::min<vcl_size_t>(A.
size1() - col_start, max_block_size);
132 viennacl::range block_range(col_start, col_start + current_block_size);
147 for (
vcl_size_t k=0; k < current_block_size; ++k)
153 for (
vcl_size_t j=k+1; j < current_block_size; ++j)
167 if (remainder_range.size() > 0)
200 template<
typename NumericT,
typename F1,
typename F2,
unsigned int AlignmentV1,
unsigned int AlignmentV2>
204 assert(A.
size1() == A.
size2() && bool(
"Matrix must be square"));
205 assert(A.
size1() == B.
size1() && bool(
"Matrix must be square"));
215 template<
typename NumericT,
typename F,
unsigned int MatAlignmentV,
unsigned int VecAlignmentV>
219 assert(A.
size1() == A.
size2() && bool(
"Matrix must be square"));
void inplace_solve(const matrix_base< NumericT > &A, matrix_base< NumericT > &B, SolverTagT)
Direct inplace solver for triangular systems with multiple right hand sides, i.e. A \ B (MATLAB notat...
void memory_write(mem_handle &dst_buffer, vcl_size_t dst_offset, vcl_size_t bytes_to_write, const void *ptr, bool async=false)
Writes data from main RAM identified by 'ptr' to the buffer identified by 'dst_buffer'.
Generic interface for matrix-vector and matrix-matrix products. See viennacl/linalg/vector_operations...
Implementation of the dense matrix class.
void lu_substitute(matrix< NumericT, F1, AlignmentV1 > const &A, matrix< NumericT, F2, AlignmentV2 > &B)
LU substitution for the system LU = rhs.
A tag class representing a lower triangular matrix.
void memory_read(mem_handle const &src_buffer, vcl_size_t src_offset, vcl_size_t bytes_to_read, void *ptr, bool async=false)
Reads data from a buffer back to main RAM.
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
VectorT prod(std::vector< std::vector< T, A1 >, A2 > const &matrix, VectorT const &vector)
A tag class representing an upper triangular matrix.
size_type size2() const
Returns the number of columns.
handle_type & handle()
Returns the OpenCL handle, non-const-version.
void trans(const matrix_expression< const matrix_base< NumericT, SizeT, DistanceT >, const matrix_base< NumericT, SizeT, DistanceT >, op_trans > &proxy, matrix_base< NumericT > &temp_trans)
size_type size1() const
Returns the number of rows.
Implementations of dense direct solvers are found here.
Proxy classes for matrices.
A range class that refers to an interval [start, stop), where 'start' is included, and 'stop' is excluded.
A tag class representing a lower triangular matrix with unit diagonal.
size_type internal_size2() const
Returns the internal number of columns. Usually required for launching OpenCL kernels only...
Class for representing non-strided submatrices of a bigger matrix A.
size_type internal_size1() const
Returns the internal number of rows. Usually required for launching OpenCL kernels only...
void lu_factorize(matrix< NumericT, viennacl::row_major > &A)
LU factorization of a row-major dense matrix.