35 #ifndef _BLAZE_MATH_DENSE_LQ_H_ 36 #define _BLAZE_MATH_DENSE_LQ_H_ 75 template<
typename MT1,
bool SO1,
typename MT2,
bool SO2,
typename MT3,
bool SO3 >
76 void lq(
const DenseMatrix<MT1,SO1>& A, DenseMatrix<MT2,SO2>& Q, DenseMatrix<MT3,SO3>& R );
93 template<
typename MT1 >
94 inline auto lq_backend( MT1& A,
const ElementType_t<MT1>* tau )
95 -> EnableIf_t<IsBuiltin_v< ElementType_t<MT1> > >
115 template<
typename MT1 >
116 inline auto lq_backend( MT1& A,
const ElementType_t<MT1>* tau )
117 -> EnableIf_t<IsComplex_v< ElementType_t<MT1> > >
173 template<
typename MT1
195 const size_t m( (~A).
rows() );
196 const size_t n( (~A).
columns() );
197 const size_t mindim(
min( m, n ) );
199 if( ( !IsResizable_v<MT2> && ( (~L).
rows() != m || (~L).
columns() != mindim ) ) ||
200 ( !IsResizable_v<MT3> && ( (~Q).
rows() != mindim || (~Q).
columns() != n ) ) ) {
204 if( IsSquare_v<MT2> && m != mindim ) {
208 const std::unique_ptr<ET1[]> tau(
new ET1[mindim] );
209 decltype(
auto) l( derestrict( ~L ) );
214 gelqf( ~Q, tau.get() );
216 resize( ~L, m, m,
false );
219 for(
size_t i=0UL; i<m; ++i ) {
220 for(
size_t j=0UL; j<
min(i+1UL,n); ++j ) {
225 lq_backend( ~Q, tau.get() );
230 gelqf( l, tau.get() );
232 lq_backend( ~Q, tau.get() );
234 for(
size_t i=0UL; i<m; ++i ) {
235 for(
size_t j=i+1UL; j<n; ++j ) {
Header file for the implementation of the Submatrix view.
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
Headerfile for the generic min algorithm.
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:178
void orglq(int m, int n, int k, float *A, int lda, const float *tau, float *work, int lwork, int *info)
LAPACK kernel for the reconstruction of the orthogonal matrix Q from a LQ decomposition.
Definition: orglq.h:122
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower or upper unitriangular matrix ty...
Definition: UniTriangular.h:81
Constraint on the data type.
Header file for the LAPACK functions to reconstruct Q from a LQ decomposition (unglq)
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ADAPTOR_TYPE(T)
Constraint on the data type.In case the given data type T is an adaptor type (as for instance LowerMa...
Definition: Adaptor.h:81
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes....
Definition: DenseMatrix.h:81
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
Constraint on the data type.
Header file for the IsSquare type trait.
Constraint on the data type.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the LAPACK functions to reconstruct Q from a LQ decomposition (orglq)
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1162
Header file for the DenseMatrix base class.
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type,...
Definition: Upper.h:81
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
Header file for the EnableIf class template.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type,...
Definition: Symmetric.h:79
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a BLAS compatible data type (i....
Definition: BLASCompatible.h:61
Constraint on the data type.
void lq(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &Q, DenseMatrix< MT3, SO3 > &R)
LQ decomposition of the given dense matrix.
Definition: LQ.h:179
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_STRICTLY_TRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a strictly lower or upper triangular mat...
Definition: StrictlyTriangular.h:81
void gelqf(int m, int n, float *A, int lda, float *tau, float *work, int lwork, int *info)
LAPACK kernel for the LQ decomposition of the given dense single precision column-major matrix.
Definition: gelqf.h:146
void unglq(int m, int n, int k, complex< float > *A, int lda, const complex< float > *tau, complex< float > *work, int lwork, int *info)
LAPACK kernel for the reconstruction of the orthogonal matrix Q from a LQ decomposition.
Definition: unglq.h:122
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type,...
Definition: Hermitian.h:79
Header file for the IsResizable type trait.
Header file for the LAPACK LQ decomposition functions (gelqf)