Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

cps::Rcomplex Class Reference

A class defining a complex floating point data type. More...

#include <rcomplex.h>

List of all members.

Public Member Functions

 Rcomplex (IFloat a=0, IFloat b=0)
 Rcomplex (const Rcomplex &a)
 ~Rcomplex ()
Rcomplexoperator= (const Rcomplex &a)
IFloat real () const
 Get the real part.
IFloat imag () const
 Get the imaginary part.
void real (IFloat r)
 Assign to the real part.
void imag (IFloat i)
 Assign to the imaginary part.
IFloat norm () const
 Returns the square norm of the complex number.
IFloat abs () const
 Returns the norm (modulus) of the complex number.
Rcomplexoperator+= (const Rcomplex &a)
 Overloaded complex sum.
Rcomplexoperator+= (IFloat a)
 Overloaded real sum.
Rcomplexoperator-= (const Rcomplex &a)
 Overloaded complex subtraction.
Rcomplexoperator-= (IFloat a)
 Overloaded real subtraction.
Rcomplexoperator *= (const Rcomplex &a)
 Overloaded complex multiplication.
Rcomplexoperator *= (IFloat a)
 Overloaded real multiplication.
Rcomplexoperator/= (const Rcomplex &a)
 Overloaded complex division.
Rcomplexoperator/= (IFloat a)
 Overloaded real division.

Friends

Rcomplex conj (const Rcomplex &c)
 Complex conjugation.
Rcomplex operator+ (const Rcomplex &c1, const Rcomplex &c2)
 Complex addition.
Rcomplex operator+ (const Rcomplex &c, IFloat f)
 Real addition.
Rcomplex operator+ (IFloat f, const Rcomplex &c)
 Real addition.
Rcomplex operator- (const Rcomplex &c1, const Rcomplex &c2)
 Complex subtraction.
Rcomplex operator- (const Rcomplex &c, IFloat f)
 Real subtraction.
Rcomplex operator- (IFloat f, const Rcomplex &c)
 Real subtraction.
Rcomplex operator * (const Rcomplex &c1, const Rcomplex &c2)
 Complex multiplication.
Rcomplex operator * (const Rcomplex &c, IFloat f)
 Real multiplication.
Rcomplex operator * (IFloat f, const Rcomplex &c)
 Real multiplication.
Rcomplex operator/ (const Rcomplex &c1, const Rcomplex &c2)
 Complex division.
Rcomplex operator/ (const Rcomplex &c, IFloat f)
 Real division.
Rcomplex operator/ (IFloat f, const Rcomplex &c)
 Real division.
Rcomplex operator- (const Rcomplex &c)
 Unary negation.
IFloat real (const Rcomplex &c)
 Real part.
IFloat imag (const Rcomplex &c)
 Imaginary part.
IFloat norm (const Rcomplex &c)
 Square norm.
IFloat abs (const Rcomplex &c)
 Complex norm (modulus).


Detailed Description

A class defining a complex floating point data type.

The usual operations, arithmetic and otherwise, on complex numbers are defined.

N.B. the friend functions do not actually reference private data or methods.

Definition at line 40 of file rcomplex.h.


Constructor & Destructor Documentation

cps::Rcomplex::Rcomplex IFloat  a = 0,
IFloat  b = 0
 

The complex number is initialised with zero real and imaginary parts by default.

Definition at line 36 of file rcomplex.C.

cps::Rcomplex::Rcomplex const Rcomplex a  ) 
 

Definition at line 39 of file rcomplex.C.

cps::Rcomplex::~Rcomplex  ) 
 

Definition at line 42 of file rcomplex.C.


Member Function Documentation

IFloat cps::Rcomplex::abs  )  const
 

Returns the norm (modulus) of the complex number.

Definition at line 48 of file rcomplex.C.

References cps::IFloat, and norm().

void cps::Rcomplex::imag IFloat  i  )  [inline]
 

Assign to the imaginary part.

Parameters:
i the imaginary part

Definition at line 67 of file rcomplex.h.

IFloat cps::Rcomplex::imag  )  const [inline]
 

Get the imaginary part.

Returns:
the imaginary part

Definition at line 60 of file rcomplex.h.

References cps::IFloat.

Referenced by cps::WilsonVector::conj(), cps::FermionVectorTp::CopyWilsonMatSink(), cps::FermionVectorTp::CopyWilsonVec(), cps::WspectMesons::DiracAlgebra(), cps::Nuc3ptStru::InsertOp(), cps::DiracOp::MinResExt(), cps::WilsonMatrix::operator=(), cps::Nuc3pt::Print(), cps::Matrix::ProjSU3(), cps::qcdio_norm_row(), cps::Mom::run(), cps::QPropW::Run(), cps::AlgMom::run(), cps::AlgEig::run(), cps::AlgDens::run(), cps::twist_links(), cps::WilsonMatrix::WilsonMatrix(), and cps::WspectMomenta::WspectMomenta().

IFloat cps::Rcomplex::norm  )  const
 

Returns the square norm of the complex number.

Definition at line 26 of file rcomplex_sun.C.

References cps::IFloat.

Referenced by abs(), and cps::DiracOpWilsonTypes::RitzEig().

Rcomplex & cps::Rcomplex::operator *= IFloat  a  ) 
 

Overloaded real multiplication.

Definition at line 59 of file rcomplex_sun.C.

Rcomplex & cps::Rcomplex::operator *= const Rcomplex a  ) 
 

Overloaded complex multiplication.

Definition at line 51 of file rcomplex_sun.C.

References cps::IFloat, im, and re.

Rcomplex & cps::Rcomplex::operator+= IFloat  a  ) 
 

Overloaded real sum.

Definition at line 35 of file rcomplex_sun.C.

Rcomplex & cps::Rcomplex::operator+= const Rcomplex a  ) 
 

Overloaded complex sum.

Definition at line 29 of file rcomplex_sun.C.

References im, and re.

Rcomplex & cps::Rcomplex::operator-= IFloat  a  ) 
 

Overloaded real subtraction.

Definition at line 46 of file rcomplex_sun.C.

Rcomplex & cps::Rcomplex::operator-= const Rcomplex a  ) 
 

Overloaded complex subtraction.

Definition at line 40 of file rcomplex_sun.C.

References im, and re.

Rcomplex & cps::Rcomplex::operator/= IFloat  a  ) 
 

Overloaded real division.

Definition at line 74 of file rcomplex_sun.C.

Rcomplex & cps::Rcomplex::operator/= const Rcomplex a  ) 
 

Overloaded complex division.

Definition at line 65 of file rcomplex_sun.C.

References cps::IFloat, im, and re.

Rcomplex & cps::Rcomplex::operator= const Rcomplex a  ) 
 

Definition at line 45 of file rcomplex.C.

References im, and re.

void cps::Rcomplex::real IFloat  r  )  [inline]
 

Assign to the real part.

Parameters:
r the real part

Definition at line 64 of file rcomplex.h.

IFloat cps::Rcomplex::real  )  const [inline]
 

Get the real part.

Returns:
the real part

Definition at line 57 of file rcomplex.h.

References cps::IFloat.

Referenced by cps::FermionVectorTp::CopyWilsonMatSink(), cps::FermionVectorTp::CopyWilsonVec(), cps::WspectMesons::DiracAlgebra(), cps::Nuc3ptStru::InsertOp(), cps::DiracOp::MinResExt(), cps::WilsonMatrix::operator=(), cps::WspectMesons::print(), cps::WspectExtendedMesons::print(), cps::WspectExtendedMesonsBE::print(), cps::Nuc3pt::Print(), cps::WspectMesons::print_mp(), cps::Matrix::ProjSU3(), cps::qcdio_norm_row(), cps::qcdio_orthog_rows(), cps::Mom::run(), cps::AlgTcharge::run(), cps::QPropW::Run(), cps::AlgMom::run(), cps::AlgEig::run(), cps::AlgDens::run(), cps::twist_links(), cps::WilsonMatrix::WilsonMatrix(), and cps::WspectMomenta::WspectMomenta().


Friends And Related Function Documentation

IFloat abs const Rcomplex c  )  [friend]
 

Complex norm (modulus).

Definition at line 161 of file rcomplex.h.

Rcomplex conj const Rcomplex c  )  [friend]
 

Complex conjugation.

Definition at line 80 of file rcomplex_sun.C.

IFloat imag const Rcomplex c  )  [friend]
 

Imaginary part.

Definition at line 157 of file rcomplex.h.

IFloat norm const Rcomplex c  )  [friend]
 

Square norm.

Definition at line 159 of file rcomplex.h.

Rcomplex operator * IFloat  f,
const Rcomplex c
[friend]
 

Real multiplication.

Definition at line 133 of file rcomplex.h.

Rcomplex operator * const Rcomplex c,
IFloat  f
[friend]
 

Real multiplication.

Definition at line 129 of file rcomplex.h.

Rcomplex operator * const Rcomplex c1,
const Rcomplex c2
[friend]
 

Complex multiplication.

Definition at line 125 of file rcomplex.h.

Rcomplex operator+ IFloat  f,
const Rcomplex c
[friend]
 

Real addition.

Definition at line 109 of file rcomplex.h.

Rcomplex operator+ const Rcomplex c,
IFloat  f
[friend]
 

Real addition.

Definition at line 105 of file rcomplex.h.

Rcomplex operator+ const Rcomplex c1,
const Rcomplex c2
[friend]
 

Complex addition.

Definition at line 101 of file rcomplex.h.

Rcomplex operator- const Rcomplex c  )  [friend]
 

Unary negation.

Definition at line 83 of file rcomplex_sun.C.

Rcomplex operator- IFloat  f,
const Rcomplex c
[friend]
 

Real subtraction.

Definition at line 121 of file rcomplex.h.

Rcomplex operator- const Rcomplex c,
IFloat  f
[friend]
 

Real subtraction.

Definition at line 117 of file rcomplex.h.

Rcomplex operator- const Rcomplex c1,
const Rcomplex c2
[friend]
 

Complex subtraction.

Definition at line 113 of file rcomplex.h.

Rcomplex operator/ IFloat  f,
const Rcomplex c
[friend]
 

Real division.

Definition at line 145 of file rcomplex.h.

Rcomplex operator/ const Rcomplex c,
IFloat  f
[friend]
 

Real division.

Definition at line 141 of file rcomplex.h.

Rcomplex operator/ const Rcomplex c1,
const Rcomplex c2
[friend]
 

Complex division.

Definition at line 137 of file rcomplex.h.

IFloat real const Rcomplex c  )  [friend]
 

Real part.

Definition at line 155 of file rcomplex.h.


The documentation for this class was generated from the following files:
Generated on Sat Oct 10 14:12:14 2009 for Columbia Physics System by  doxygen 1.3.9.1