Utilities and Types

Core enumerations, error handling, and type utilities for BLAS++.

Enumerations

Layout - Matrix storage layout:
  • ColMajor - Column-major storage (Fortran style)

  • RowMajor - Row-major storage (C style)

Op - Matrix transpose operation:
  • NoTrans - No transpose: \(op(A) = A\)

  • Trans - Transpose: \(op(A) = A^T\)

  • ConjTrans - Conjugate transpose: \(op(A) = A^H\)

Uplo - Upper or lower triangle:
  • Upper - Upper triangle

  • Lower - Lower triangle

  • General - General (full) matrix

Diag - Diagonal type:
  • NonUnit - Non-unit diagonal

  • Unit - Unit diagonal (all 1’s)

Side - Matrix multiplication side:
  • Left - Matrix on left: \(AB\)

  • Right - Matrix on right: \(BA\)

Error Handling

class Error : public std::exception

Exception class for BLAS errors.

This exception is thrown when BLAS++ detects an error condition, such as invalid parameters or unsupported operations. The error message can be retrieved using the what() method.

Public Functions

inline Error()

Constructs a BLAS error with no message.

inline Error(std::string const &msg)

Constructs a BLAS error with the specified message.

Parameters:

msg[in] Error message describing the error condition.

inline Error(const char *msg, const char *func)

Constructs a BLAS error with message and function name.

Parameters:
  • msg[in] Error message describing the error condition.

  • func[in] Name of the function where the error occurred.

inline virtual const char *what() const noexcept override

Returns the error message.

Returns:

C-string containing the error message.

Type Traits and Safety Functions

See blaspp/include/blas/util.hh for:

  • is_complex<T> - Check if type is complex

  • scalar_type_traits<T...> - Deduce scalar type from multiple arguments

  • real_type_traits<T> - Get real type from scalar or complex type

  • safe_min<T>(), safe_max<T>() - Safe numerical bounds

  • root_min<T>(), root_max<T>() - Safe bounds for square root operations

  • ceildiv(x, y) - Integer ceiling division