LAMA
|
The class Scalar represents a multi precision scalar. More...
#include <Scalar.hpp>
Public Types | |
enum | ScalarType { INDEX_TYPE, FLOAT, DOUBLE, LONG_DOUBLE, COMPLEX, DOUBLE_COMPLEX, LONG_DOUBLE_COMPLEX, UNKNOWN } |
typedef const Scalar | ExpressionMemberType |
ExpressionMemberType is the type that is used the template Expression to store a Scalar. | |
Public Member Functions | |
Scalar () | |
Constructs a scalar representing 0. | |
template<typename T > | |
Scalar (const T value) | |
Constructs a scalar representing the passed real value. | |
Scalar (const float value) | |
Constructs a scalar representing the passed real value. | |
Scalar (const double value) | |
Constructs a scalar representing the passed real value. | |
Scalar (const long double value) | |
Constructs a scalar representing the passed real value. | |
template<typename T > | |
Scalar (const std::complex< T > value) | |
Constructs a scalar representing the passed complex value. | |
virtual | ~Scalar () |
Releases all allocated resources. | |
template<typename T > | |
T | getValue () const |
returns the value this Scalar represents as type T. | |
Scalar | operator- () const |
Unary minus operator for Scalar. | |
bool | isReal () const |
Query that scalar values has no imaginary part. | |
virtual void | writeAt (std::ostream &stream) const |
Override virtual method of base class Printable to Write the represented value of this to the passed stream. | |
Static Public Member Functions | |
template<typename T > | |
static ScalarType | getType () |
static size_t | getTypeSize (const ScalarType type) |
Protected Member Functions | |
LAMA_LOG_DECL_STATIC_LOGGER (logger) | |
Private Attributes | |
std::complex< long double > | mValue |
The class Scalar represents a multi precision scalar.
typedef const Scalar lama::Scalar::ExpressionMemberType |
ExpressionMemberType is the type that is used the template Expression to store a Scalar.
lama::Scalar::Scalar | ( | ) | [inline] |
Constructs a scalar representing 0.
Referenced by operator-().
lama::Scalar::Scalar | ( | const T | value | ) | [inline, explicit] |
Constructs a scalar representing the passed real value.
The templated converstion constructor needs to be explicit, because the operator==(Scalar,Scalar) can lead to ambiguities.
[in] | value | the value this scalar should represent |
lama::Scalar::Scalar | ( | const float | value | ) | [inline] |
Constructs a scalar representing the passed real value.
[in] | value | the value this scalar should represent |
lama::Scalar::Scalar | ( | const double | value | ) | [inline] |
Constructs a scalar representing the passed real value.
[in] | value | the value this scalar should represent |
lama::Scalar::Scalar | ( | const long double | value | ) | [inline] |
Constructs a scalar representing the passed real value.
[in] | value | the value this scalar should represent |
lama::Scalar::Scalar | ( | const std::complex< T > | value | ) | [inline] |
Constructs a scalar representing the passed complex value.
[in] | value | the value this scalar should represent |
lama::Scalar::~Scalar | ( | ) | [inline, virtual] |
Releases all allocated resources.
Scalar::ScalarType lama::Scalar::getType< long double > | ( | ) | [inline, static] |
References UNKNOWN.
size_t lama::Scalar::getTypeSize | ( | const ScalarType | type | ) | [inline, static] |
References COMPLEX, DOUBLE, DOUBLE_COMPLEX, FLOAT, LONG_DOUBLE, and LONG_DOUBLE_COMPLEX.
Referenced by lama::SimpleAMG::logSetupDetails().
std::complex< long double > lama::Scalar::getValue | ( | ) | const [inline] |
returns the value this Scalar represents as type T.
References mValue.
Referenced by lama::abs(), lama::LAMAArrayUtils::assign(), lama::cast(), lama::Matrix::createDenseVector(), lama::CG::iterate(), lama::DefaultJacobi::iterate(), lama::GMRES::iterate(), lama::SOR::iterateImpl(), lama::SpecializedJacobi::iterateTyped(), lama::DenseMatrix< T >::matrixTimesMatrix(), lama::SparseMatrix< T >::matrixTimesMatrix(), lama::DenseMatrix< T >::matrixTimesScalar(), lama::SparseMatrix< T >::matrixTimesScalar(), lama::CRTPMatrix< DenseMatrix< T >, T >::matrixTimesVector(), lama::SparseMatrix< T >::matrixTimesVector(), lama::max(), lama::min(), lama::operator*(), lama::operator+(), lama::operator-(), lama::operator/(), lama::operator<(), lama::operator==(), lama::operator>(), lama::ELLStorage< T >::scaleImpl(), lama::CSRStorage< T >::scaleImpl(), lama::JDSStorage< T >::scaleImpl(), lama::COOStorage< T >::scaleImpl(), lama::DenseStorageView< T >::scaleImpl(), lama::DIAStorage< T >::scaleImpl(), lama::SparseAssemblyStorage< T >::scaleImpl(), lama::COOStorage< T >::setDiagonalImpl(), lama::ELLStorage< T >::setDiagonalImpl(), lama::CSRStorage< T >::setDiagonalImpl(), lama::DenseStorageView< T >::setDiagonalImpl(), lama::DIAStorage< T >::setDiagonalImpl(), lama::SparseAssemblyStorage< T >::setDiagonalImpl(), lama::OpenMPJDSUtils::setDiagonalWithScalar(), and lama::sqrt().
bool lama::Scalar::isReal | ( | ) | const [inline] |
Query that scalar values has no imaginary part.
References mValue.
Referenced by lama::max(), lama::min(), lama::operator<(), and lama::operator>().
lama::Scalar::LAMA_LOG_DECL_STATIC_LOGGER | ( | logger | ) | [protected] |
Scalar lama::Scalar::operator- | ( | ) | const [inline] |
void lama::Scalar::writeAt | ( | std::ostream & | stream | ) | const [inline, virtual] |
std::complex<long double> lama::Scalar::mValue [private] |
Referenced by getValue(), isReal(), operator-(), and writeAt().