35 #ifndef _BLAZE_MATH_HYBRIDMATRIX_H_ 36 #define _BLAZE_MATH_HYBRIDMATRIX_H_ 73 template<
typename Type
77 class Rand< HybridMatrix<Type,M,N,SO> >
83 inline const HybridMatrix<Type,M,N,SO>
generate(
size_t m,
size_t n )
const;
85 template<
typename Arg >
86 inline const HybridMatrix<Type,M,N,SO>
generate(
size_t m,
size_t n,
const Arg&
min,
const Arg&
max )
const;
93 inline void randomize( HybridMatrix<Type,M,N,SO>& matrix )
const;
95 template<
typename Arg >
96 inline void randomize( HybridMatrix<Type,M,N,SO>& matrix,
const Arg&
min,
const Arg&
max )
const;
110 template<
typename Type
114 inline const HybridMatrix<Type,M,N,SO>
115 Rand< HybridMatrix<Type,M,N,SO> >::generate(
size_t m,
size_t n )
const 117 HybridMatrix<Type,M,N,SO> matrix( m, n );
133 template<
typename Type
137 template<
typename Arg >
138 inline const HybridMatrix<Type,M,N,SO>
139 Rand< HybridMatrix<Type,M,N,SO> >::generate(
size_t m,
size_t n,
const Arg&
min,
const Arg&
max )
const 141 HybridMatrix<Type,M,N,SO> matrix( m, n );
156 template<
typename Type
160 inline void Rand< HybridMatrix<Type,M,N,SO> >
::randomize( HybridMatrix<Type,M,N,SO>& matrix )
const 164 const size_t m( matrix.rows() );
165 const size_t n( matrix.columns() );
167 for(
size_t i=0UL; i<m; ++i ) {
168 for(
size_t j=0UL; j<n; ++j ) {
186 template<
typename Type
190 template<
typename Arg >
191 inline void Rand< HybridMatrix<Type,M,N,SO> >
::randomize( HybridMatrix<Type,M,N,SO>& matrix,
192 const Arg&
min,
const Arg&
max )
const 196 const size_t m( matrix.rows() );
197 const size_t n( matrix.columns() );
199 for(
size_t i=0UL; i<m; ++i ) {
200 for(
size_t j=0UL; j<n; ++j ) {
225 template<
typename Type
229 void makeSymmetric( HybridMatrix<Type,M,N,SO>& matrix )
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);
263 template<
typename Type
268 void makeSymmetric( HybridMatrix<Type,M,N,SO>& matrix,
const Arg&
min,
const Arg&
max )
276 const size_t n( matrix.rows() );
278 for(
size_t i=0UL; i<n; ++i ) {
279 for(
size_t j=0UL; j<i; ++j ) {
281 matrix(j,i) = matrix(i,j);
300 template<
typename Type
304 void makeHermitian( HybridMatrix<Type,M,N,SO>& matrix )
310 using BT = UnderlyingBuiltin_t<Type>;
316 const size_t n( matrix.rows() );
318 for(
size_t i=0UL; i<n; ++i ) {
319 for(
size_t j=0UL; j<i; ++j ) {
321 matrix(j,i) =
conj( matrix(i,j) );
323 matrix(i,i) = rand<BT>();
342 template<
typename Type
347 void makeHermitian( HybridMatrix<Type,M,N,SO>& matrix,
const Arg&
min,
const Arg&
max )
353 using BT = UnderlyingBuiltin_t<Type>;
359 const size_t n( matrix.rows() );
361 for(
size_t i=0UL; i<n; ++i ) {
362 for(
size_t j=0UL; j<i; ++j ) {
364 matrix(j,i) =
conj( matrix(i,j) );
383 template<
typename Type
387 void makePositiveDefinite( HybridMatrix<Type,M,N,SO>& matrix )
397 const size_t n( matrix.rows() );
400 matrix *=
ctrans( matrix );
402 for(
size_t i=0UL; i<n; ++i ) {
403 matrix(i,i) += Type(n);
#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
Constraint on the data type.
Header file for the complete HybridVector implementation.
decltype(auto) real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatMapExpr.h:1392
void randomize(T &&value)
Randomization of a given variable.
Definition: Random.h:929
Implementation of a random number generator.
void randomize(T &value) const
Randomization of the given variable with a new value in the range .
Definition: Random.h:292
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1364
Header file for the UnderlyingBuiltin type trait.
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:1147
Header file for the exception macros of the math module.
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:1179
Header file for the conjugate shim.
Header file for run time assertion macros.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:617
Header file for the implementation of a fixed-size matrix.
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:539
T generate() const
Generation of a random value in the range .
Definition: Random.h:252
Header file for all basic DenseMatrix functionality.
Header file for the complete StaticMatrix implementation.
Header file for the complete IdentityMatrix implementation.
Header file for the real shim.
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1326
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the complete ZeroMatrix implementation.