Loading [MathJax]/extensions/TeX/AMSmath.js
<T>LAPACK 0.1.2
C++ Template Linear Algebra PACKage
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
tlapack::MatrixMarket Struct Reference

MatrixMarket class. More...

#include <MatrixMarket.hpp>

Collaboration diagram for tlapack::MatrixMarket:

Public Member Functions

template<TLAPACK_MATRIX matrix_t>
void colmajor_read (matrix_t &A, std::istream &is) const
 Read a dense matrix from an input stream (file, stdin, etc).
 
template<TLAPACK_MATRIX matrix_t>
void hessenberg (matrix_t &A)
 Generate a random upper Hessenberg matrix.
 
template<TLAPACK_MATRIX matrix_t>
void hilbert (matrix_t &A) const
 Generate a Hilbert matrix.
 
template<TLAPACK_MATRIX matrix_t, class Distribution = typename std::conditional< (is_same_v<type_t<matrix_t>, float> || is_same_v<type_t<matrix_t>, double> || is_same_v<type_t<matrix_t>, long double>), std::normal_distribution<type_t<matrix_t>>, std::normal_distribution<double>>::type>
void randn (matrix_t &A)
 Generate a random dense matrix based on a normal distribution.
 
template<TLAPACK_UPLO uplo_t, TLAPACK_MATRIX matrix_t, class Distribution = typename std::conditional< (is_same_v<type_t<matrix_t>, float> || is_same_v<type_t<matrix_t>, double> || is_same_v<type_t<matrix_t>, long double>), std::normal_distribution<type_t<matrix_t>>, std::normal_distribution<double>>::type>
void randn (uplo_t uplo, matrix_t &A)
 Generate an upper- or lower-triangular random matrix.
 
template<TLAPACK_MATRIX matrix_t>
void random (matrix_t &A)
 Generate a random dense matrix.
 
template<TLAPACK_UPLO uplo_t, TLAPACK_MATRIX matrix_t>
void random (uplo_t uplo, matrix_t &A)
 Generate an upper- or lower-triangular random matrix.
 
template<TLAPACK_MATRIX matrix_t>
void single_value (matrix_t &A, const type_t< matrix_t > &val) const
 Generate a matrix with a single value in all entries.
 
template<TLAPACK_UPLO uplo_t, TLAPACK_MATRIX matrix_t>
void single_value (uplo_t uplo, matrix_t &A, const type_t< matrix_t > &val) const
 Generate an upper- or lower-triangular matrix with a single value in all entries.
 

Public Attributes

PCG32 gen
 

Detailed Description

MatrixMarket class.

This class provides methods to read matrices from files and to generate random or structured matrices.

Member Function Documentation

◆ colmajor_read()

template<TLAPACK_MATRIX matrix_t>
void tlapack::MatrixMarket::colmajor_read ( matrix_t A,
std::istream &  is 
) const
inline

Read a dense matrix from an input stream (file, stdin, etc).

The data is read in column-major format.

Parameters
[out]AMatrix.
[in,out]isInput stream.

◆ hessenberg()

template<TLAPACK_MATRIX matrix_t>
void tlapack::MatrixMarket::hessenberg ( matrix_t A)
inline

Generate a random upper Hessenberg matrix.

Put a single garbage value float(0xFA57C0DE) below the first subdiagonal.

Parameters
[out]AMatrix.

◆ hilbert()

template<TLAPACK_MATRIX matrix_t>
void tlapack::MatrixMarket::hilbert ( matrix_t A) const
inline

Generate a Hilbert matrix.

The Hilbert matrix is defined as:

\[ A_{ij} = \frac{1}{i + j + 1} \]

Parameters
[out]AMatrix.

◆ randn() [1/2]

template<TLAPACK_MATRIX matrix_t, class Distribution = typename std::conditional< (is_same_v<type_t<matrix_t>, float> || is_same_v<type_t<matrix_t>, double> || is_same_v<type_t<matrix_t>, long double>), std::normal_distribution<type_t<matrix_t>>, std::normal_distribution<double>>::type>
void tlapack::MatrixMarket::randn ( matrix_t A)
inline

Generate a random dense matrix based on a normal distribution.

Parameters
[out]AMatrix.

◆ randn() [2/2]

template<TLAPACK_UPLO uplo_t, TLAPACK_MATRIX matrix_t, class Distribution = typename std::conditional< (is_same_v<type_t<matrix_t>, float> || is_same_v<type_t<matrix_t>, double> || is_same_v<type_t<matrix_t>, long double>), std::normal_distribution<type_t<matrix_t>>, std::normal_distribution<double>>::type>
void tlapack::MatrixMarket::randn ( uplo_t  uplo,
matrix_t A 
)
inline

Generate an upper- or lower-triangular random matrix.

Put a single garbage value float(0xCAFEBABE) in the opposite triangle.

Parameters
[in]uploUpper or lower triangular.
[out]AMatrix.

◆ random() [1/2]

template<TLAPACK_MATRIX matrix_t>
void tlapack::MatrixMarket::random ( matrix_t A)
inline

Generate a random dense matrix.

Parameters
[out]AMatrix.

◆ random() [2/2]

template<TLAPACK_UPLO uplo_t, TLAPACK_MATRIX matrix_t>
void tlapack::MatrixMarket::random ( uplo_t  uplo,
matrix_t A 
)
inline

Generate an upper- or lower-triangular random matrix.

Put a single garbage value float(0xCAFEBABE) in the opposite triangle.

Parameters
[in]uploUpper or lower triangular.
[out]AMatrix.

◆ single_value() [1/2]

template<TLAPACK_MATRIX matrix_t>
void tlapack::MatrixMarket::single_value ( matrix_t A,
const type_t< matrix_t > &  val 
) const
inline

Generate a matrix with a single value in all entries.

Parameters
[out]AMatrix.
[in]valValue.

◆ single_value() [2/2]

template<TLAPACK_UPLO uplo_t, TLAPACK_MATRIX matrix_t>
void tlapack::MatrixMarket::single_value ( uplo_t  uplo,
matrix_t A,
const type_t< matrix_t > &  val 
) const
inline

Generate an upper- or lower-triangular matrix with a single value in all entries.

Put a single garbage value float(0xCAFEBABE) in the opposite triangle.

Parameters
[in]uploUpper or lower triangular.
[out]AMatrix.
[in]valValue.

The documentation for this struct was generated from the following file: