35#ifndef _BLAZE_MATH_STATICMATRIX_H_
36#define _BLAZE_MATH_STATICMATRIX_H_
73template<
typename Type
80class Rand< StaticMatrix<Type,M,N,SO,AF,PF,Tag> >
88 inline const StaticMatrix<Type,M,N,SO,AF,PF,Tag>
generate()
const
90 StaticMatrix<Type,M,N,SO,AF,PF,Tag> matrix;
103 template<
typename Arg >
104 inline const StaticMatrix<Type,M,N,SO,AF,PF,Tag>
107 StaticMatrix<Type,M,N,SO,AF,PF,Tag> matrix;
119 inline void randomize( StaticMatrix<Type,M,N,SO,AF,PF,Tag>& matrix )
const
123 for(
size_t i=0UL; i<M; ++i ) {
124 for(
size_t j=0UL; j<N; ++j ) {
139 template<
typename Arg >
140 inline void randomize( StaticMatrix<Type,M,N,SO,AF,PF,Tag>& matrix,
141 const Arg&
min,
const Arg&
max )
const
145 for(
size_t i=0UL; i<M; ++i ) {
146 for(
size_t j=0UL; j<N; ++j ) {
173template<
typename Type
180void makeSymmetric( StaticMatrix<Type,M,N,SO,AF,PF,Tag>& matrix )
186 for(
size_t i=0UL; i<N; ++i ) {
187 for(
size_t j=0UL; j<i; ++j ) {
189 matrix(j,i) = matrix(i,j);
210template<
typename Type
218void makeSymmetric( StaticMatrix<Type,M,N,SO,AF,PF,Tag>& matrix,
const Arg&
min,
const Arg&
max )
224 for(
size_t i=0UL; i<N; ++i ) {
225 for(
size_t j=0UL; j<i; ++j ) {
227 matrix(j,i) = matrix(i,j);
246template<
typename Type
253void makeHermitian( StaticMatrix<Type,M,N,SO,AF,PF,Tag>& matrix )
260 using BT = UnderlyingBuiltin_t<Type>;
262 for(
size_t i=0UL; i<N; ++i ) {
263 for(
size_t j=0UL; j<i; ++j ) {
265 matrix(j,i) =
conj( matrix(i,j) );
267 matrix(i,i) = rand<BT>();
286template<
typename Type
294void makeHermitian( StaticMatrix<Type,M,N,SO,AF,PF,Tag>& matrix,
const Arg&
min,
const Arg&
max )
301 using BT = UnderlyingBuiltin_t<Type>;
303 for(
size_t i=0UL; i<N; ++i ) {
304 for(
size_t j=0UL; j<i; ++j ) {
306 matrix(j,i) =
conj( matrix(i,j) );
325template<
typename Type
332void makePositiveDefinite( StaticMatrix<Type,M,N,SO,AF,PF,Tag>& matrix )
340 matrix *=
ctrans( matrix );
342 for(
size_t i=0UL; i<N; ++i ) {
343 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 HybridMatrix implementation.
Header file for the complete IdentityMatrix implementation.
Constraint on the data type.
Header file for the complete StaticVector 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
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_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
Header file for the real shim.
Implementation of a random number generator.