FLANG
Fortran::evaluate::value::ComplexValue Class Reference

#include <flang/Evaluate/complex-value.h>

Public Types

using Part = RealValue

Public Member Functions

 ComplexValue (const ComplexValue &)=default
 ComplexValue (ComplexValue &&)=default
ComplexValue & operator= (const ComplexValue &)=default
ComplexValue & operator= (ComplexValue &&)=default
 ComplexValue (const RealValue &r, const RealValue &i)
 ComplexValue (const RealValue &r)
 ComplexValue (int kind, const RealValue &r)
 ComplexValue (int kind, const ComplexValue &v)
 ComplexValue (int kind, ComplexValue &&v)
void print (llvm::raw_ostream &os) const
LLVM_DUMP_METHOD void dump () const
bool IsNull () const
int kind () const
 The kind of the value currently stored.
std::size_t bytesStored () const
 Number of bytes accessed by FromRawBytes/StoreRawBytes.
RealValue REAL () const
RealValue AIMAG () const
ComplexValue CONJG () const
ComplexValue Negate () const
bool Equals (const ComplexValue &y) const
bool operator== (const ComplexValue &y) const
bool operator!= (const ComplexValue &y) const
bool IsZero () const
bool IsInfinite () const
bool IsNotANumber () const
bool IsSignalingNaN () const
ValueWithRealFlags< ComplexValue > Add (const ComplexValue &, Rounding rounding=TargetCharacteristics::defaultRounding) const
ValueWithRealFlags< ComplexValue > Subtract (const ComplexValue &, Rounding rounding=TargetCharacteristics::defaultRounding) const
ValueWithRealFlags< ComplexValue > Multiply (const ComplexValue &, Rounding rounding=TargetCharacteristics::defaultRounding) const
ValueWithRealFlags< ComplexValue > Divide (const ComplexValue &, Rounding rounding=TargetCharacteristics::defaultRounding) const
ValueWithRealFlags< ComplexValue > KahanSummation (const ComplexValue &y, ComplexValue &correction, Rounding rounding=TargetCharacteristics::defaultRounding) const
ValueWithRealFlags< RealValue > ABS (Rounding rounding=TargetCharacteristics::defaultRounding) const
 ABS/CABS = HYPOT(re_, imag_) = SQRT(re_**2 + im_**2)
ComplexValue FlushSubnormalToZero () const
std::string DumpHexadecimal () const
llvm::raw_ostream & AsFortran (llvm::raw_ostream &, int kind) const
void StoreRawBytes (void *dst, size_t size, bool *changed=nullptr) const

Static Public Member Functions

static ComplexValue Zero (int kind)
static constexpr std::size_t bytesStored (int kind)
static ValueWithRealFlags< ComplexValue > FromInteger (int kind, const IntegerValue &n, bool isUnsigned=false, Rounding rounding=TargetCharacteristics::defaultRounding)
static ComplexValue NotANumber (int kind)
static ComplexValue FromRawBytes (int kind, const void *raw, std::size_t expectedSize)

Detailed Description

A complex floating-point value with dynamic precision.

The precision is dynamic, but only a predefined set of Fortran kinds are allowed. It is also kind-aware, i.e. knows which COMPLEX kind it currently represents.

The implementation is a pair of RealValue objects.

Member Function Documentation

◆ IsNull()

bool Fortran::evaluate::value::ComplexValue::IsNull ( ) const
inline

Whether this object represents a default-initialized value (zero) of not-yet-known kind.

◆ Zero()

ComplexValue Fortran::evaluate::value::ComplexValue::Zero ( int kind)
inlinestatic

Creates a complex value (+0.0 + +0.0i) of a given kind. This is different from the default-ctor which creates a null state that represents zero of unknown kind.


The documentation for this class was generated from the following files: