35#ifndef _BLAZE_MATH_HYBRIDMATRIX_H_
36#define _BLAZE_MATH_HYBRIDMATRIX_H_
73template<
typename Type
80class Rand< HybridMatrix<Type,M,N,SO,AF,PF,Tag> >
88 inline const HybridMatrix<Type,M,N,SO,AF,PF,Tag>
91 HybridMatrix<Type,M,N,SO,AF,PF,Tag> matrix( m, n );
104 template<
typename Arg >
105 inline const HybridMatrix<Type,M,N,SO,AF,PF,Tag>
106 generate(
size_t m,
size_t n,
const Arg&
min,
const Arg&
max )
const
108 HybridMatrix<Type,M,N,SO,AF,PF,Tag> matrix( m, n );
120 inline void randomize( HybridMatrix<Type,M,N,SO,AF,PF,Tag>& matrix )
const
124 const size_t m( matrix.rows() );
125 const size_t n( matrix.columns() );
127 for(
size_t i=0UL; i<m; ++i ) {
128 for(
size_t j=0UL; j<n; ++j ) {
143 template<
typename Arg >
144 inline void randomize( HybridMatrix<Type,M,N,SO,AF,PF,Tag>& matrix,
145 const Arg&
min,
const Arg&
max )
const
149 const size_t m( matrix.rows() );
150 const size_t n( matrix.columns() );
152 for(
size_t i=0UL; i<m; ++i ) {
153 for(
size_t j=0UL; j<n; ++j ) {
180template<
typename Type
187void makeSymmetric( HybridMatrix<Type,M,N,SO,AF,PF,Tag>& matrix )
195 const size_t n( matrix.rows() );
197 for(
size_t i=0UL; i<n; ++i ) {
198 for(
size_t j=0UL; j<i; ++j ) {
200 matrix(j,i) = matrix(i,j);
221template<
typename Type
229void makeSymmetric( HybridMatrix<Type,M,N,SO,AF,PF,Tag>& matrix,
const Arg&
min,
const Arg&
max )
237 const size_t n( matrix.rows() );
239 for(
size_t i=0UL; i<n; ++i ) {
240 for(
size_t j=0UL; j<i; ++j ) {
242 matrix(j,i) = matrix(i,j);
261template<
typename Type
268void makeHermitian( HybridMatrix<Type,M,N,SO,AF,PF,Tag>& matrix )
274 using BT = UnderlyingBuiltin_t<Type>;
280 const size_t n( matrix.rows() );
282 for(
size_t i=0UL; i<n; ++i ) {
283 for(
size_t j=0UL; j<i; ++j ) {
285 matrix(j,i) =
conj( matrix(i,j) );
287 matrix(i,i) = rand<BT>();
306template<
typename Type
314void makeHermitian( HybridMatrix<Type,M,N,SO,AF,PF,Tag>& matrix,
const Arg&
min,
const Arg&
max )
320 using BT = UnderlyingBuiltin_t<Type>;
326 const size_t n( matrix.rows() );
328 for(
size_t i=0UL; i<n; ++i ) {
329 for(
size_t j=0UL; j<i; ++j ) {
331 matrix(j,i) =
conj( matrix(i,j) );
350template<
typename Type
357void makePositiveDefinite( HybridMatrix<Type,M,N,SO,AF,PF,Tag>& matrix )
367 const size_t n( matrix.rows() );
370 matrix *=
ctrans( matrix );
372 for(
size_t i=0UL; i<n; ++i ) {
373 matrix(i,i) += Type(n);
Header file for run time assertion macros.
Header file for the conjugate shim.
Header file for all basic DenseMatrix functionality.
Header file for the complete HybridVector implementation.
Header file for the complete IdentityMatrix implementation.
Constraint on the data type.
Header file for the complete StaticMatrix implementation.
Header file for the UnderlyingBuiltin type trait.
Header file for the complete ZeroMatrix implementation.
Header file for the implementation of a fixed-size matrix.
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:1339
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1375
decltype(auto) real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatMapExpr.h:1529
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1464
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1501
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:1534
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:1456
decltype(auto) generate(size_t m, size_t n, OP op)
Generates a new dense matrix filled via the given custom binary operation.
Definition: DMatGenExpr.h:675
#define BLAZE_CONSTRAINT_MUST_BE_SCALAR_TYPE(T)
Constraint on the data type.
Definition: Scalar.h:61
PaddingFlag
Padding flag for (un-)padded vectors and matrices.
Definition: PaddingFlag.h:77
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.
Definition: AlignmentFlag.h:63
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:1383
void randomize(T &&value)
Randomization of a given variable.
Definition: Random.h:626
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
Header file for the exception macros of the math module.
Header file for the real shim.
Implementation of a random number generator.