Anasazi Version of the Day
Public Member Functions | Static Public Attributes
TSQR::ApplyType Class Reference

NoTranspose, Transpose, or ConjugateTranspose. More...

#include <Tsqr_ApplyType.hpp>

List of all members.

Public Member Functions

 ApplyType (const std::string &op)
bool transposed () const
 Whether this corresponds to (Q^T or Q^H)
 ApplyType (const ApplyType &rhs)
ApplyTypeoperator= (const ApplyType &rhs)
const std::string & toString () const

Static Public Attributes

static const ApplyType NoTranspose = ApplyType ("N")
static const ApplyType Transpose = ApplyType ("T")
static const ApplyType ConjugateTranspose = ApplyType ("C")

Detailed Description

NoTranspose, Transpose, or ConjugateTranspose.

An ApplyType instance represents one of three ways one can apply an implicitly stored Q factor from a QR factorization to the left of a matrix C: either as Q (NoTranspose), as Q^T (Transpose), or as Q^H (ConjugateTranspose). Transpose and ConjugateTranspose only mean different things in complex arithmetic. This class is a kind of "checked enum" that only allows these three values. It knows how to go from a length-one string to the appropriate ApplyType object: "N" -> NoTranspose, "T" -> Transpose, and "C" or "H" -> ConjugateTranspose (both "C" and "H" mean the same thing).

std::invalid_argument is thrown if an invalid input is given.

Definition at line 54 of file Tsqr_ApplyType.hpp.

Constructor & Destructor Documentation

TSQR::ApplyType::ApplyType ( const std::string &  op)


op[in] One of "N", "T", "C", or "H". Only the first character of op is read, in a case-insensitive way.

Definition at line 36 of file Tsqr_ApplyType.cpp.

TSQR::ApplyType::ApplyType ( const ApplyType rhs)

Copy constructor

Definition at line 41 of file Tsqr_ApplyType.cpp.

Member Function Documentation

bool TSQR::ApplyType::transposed ( ) const [inline]

Whether this corresponds to (Q^T or Q^H)

If op corresponds to applying Q, return false, else if op corresponds to applying Q^T or Q^H, return true.

We lump Q^T and Q^H together because they both involve applying the Q factor pieces in the same order as they were computed in factor(), whereas applying Q involves applying those pieces in the reverse order of their computation in factor().

Definition at line 72 of file Tsqr_ApplyType.hpp.

ApplyType & TSQR::ApplyType::operator= ( const ApplyType rhs)

Assignment operator

Definition at line 46 of file Tsqr_ApplyType.cpp.

const std::string& TSQR::ApplyType::toString ( ) const [inline]

Return a reference to the canonical LAPACK string representing the apply type. Different for each of NoTranspose, Transpose, or ConjugateTranspose.

This is useful for e.g., calling into LAPACK's Householder QR routines. this->toString().c_str() will return a character array which LAPACK routines such as DORMQR and ZORMQR will understand.

Definition at line 110 of file Tsqr_ApplyType.hpp.

Member Data Documentation

Represents applying Q to a matrix.

Definition at line 92 of file Tsqr_ApplyType.hpp.

Represents applying Q^T (transpose of Q) to a matrix.

Definition at line 96 of file Tsqr_ApplyType.hpp.

Represents applying Q^H (conjugate transpose of Q) to a matrix.

Definition at line 100 of file Tsqr_ApplyType.hpp.

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends