Cytnx v0.9.1
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
cytnx::Scalar Class Reference

A class to represent a scalar. More...

#include <Scalar.hpp>

Public Member Functions

 Scalar ()
 default constructor
 
 Scalar (const cytnx_complex128 &in)
 init a Scalar with a cytnx::cytnx_complex128
 
 Scalar (const cytnx_complex64 &in)
 init a Scalar with a cytnx::cytnx_complex64
 
 Scalar (const cytnx_double &in)
 init a Scalar with a cytnx::cytnx_double
 
 Scalar (const cytnx_float &in)
 init a Scalar with a cytnx::cytnx_float
 
 Scalar (const cytnx_uint64 &in)
 init a Scalar with a cytnx::cytnx_uint64
 
 Scalar (const cytnx_int64 &in)
 init a Scalar with a cytnx::cytnx_int64
 
 Scalar (const cytnx_uint32 &in)
 init a Scalar with a cytnx::cytnx_uint32
 
 Scalar (const cytnx_int32 &in)
 init a Scalar with a cytnx::cytnx_int32
 
 Scalar (const cytnx_uint16 &in)
 init a Scalar with a cytnx::cytnx_uint16
 
 Scalar (const cytnx_int16 &in)
 init a Scalar with a cytnx::cytnx_int16
 
 Scalar (const cytnx_bool &in)
 init a Scalar with a cytnx::cytnx_bool
 
template<class T >
 Scalar (const T &in, const unsigned int &dtype)
 The constructor of the Scalar class.
 
 Scalar (const Sproxy &prox)
 
 Scalar (Scalar_base *in)
 
 Scalar (const Scalar &rhs)
 The copy constructor of the Scalar class.
 
Scalaroperator= (const Scalar &rhs)
 The copy assignment of the Scalar class.
 
Scalaroperator= (const cytnx_complex128 &rhs)
 The copy assignment operator of the Scalar class with a given number cytnx::cytnx_complex128 rhs.
 
Scalaroperator= (const cytnx_complex64 &rhs)
 The copy assignment operator of the Scalar class with a given number cytnx::cytnx_complex64 rhs.
 
Scalaroperator= (const cytnx_double &rhs)
 The copy assignment operator of the Scalar class with a given number cytnx::cytnx_double rhs.
 
Scalaroperator= (const cytnx_float &rhs)
 The copy assignment operator of the Scalar class with a given number cytnx::cytnx_float rhs.
 
Scalaroperator= (const cytnx_uint64 &rhs)
 The copy assignment operator of the Scalar class with a given number cytnx::cytnx_uint64 rhs.
 
Scalaroperator= (const cytnx_int64 &rhs)
 The copy assignment operator of the Scalar class with a given number cytnx::cytnx_int64 rhs.
 
Scalaroperator= (const cytnx_uint32 &rhs)
 The copy assignment operator of the Scalar class with a given number cytnx::cytnx_uint32 rhs.
 
Scalaroperator= (const cytnx_int32 &rhs)
 The copy assignment operator of the Scalar class with a given number cytnx::cytnx_int32 rhs.
 
Scalaroperator= (const cytnx_uint16 &rhs)
 The copy assignment operator of the Scalar class with a given number cytnx::cytnx_uint16 rhs.
 
Scalaroperator= (const cytnx_int16 &rhs)
 The copy assignment operator of the Scalar class with a given number cytnx::cytnx_int16 rhs.
 
Scalaroperator= (const cytnx_bool &rhs)
 The copy assignment operator of the Scalar class with a given number cytnx::cytnx_bool rhs.
 
Scalar astype (const unsigned int &dtype) const
 Type conversion function.
 
Scalar conj () const
 Get the conjugate of the Scalar. That means return \( c^* \) if the Scalar is \( c \).
 
Scalar imag () const
 Get the imaginary part of the Scalar. That means return \( \Im(c) \) if the Scalar is \( c \).
 
Scalar real () const
 Get the real part of the Scalar. That means return \( \Re(c) \) if the Scalar is \( c \).
 
int dtype () const
 Get the dtype of the Scalar (see cytnx::Type for more details).
 
void print () const
 Print the Scalar to the standard output.
 
 operator cytnx_double () const
 The explicit casting operator of the Scalar class to cytnx::cytnx_double.
 
 operator cytnx_float () const
 The explicit casting operator of the Scalar class to cytnx::cytnx_float.
 
 operator cytnx_uint64 () const
 The explicit casting operator of the Scalar class to cytnx::cytnx_uint64.
 
 operator cytnx_int64 () const
 The explicit casting operator of the Scalar class to cytnx::cytnx_int64.
 
 operator cytnx_uint32 () const
 The explicit casting operator of the Scalar class to cytnx::cytnx_uint32.
 
 operator cytnx_int32 () const
 The explicit casting operator of the Scalar class to cytnx::cytnx_int32.
 
 operator cytnx_uint16 () const
 The explicit casting operator of the Scalar class to cytnx::cytnx_uint16.
 
 operator cytnx_int16 () const
 The explicit casting operator of the Scalar class to cytnx::cytnx_int16.
 
 operator cytnx_bool () const
 The explicit casting operator of the Scalar class to cytnx::cytnx_bool.
 
 ~Scalar ()
 The destructor of the Scalar class.
 
template<class T >
void operator+= (const T &rc)
 The addition assignment operator of the Scalar class with a given number (template).
 
void operator+= (const Scalar &rhs)
 The addition assignment operator of the Scalar class with a given Scalar.
 
template<class T >
void operator-= (const T &rc)
 The subtraction assignment operator of the Scalar class with a given number (template).
 
void operator-= (const Scalar &rhs)
 The subtraction assignment operator of the Scalar class with a given Scalar.
 
template<class T >
void operator*= (const T &rc)
 The multiplication assignment operator of the Scalar class with a given number (template).
 
void operator*= (const Scalar &rhs)
 The multiplication assignment operator of the Scalar class with a given Scalar.
 
template<class T >
void operator/= (const T &rc)
 The division assignment operator of the Scalar class with a given number (template).
 
void operator/= (const Scalar &rhs)
 The division assignment operator of the Scalar class with a given Scalar.
 
void iabs ()
 Set the Scalar to absolute value. (inplace)
 
void isqrt ()
 Set the Scalar to square root. (inplace)
 
Scalar abs () const
 The member function to get the absolute value of the Scalar.
 
Scalar sqrt () const
 The member function to get the square root of the Scalar.
 
template<class T >
bool less (const T &rc) const
 Return whether the current Scalar is less than a given template number rc.
 
bool less (const Scalar &rhs) const
 Return whether the current Scalar is less than a given Scalar rhs.
 
template<class T >
bool leq (const T &rc) const
 Return whether the current Scalar is less than or equal to a given template number rc.
 
bool leq (const Scalar &rhs) const
 Return whether the current Scalar is less than or equal to a given Scalar rhs.
 
template<class T >
bool greater (const T &rc) const
 Return whether the current Scalar is greater than a given template number rc.
 
bool greater (const Scalar &rhs) const
 Return whether the current Scalar is greater than a given Scalar rhs.
 
template<class T >
bool geq (const T &rc) const
 Return whether the current Scalar is greater than or equal to a given template number rc.
 
bool geq (const Scalar &rhs) const
 Return whether the current Scalar is greater than or equal to a given Scalar rhs.
 
template<class T >
bool eq (const T &rc) const
 Return whether the current Scalar is equal to a given template number rc.
 
bool eq (const Scalar &rhs) const
 Return whether the current Scalar is equal to a given Scalar rhs.
 
template<class T >
Scalar radd (const T &rc) const
 Return the addition of the current Scalar and a given template number rc.
 
Scalar radd (const Scalar &rhs) const
 Return the addition of the current Scalar and a given Scalar rhs.
 
template<class T >
Scalar rmul (const T &rc) const
 Return the multiplication of the current Scalar and a given template number rc.
 
Scalar rmul (const Scalar &rhs) const
 Return the multiplication of the current Scalar and a given Scalar rhs.
 
template<class T >
Scalar rsub (const T &rc) const
 Return the subtraction of the current Scalar and a given template number rc.
 
Scalar rsub (const Scalar &rhs) const
 Return the subtraction of the current Scalar and a given Scalar rhs.
 
template<class T >
Scalar rdiv (const T &rc) const
 Return the division of the current Scalar and a given template number rc.
 
Scalar rdiv (const Scalar &rhs) const
 Return the division of the current Scalar and a given Scalar rhs.
 

Static Public Member Functions

static Scalar maxval (const unsigned int &dtype)
 Get the max value of the Scalar with the given dtype.
 
static Scalar minval (const unsigned int &dtype)
 Get the min value of the Scalar with the given dtype.
 

Public Attributes

Scalar_base * _impl
 

Detailed Description

A class to represent a scalar.

This class is used to represent a scalar. You can construct a Scalar by a given value and a dtype (see cytnx::Type for available dtype).

Constructor & Destructor Documentation

◆ Scalar() [1/16]

cytnx::Scalar::Scalar ( )
inline

default constructor

◆ Scalar() [2/16]

cytnx::Scalar::Scalar ( const cytnx_complex128 in)
inline

◆ Scalar() [3/16]

cytnx::Scalar::Scalar ( const cytnx_complex64 in)
inline

◆ Scalar() [4/16]

cytnx::Scalar::Scalar ( const cytnx_double in)
inline

init a Scalar with a cytnx::cytnx_double

◆ Scalar() [5/16]

cytnx::Scalar::Scalar ( const cytnx_float in)
inline

init a Scalar with a cytnx::cytnx_float

◆ Scalar() [6/16]

cytnx::Scalar::Scalar ( const cytnx_uint64 in)
inline

init a Scalar with a cytnx::cytnx_uint64

◆ Scalar() [7/16]

cytnx::Scalar::Scalar ( const cytnx_int64 in)
inline

init a Scalar with a cytnx::cytnx_int64

◆ Scalar() [8/16]

cytnx::Scalar::Scalar ( const cytnx_uint32 in)
inline

init a Scalar with a cytnx::cytnx_uint32

◆ Scalar() [9/16]

cytnx::Scalar::Scalar ( const cytnx_int32 in)
inline

init a Scalar with a cytnx::cytnx_int32

◆ Scalar() [10/16]

cytnx::Scalar::Scalar ( const cytnx_uint16 in)
inline

init a Scalar with a cytnx::cytnx_uint16

◆ Scalar() [11/16]

cytnx::Scalar::Scalar ( const cytnx_int16 in)
inline

init a Scalar with a cytnx::cytnx_int16

◆ Scalar() [12/16]

cytnx::Scalar::Scalar ( const cytnx_bool in)
inline

init a Scalar with a cytnx::cytnx_bool

◆ Scalar() [13/16]

template<class T >
cytnx::Scalar::Scalar ( const T &  in,
const unsigned int &  dtype 
)
inline

The constructor of the Scalar class.

This constructor is used to init a Scalar with a given template value in and dtype (see cytnx::Type).

Parameters
[in]inThe value of the Scalar.
[in]dtypeThe data type of the Scalar.
Returns
A Scalar object.
Note
The dtype can be any of the cytnx::Type.

◆ Scalar() [14/16]

cytnx::Scalar::Scalar ( const Sproxy &  prox)

◆ Scalar() [15/16]

cytnx::Scalar::Scalar ( Scalar_base *  in)
inline

◆ Scalar() [16/16]

cytnx::Scalar::Scalar ( const Scalar rhs)
inline

The copy constructor of the Scalar class.

◆ ~Scalar()

cytnx::Scalar::~Scalar ( )
inline

The destructor of the Scalar class.

Member Function Documentation

◆ abs()

Scalar cytnx::Scalar::abs ( ) const
inline

The member function to get the absolute value of the Scalar.

Note
Compare to the iabs() function, this function will return a new Scalar object.
Returns
The absolute value of the Scalar.
See also
iabs()

◆ astype()

Scalar cytnx::Scalar::astype ( const unsigned int &  dtype) const
inline

Type conversion function.

Parameters
[in]dtypeThe type of the output Scalar (see cytnx::Type for more details).
Returns
The converted Scalar.

◆ conj()

Scalar cytnx::Scalar::conj ( ) const
inline

Get the conjugate of the Scalar. That means return \( c^* \) if the Scalar is \( c \).

Returns
The conjugate of the Scalar.

◆ dtype()

int cytnx::Scalar::dtype ( ) const
inline

Get the dtype of the Scalar (see cytnx::Type for more details).

◆ eq() [1/2]

bool cytnx::Scalar::eq ( const Scalar rhs) const
inline

Return whether the current Scalar is equal to a given Scalar rhs.

That is, whether \( s = r \), where \( s \) is the current Scalar itself and \( r \) is the given Scalar rhs.

See also
operator==(const Scalar &lhs, const Scalar &rhs)

◆ eq() [2/2]

template<class T >
bool cytnx::Scalar::eq ( const T &  rc) const
inline

Return whether the current Scalar is equal to a given template number rc.

That is, whether \( s = r \), where \( s \) is the current Scalar itself and \( r \) is the given number rc.

See also
operator==(const Scalar &lhs, const Scalar &rhs)

◆ geq() [1/2]

bool cytnx::Scalar::geq ( const Scalar rhs) const
inline

Return whether the current Scalar is greater than or equal to a given Scalar rhs.

That is, whether \( s \geq r \), where \( s \) is the current Scalar itself and \( r \) is the given Scalar rhs.

See also
operator>=(const Scalar &lhs, const Scalar &rhs)

◆ geq() [2/2]

template<class T >
bool cytnx::Scalar::geq ( const T &  rc) const
inline

Return whether the current Scalar is greater than or equal to a given template number rc.

That is, whether \( s \geq r \), where \( s \) is the current Scalar itself and \( r \) is the given number rc.

See also
operator>=(const Scalar &lhs, const Scalar &rhs)

◆ greater() [1/2]

bool cytnx::Scalar::greater ( const Scalar rhs) const
inline

Return whether the current Scalar is greater than a given Scalar rhs.

That is, whether \( s > r \), where \( s \) is the current Scalar itself and \( r \) is the given Scalar rhs.

See also
operator>(const Scalar &lhs, const Scalar &rhs)

◆ greater() [2/2]

template<class T >
bool cytnx::Scalar::greater ( const T &  rc) const
inline

Return whether the current Scalar is greater than a given template number rc.

That is, whether \( s > r \), where \( s \) is the current Scalar itself and \( r \) is the given number rc.

See also
operator>(const Scalar &lhs, const Scalar &rhs)

◆ iabs()

void cytnx::Scalar::iabs ( )
inline

Set the Scalar to absolute value. (inplace)

◆ imag()

Scalar cytnx::Scalar::imag ( ) const
inline

Get the imaginary part of the Scalar. That means return \( \Im(c) \) if the Scalar is \( c \).

Returns
The imaginary part of the Scalar.

◆ isqrt()

void cytnx::Scalar::isqrt ( )
inline

Set the Scalar to square root. (inplace)

◆ leq() [1/2]

bool cytnx::Scalar::leq ( const Scalar rhs) const
inline

Return whether the current Scalar is less than or equal to a given Scalar rhs.

That is, whether \( s \leq r \), where \( s \) is the current Scalar itself and \( r \) is the given Scalar rhs.

See also
operator<=(const Scalar &lhs, const Scalar &rhs)

◆ leq() [2/2]

template<class T >
bool cytnx::Scalar::leq ( const T &  rc) const
inline

Return whether the current Scalar is less than or equal to a given template number rc.

That is, whether \( s \leq r \), where \( s \) is the current Scalar itself and \( r \) is the given number rc.

See also
operator<=(const Scalar &lhs, const Scalar &rhs)

◆ less() [1/2]

bool cytnx::Scalar::less ( const Scalar rhs) const
inline

Return whether the current Scalar is less than a given Scalar rhs.

That is, whether \( s < r \), where \( s \) is the current Scalar itself and \( r \) is the given Scalar rhs.

See also
operator<(const Scalar &lhs, const Scalar &rhs)

◆ less() [2/2]

template<class T >
bool cytnx::Scalar::less ( const T &  rc) const
inline

Return whether the current Scalar is less than a given template number rc.

That is, whether \( s < r \), where \( s \) is the current Scalar itself and \( r \) is the given number rc.

See also
operator<(const Scalar &lhs, const Scalar &rhs)

◆ maxval()

static Scalar cytnx::Scalar::maxval ( const unsigned int &  dtype)
inlinestatic

Get the max value of the Scalar with the given dtype.

This function is used to get the max value of the Scalar with the given dtype. That is, for example, if you want to get the max value of a Scalar with dtype=cytnx::Type.Int16, then you will get the max value of a 16-bit integer 32767.

Parameters
dtypeThe data type of the Scalar.
Returns
The max value of the Scalar with the given dtype.

◆ minval()

static Scalar cytnx::Scalar::minval ( const unsigned int &  dtype)
inlinestatic

Get the min value of the Scalar with the given dtype.

This function is used to get the min value of the Scalar with the given dtype. That is, for example, if you want to get the min value of a Scalar with dtype=cytnx::Type.Int16, then you will get the min value of a 16-bit integer -32768.

Parameters
[in]dtypeThe data type of the Scalar.
Returns
The min value of the Scalar with the given dtype.

◆ operator cytnx_bool()

cytnx::Scalar::operator cytnx_bool ( ) const
inlineexplicit

The explicit casting operator of the Scalar class to cytnx::cytnx_bool.

◆ operator cytnx_double()

cytnx::Scalar::operator cytnx_double ( ) const
inlineexplicit

The explicit casting operator of the Scalar class to cytnx::cytnx_double.

◆ operator cytnx_float()

cytnx::Scalar::operator cytnx_float ( ) const
inlineexplicit

The explicit casting operator of the Scalar class to cytnx::cytnx_float.

◆ operator cytnx_int16()

cytnx::Scalar::operator cytnx_int16 ( ) const
inlineexplicit

The explicit casting operator of the Scalar class to cytnx::cytnx_int16.

◆ operator cytnx_int32()

cytnx::Scalar::operator cytnx_int32 ( ) const
inlineexplicit

The explicit casting operator of the Scalar class to cytnx::cytnx_int32.

◆ operator cytnx_int64()

cytnx::Scalar::operator cytnx_int64 ( ) const
inlineexplicit

The explicit casting operator of the Scalar class to cytnx::cytnx_int64.

◆ operator cytnx_uint16()

cytnx::Scalar::operator cytnx_uint16 ( ) const
inlineexplicit

The explicit casting operator of the Scalar class to cytnx::cytnx_uint16.

◆ operator cytnx_uint32()

cytnx::Scalar::operator cytnx_uint32 ( ) const
inlineexplicit

The explicit casting operator of the Scalar class to cytnx::cytnx_uint32.

◆ operator cytnx_uint64()

cytnx::Scalar::operator cytnx_uint64 ( ) const
inlineexplicit

The explicit casting operator of the Scalar class to cytnx::cytnx_uint64.

◆ operator*=() [1/2]

void cytnx::Scalar::operator*= ( const Scalar rhs)
inline

The multiplication assignment operator of the Scalar class with a given Scalar.

◆ operator*=() [2/2]

template<class T >
void cytnx::Scalar::operator*= ( const T &  rc)
inline

The multiplication assignment operator of the Scalar class with a given number (template).

◆ operator+=() [1/2]

void cytnx::Scalar::operator+= ( const Scalar rhs)
inline

The addition assignment operator of the Scalar class with a given Scalar.

◆ operator+=() [2/2]

template<class T >
void cytnx::Scalar::operator+= ( const T &  rc)
inline

The addition assignment operator of the Scalar class with a given number (template).

◆ operator-=() [1/2]

void cytnx::Scalar::operator-= ( const Scalar rhs)
inline

The subtraction assignment operator of the Scalar class with a given Scalar.

◆ operator-=() [2/2]

template<class T >
void cytnx::Scalar::operator-= ( const T &  rc)
inline

The subtraction assignment operator of the Scalar class with a given number (template).

◆ operator/=() [1/2]

void cytnx::Scalar::operator/= ( const Scalar rhs)
inline

The division assignment operator of the Scalar class with a given Scalar.

Note
The divisor cannot be zero.

◆ operator/=() [2/2]

template<class T >
void cytnx::Scalar::operator/= ( const T &  rc)
inline

The division assignment operator of the Scalar class with a given number (template).

Note
The divisor cannot be zero.

◆ operator=() [1/12]

Scalar & cytnx::Scalar::operator= ( const cytnx_bool rhs)
inline

The copy assignment operator of the Scalar class with a given number cytnx::cytnx_bool rhs.

◆ operator=() [2/12]

Scalar & cytnx::Scalar::operator= ( const cytnx_complex128 rhs)
inline

The copy assignment operator of the Scalar class with a given number cytnx::cytnx_complex128 rhs.

◆ operator=() [3/12]

Scalar & cytnx::Scalar::operator= ( const cytnx_complex64 rhs)
inline

The copy assignment operator of the Scalar class with a given number cytnx::cytnx_complex64 rhs.

◆ operator=() [4/12]

Scalar & cytnx::Scalar::operator= ( const cytnx_double rhs)
inline

The copy assignment operator of the Scalar class with a given number cytnx::cytnx_double rhs.

◆ operator=() [5/12]

Scalar & cytnx::Scalar::operator= ( const cytnx_float rhs)
inline

The copy assignment operator of the Scalar class with a given number cytnx::cytnx_float rhs.

◆ operator=() [6/12]

Scalar & cytnx::Scalar::operator= ( const cytnx_int16 rhs)
inline

The copy assignment operator of the Scalar class with a given number cytnx::cytnx_int16 rhs.

◆ operator=() [7/12]

Scalar & cytnx::Scalar::operator= ( const cytnx_int32 rhs)
inline

The copy assignment operator of the Scalar class with a given number cytnx::cytnx_int32 rhs.

◆ operator=() [8/12]

Scalar & cytnx::Scalar::operator= ( const cytnx_int64 rhs)
inline

The copy assignment operator of the Scalar class with a given number cytnx::cytnx_int64 rhs.

◆ operator=() [9/12]

Scalar & cytnx::Scalar::operator= ( const cytnx_uint16 rhs)
inline

The copy assignment operator of the Scalar class with a given number cytnx::cytnx_uint16 rhs.

◆ operator=() [10/12]

Scalar & cytnx::Scalar::operator= ( const cytnx_uint32 rhs)
inline

The copy assignment operator of the Scalar class with a given number cytnx::cytnx_uint32 rhs.

◆ operator=() [11/12]

Scalar & cytnx::Scalar::operator= ( const cytnx_uint64 rhs)
inline

The copy assignment operator of the Scalar class with a given number cytnx::cytnx_uint64 rhs.

◆ operator=() [12/12]

Scalar & cytnx::Scalar::operator= ( const Scalar rhs)
inline

The copy assignment of the Scalar class.

◆ print()

void cytnx::Scalar::print ( ) const
inline

Print the Scalar to the standard output.

◆ radd() [1/2]

Scalar cytnx::Scalar::radd ( const Scalar rhs) const
inline

Return the addition of the current Scalar and a given Scalar rhs.

See also
operator+(const Scalar &lhs, const Scalar &rhs)

◆ radd() [2/2]

template<class T >
Scalar cytnx::Scalar::radd ( const T &  rc) const
inline

Return the addition of the current Scalar and a given template number rc.

See also
operator+(const Scalar &lhs, const Scalar &rhs)

◆ rdiv() [1/2]

Scalar cytnx::Scalar::rdiv ( const Scalar rhs) const
inline

Return the division of the current Scalar and a given Scalar rhs.

See also
operator/(const Scalar &lhs, const Scalar &rhs)
Note
The divisor rhs must not be zero.

◆ rdiv() [2/2]

template<class T >
Scalar cytnx::Scalar::rdiv ( const T &  rc) const
inline

Return the division of the current Scalar and a given template number rc.

See also
operator/(const Scalar &lhs, const Scalar &rhs)
Note
The divisor rc must not be zero.

◆ real()

Scalar cytnx::Scalar::real ( ) const
inline

Get the real part of the Scalar. That means return \( \Re(c) \) if the Scalar is \( c \).

Returns
The real part of the Scalar.

◆ rmul() [1/2]

Scalar cytnx::Scalar::rmul ( const Scalar rhs) const
inline

Return the multiplication of the current Scalar and a given Scalar rhs.

See also
operator*(const Scalar &lhs, const Scalar &rhs)

◆ rmul() [2/2]

template<class T >
Scalar cytnx::Scalar::rmul ( const T &  rc) const
inline

Return the multiplication of the current Scalar and a given template number rc.

See also
operator*(const Scalar &lhs, const Scalar &rhs)

◆ rsub() [1/2]

Scalar cytnx::Scalar::rsub ( const Scalar rhs) const
inline

Return the subtraction of the current Scalar and a given Scalar rhs.

See also
operator-(const Scalar &lhs, const Scalar &rhs)

◆ rsub() [2/2]

template<class T >
Scalar cytnx::Scalar::rsub ( const T &  rc) const
inline

Return the subtraction of the current Scalar and a given template number rc.

See also
operator-(const Scalar &lhs, const Scalar &rhs)

◆ sqrt()

Scalar cytnx::Scalar::sqrt ( ) const
inline

The member function to get the square root of the Scalar.

Note
Compare to the isqrt() function, this function will return a new Scalar object.
Returns
The square root of the Scalar.
See also
isqrt()

Member Data Documentation

◆ _impl

Scalar_base* cytnx::Scalar::_impl

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