IPCC  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CComplex Class Reference

This class for complex operation and saving value. More...

#include "Complex.h"

Collaboration diagram for CComplex:
Collaboration graph

Public Member Functions

 CComplex ()
 
 ~CComplex ()
 
void GetComplexNumber (double *fReal, double *fImaginary)
 Get Complex number real part and imaginary part concurrently. More...
 
void SetComplexNumber (double fReal, double fImaginaray)
 Set Complex number using real part and imaginary part. More...
 
double GetRealNumber () const
 Get real part. More...
 
double GetImaginaryNumber () const
 Get imaginary part. More...
 
CComplex GetConjugate ()
 Get conjugate complex number. More...
 
double GetAbsolute ()
 Get Absolute value of complex number. More...
 
void SetRealNumber (double fRealNumber)
 Set real part. More...
 
void SetImaginaryNumber (double fImaginaryNumber)
 Set imagenary part. More...
 
double GetNorm ()
 Get norm of complex number. More...
 
void Add (CComplex complex)
 Adding operation to this class. More...
 
void Minus (CComplex complex)
 Minus operation to this class. More...
 
void Division (double fScalar)
 Scalar division operation. More...
 
void Multiple (double fScalar)
 Scalar Multiply operation. More...
 
void operator= (const CComplex &complexSrc)
 operation overload for subsitution with reference parameter More...
 
CComplex operator+ (const CComplex &complexSrc)
 operation overload for subsitution with reference parameter More...
 
CComplex operator+= (const CComplex &complexSrc)
 operation overload for subsitution with reference parameter More...
 
CComplex operator- (const CComplex &complexSrc)
 operation overload for subsitution with reference parameter More...
 
CComplex operator-= (const CComplex &complexSrc)
 operation overload for subsitution with reference parameter More...
 
CComplex operator* (const CComplex &complexSrc)
 operation overload for subsitution with reference parameter More...
 
CComplex operator* (double fScalar)
 operation overload for subsitution with reference parameter More...
 
CComplex operator*= (const CComplex &complexSrc)
 operation overload for subsitution with reference parameter More...
 
CComplex operator*= (double fScalar)
 operation overload for subsitution with reference parameter More...
 
CComplex operator/ (const CComplex &complexSrc)
 operation overload for subsitution with reference parameter More...
 
CComplex operator/ (double fScalar)
 operation overload for subsitution with reference parameter More...
 
CComplex operator/= (const CComplex &complexSrc)
 operation overload for subsitution with reference parameter More...
 
CComplex operator/= (double fScalar)
 operation overload for subsitution with reference parameter More...
 
bool operator== (double fScalar)
 operation overload for subsitution with reference parameter More...
 
bool operator== (CComplex &complexSrc)
 operation overload for subsitution with reference parameter More...
 

Static Public Member Functions

static CComplex AddComplex (CComplex complex1, CComplex complex2)
 Adding operation between complex numbers. More...
 
static CComplex MinusComplex (CComplex complex1, CComplex complex2)
 Minus operation between complex numbers. More...
 
static CComplex MulltiplyComplex (CComplex complex1, CComplex complex2)
 Multiple operation between complex numbers. More...
 
static CComplex DivideComplex (CComplex complex1, CComplex complex2)
 Divide operation between complex numbers. More...
 
static bool IsSame (CComplex complex1, CComplex complex2)
 

Public Attributes

double m_fRealNumber
 Real part of complex number. More...
 
double m_fImaginaryNumber
 Imaginary part of complex number. More...
 

Detailed Description

This class for complex operation and saving value.

Date
27/May/2014

Definition at line 16 of file Complex.h.

Constructor & Destructor Documentation

CComplex::CComplex ( )

Definition at line 10 of file Complex.cpp.

References m_fImaginaryNumber, and m_fRealNumber.

11 {
12  m_fRealNumber = 0.;
13  m_fImaginaryNumber = 0.;
14 }
double m_fImaginaryNumber
Imaginary part of complex number.
Definition: Complex.h:70
double m_fRealNumber
Real part of complex number.
Definition: Complex.h:69
CComplex::~CComplex ( )

Definition at line 16 of file Complex.cpp.

17 {
18 }

Member Function Documentation

void CComplex::Add ( CComplex  complex)

Adding operation to this class.

Parameters
complexoperand

Definition at line 67 of file Complex.cpp.

References GetImaginaryNumber(), GetRealNumber(), m_fImaginaryNumber, and m_fRealNumber.

Referenced by CMatrixOperation::MMMul(), and CMatrixOperation::MVMul().

68 {
69  double fReal, fImaginary;
70 
71  fReal = complex.GetRealNumber();
72  m_fRealNumber += fReal;
73  fImaginary = complex.GetImaginaryNumber();
74  m_fImaginaryNumber += fImaginary;
75 }
double m_fImaginaryNumber
Imaginary part of complex number.
Definition: Complex.h:70
double m_fRealNumber
Real part of complex number.
Definition: Complex.h:69
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

Here is the caller graph for this function:

CComplex CComplex::AddComplex ( CComplex  complex1,
CComplex  complex2 
)
static

Adding operation between complex numbers.

Parameters
complex1operand 1
complex2operand 2
Returns
Calculation result

Definition at line 98 of file Complex.cpp.

References GetImaginaryNumber(), GetRealNumber(), and SetComplexNumber().

Referenced by operator+(), and operator+=().

99 {
100  CComplex rtnNumber;
101 
102  rtnNumber.SetComplexNumber(complex1.GetRealNumber() + complex2.GetRealNumber(),
103  complex1.GetImaginaryNumber() + complex2.GetImaginaryNumber());
104  return rtnNumber;
105 }
void SetComplexNumber(double fReal, double fImaginaray)
Set Complex number using real part and imaginary part.
Definition: Complex.cpp:58
This class for complex operation and saving value.
Definition: Complex.h:16
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

Here is the caller graph for this function:

CComplex CComplex::DivideComplex ( CComplex  complex1,
CComplex  complex2 
)
static

Divide operation between complex numbers.

Parameters
complex1operand 1
complex2operand 2
Returns
Calculation result

Definition at line 143 of file Complex.cpp.

References GetImaginaryNumber(), GetRealNumber(), and SetComplexNumber().

Referenced by operator/(), and operator/=().

144 {
145  CComplex rtnNumber;
146 
147  double realNumber, imaginaryNumber, d;
148 
149  d = complex2.GetRealNumber() * complex2.GetRealNumber() + complex2.GetImaginaryNumber() * complex2.GetImaginaryNumber();
150 
151  realNumber = complex1.GetRealNumber() * complex2.GetRealNumber() + complex1.GetImaginaryNumber() * complex2.GetImaginaryNumber();
152  realNumber /= d;
153 
154  imaginaryNumber = complex1.GetImaginaryNumber() * complex2.GetRealNumber() - complex1.GetRealNumber() * complex2.GetImaginaryNumber();
155  imaginaryNumber /= d;
156 
157  rtnNumber.SetComplexNumber(realNumber, imaginaryNumber);
158  return rtnNumber;
159 }
void SetComplexNumber(double fReal, double fImaginaray)
Set Complex number using real part and imaginary part.
Definition: Complex.cpp:58
This class for complex operation and saving value.
Definition: Complex.h:16
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

Here is the caller graph for this function:

void CComplex::Division ( double  fScalar)

Scalar division operation.

Definition at line 86 of file Complex.cpp.

References m_fImaginaryNumber, and m_fRealNumber.

87 {
88  m_fRealNumber /= fScalar;
89  m_fImaginaryNumber /= fScalar;
90 }
double m_fImaginaryNumber
Imaginary part of complex number.
Definition: Complex.h:70
double m_fRealNumber
Real part of complex number.
Definition: Complex.h:69
double CComplex::GetAbsolute ( )

Get Absolute value of complex number.

Returns
Absolute of complex number

Definition at line 23 of file Complex.cpp.

References GetImaginaryNumber(), and GetRealNumber().

Referenced by CLanczosMethod::BuildWaveFunction(), and CLanczosMethod::RecalcuWaveFunction().

24 {
25  double fRealNumber = GetRealNumber();
26  double fImginaryNumber = GetImaginaryNumber();
27 
28  return sqrt( fRealNumber*fRealNumber + fImginaryNumber*fImginaryNumber );
29 }
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

Here is the caller graph for this function:

void CComplex::GetComplexNumber ( double *  fReal,
double *  fImaginary 
)

Get Complex number real part and imaginary part concurrently.

Parameters
[out]fRealReal part
[out]fImaginaryImaginary part

Definition at line 48 of file Complex.cpp.

References m_fImaginaryNumber, and m_fRealNumber.

49 {
50  *fReal = m_fRealNumber;
51  *fImaginary = m_fImaginaryNumber;
52 }
double m_fImaginaryNumber
Imaginary part of complex number.
Definition: Complex.h:70
double m_fRealNumber
Real part of complex number.
Definition: Complex.h:69
CComplex CComplex::GetConjugate ( )

Get conjugate complex number.

Returns
Conjugate complex number

Definition at line 34 of file Complex.cpp.

References GetImaginaryNumber(), GetRealNumber(), SetImaginaryNumber(), and SetRealNumber().

35 {
36  CComplex rtnNumber;
37 
38  rtnNumber.SetRealNumber(GetRealNumber());
39  rtnNumber.SetImaginaryNumber(GetImaginaryNumber() * -1);
40 
41  return rtnNumber;
42 }
void SetImaginaryNumber(double fImaginaryNumber)
Set imagenary part.
Definition: Complex.h:30
void SetRealNumber(double fRealNumber)
Set real part.
Definition: Complex.h:29
This class for complex operation and saving value.
Definition: Complex.h:16
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

double CComplex::GetNorm ( )
inline

Get norm of complex number.

Definition at line 32 of file Complex.h.

References m_fImaginaryNumber, and m_fRealNumber.

Referenced by CLanczosResultAudit::AuditResult_WF().

Here is the caller graph for this function:

double CComplex::GetRealNumber ( ) const
inline

Get real part.

Definition at line 24 of file Complex.h.

References m_fRealNumber.

Referenced by Add(), AddComplex(), CMPIManager::AllReduceComlex(), CMatrixOperation::CDMatrix::AppendMatrix(), CMatrixOperation::BuildLocalCSR(), CHamiltonianBuilder::BuildOffsiteMatrixFor10Band(), CGeometricShape::BuildPEBiasVector(), CGeometricShape::BuildPEWaveVector(), CZincblendeParam::CalculateLatticeCoonstants(), DivideComplex(), CSPLoop::executeSPLoop(), CHamiltonianBuilder::FillMatrixFor10Band(), GetAbsolute(), GetConjugate(), CMatrixOperation::Gram_schmidt(), CMatrixOperation::CCSR::InsertMatrix(), CMatrixOperation::CVector::InsertVector(), IsSame(), CMatrixOperation::IsSame(), CLanczosMethod::LanczosIterationLoop(), CLanczosMethod::MergeDegeneratedEigenvalues(), Minus(), MinusComplex(), CMatrixOperation::CVector::MinusVector(), MulltiplyComplex(), operator*(), operator*=(), operator/(), operator/=(), operator=(), CMatrixOperation::CVector::PlusVector(), CMatrixOperation::CCSR::PushMatrix(), CMatrixOperation::CCSR::PushMatrixConcurrent(), CMatrixOperation::CCSR::PushMatrixConcurrentPE(), CGeometricShape::RefillPeriodicBinding(), CMatrixOperation::CVector::ReorthogonalizationVector(), IGeometricUnitCellInfo::RotateAxis(), IGeometricUnitCellInfo::RotateNeighbor(), CHamiltonianBuilder::RotateTransMatrixFor10Band(), CLanczosMethod::SaveLanczosResult(), CMatrixOperation::CVector::ScalarDivision(), CMatrixOperation::CVector::ScalarMultiple(), CMatrixOperation::ScalarMulVectors(), CMatrixOperation::CVector::SetAt(), CMatrixOperation::CCSR::SetAt(), CMatrixOperation::CVector::SetAtEx(), CMatrixOperation::CDMatrix::SetElement(), CUtility::ShowComplex(), CUtility::ShowCSR(), CUtility::ShowDenseMatrix(), CUtility::ShowDoubleVector(), and CMatrixOperation::UpdateLocalCSR().

bool CComplex::IsSame ( CComplex  complex1,
CComplex  complex2 
)
static
Parameters
complex1Comparing source 1
complex2Comparing source 2
Returns
Comparing result

Definition at line 323 of file Complex.cpp.

References GENERAL_TOLERANCE, GetImaginaryNumber(), and GetRealNumber().

Referenced by operator==().

324 {
325  bool bRtn = false;
326 
327  if (fabs(complex1.GetRealNumber()- complex2.GetRealNumber()) > GENERAL_TOLERANCE)
328  return bRtn;
329 
330  if (fabs(complex1.GetImaginaryNumber()- complex2.GetImaginaryNumber()) < GENERAL_TOLERANCE)
331  bRtn = true;
332 
333  return bRtn;
334 }
#define GENERAL_TOLERANCE
General tolerance definition.
Definition: Global.h:47
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

Here is the caller graph for this function:

void CComplex::Minus ( CComplex  complex)

Minus operation to this class.

Parameters
complexoperand

Definition at line 80 of file Complex.cpp.

References GetImaginaryNumber(), GetRealNumber(), m_fImaginaryNumber, and m_fRealNumber.

81 {
82  m_fRealNumber -= complex.GetRealNumber();
84 }
double m_fImaginaryNumber
Imaginary part of complex number.
Definition: Complex.h:70
double m_fRealNumber
Real part of complex number.
Definition: Complex.h:69
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

CComplex CComplex::MinusComplex ( CComplex  complex1,
CComplex  complex2 
)
static

Minus operation between complex numbers.

Parameters
complex1operand 1
complex2operand 2
Returns
Calculation result

Definition at line 112 of file Complex.cpp.

References GetImaginaryNumber(), GetRealNumber(), and SetComplexNumber().

Referenced by operator-(), and operator-=().

113 {
114  CComplex rtnNumber;
115 
116  rtnNumber.SetComplexNumber(complex1.GetRealNumber() - complex2.GetRealNumber(),
117  complex1.GetImaginaryNumber() - complex2.GetImaginaryNumber());
118  return rtnNumber;
119 }
void SetComplexNumber(double fReal, double fImaginaray)
Set Complex number using real part and imaginary part.
Definition: Complex.cpp:58
This class for complex operation and saving value.
Definition: Complex.h:16
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

Here is the caller graph for this function:

CComplex CComplex::MulltiplyComplex ( CComplex  complex1,
CComplex  complex2 
)
static

Multiple operation between complex numbers.

Parameters
complex1operand 1
complex2operand 2
Returns
Calculation result

Definition at line 126 of file Complex.cpp.

References GetImaginaryNumber(), GetRealNumber(), and SetComplexNumber().

Referenced by CMatrixOperation::MMMul(), CMatrixOperation::MVMul(), operator*(), and operator*=().

127 {
128  CComplex rtnNumber;
129 
130  double realNumber, imaginaryNumber;
131 
132  realNumber = complex1.GetRealNumber() * complex2.GetRealNumber() - complex1.GetImaginaryNumber() * complex2.GetImaginaryNumber();
133  imaginaryNumber = complex1.GetRealNumber() * complex2.GetImaginaryNumber() + complex1.GetImaginaryNumber() * complex2.GetRealNumber();
134  rtnNumber.SetComplexNumber(realNumber, imaginaryNumber);
135  return rtnNumber;
136 }
void SetComplexNumber(double fReal, double fImaginaray)
Set Complex number using real part and imaginary part.
Definition: Complex.cpp:58
This class for complex operation and saving value.
Definition: Complex.h:16
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

Here is the caller graph for this function:

void CComplex::Multiple ( double  fScalar)

Scalar Multiply operation.

CComplex CComplex::operator* ( const CComplex complexSrc)

operation overload for subsitution with reference parameter

Parameters
complexSrcopperand
Returns
Calculation result

Definition at line 209 of file Complex.cpp.

References MulltiplyComplex().

210 {
211  CComplex rtnValue;
212 
213  return MulltiplyComplex((*this), complexSrc);
214 }
static CComplex MulltiplyComplex(CComplex complex1, CComplex complex2)
Multiple operation between complex numbers.
Definition: Complex.cpp:126
This class for complex operation and saving value.
Definition: Complex.h:16

Here is the call graph for this function:

CComplex CComplex::operator* ( double  fScalar)

operation overload for subsitution with reference parameter

Parameters
fScalarScalar number that want to multiply
Returns
Calculation result

Definition at line 220 of file Complex.cpp.

References GetImaginaryNumber(), GetRealNumber(), and SetComplexNumber().

221 {
222  CComplex rtnValue;
223 
224  rtnValue.SetComplexNumber(this->GetRealNumber() * fScalar, this->GetImaginaryNumber() * fScalar);
225  return rtnValue;
226 }
void SetComplexNumber(double fReal, double fImaginaray)
Set Complex number using real part and imaginary part.
Definition: Complex.cpp:58
This class for complex operation and saving value.
Definition: Complex.h:16
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

CComplex CComplex::operator*= ( const CComplex complexSrc)

operation overload for subsitution with reference parameter

Parameters
complexSrcopperand
Returns
Calculation result

Definition at line 232 of file Complex.cpp.

References MulltiplyComplex().

233 {
234  CComplex rtnValue;
235 
236  return MulltiplyComplex((*this), complexSrc);
237 }
static CComplex MulltiplyComplex(CComplex complex1, CComplex complex2)
Multiple operation between complex numbers.
Definition: Complex.cpp:126
This class for complex operation and saving value.
Definition: Complex.h:16

Here is the call graph for this function:

CComplex CComplex::operator*= ( double  fScalar)

operation overload for subsitution with reference parameter

Parameters
fScalarScalar number that want to multiply
Returns
Calculation result

Definition at line 243 of file Complex.cpp.

References GetImaginaryNumber(), GetRealNumber(), and SetComplexNumber().

244 {
245  CComplex rtnValue;
246 
247  rtnValue.SetComplexNumber(this->GetRealNumber() * fScalar, this->GetImaginaryNumber() * fScalar);
248  return rtnValue;
249 }
void SetComplexNumber(double fReal, double fImaginaray)
Set Complex number using real part and imaginary part.
Definition: Complex.cpp:58
This class for complex operation and saving value.
Definition: Complex.h:16
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

CComplex CComplex::operator+ ( const CComplex complexSrc)

operation overload for subsitution with reference parameter

Parameters
complexSrcopperand
Returns
Calculation result

Definition at line 173 of file Complex.cpp.

References AddComplex().

174 {
175  return AddComplex((*this), complexSrc);
176 }
static CComplex AddComplex(CComplex complex1, CComplex complex2)
Adding operation between complex numbers.
Definition: Complex.cpp:98

Here is the call graph for this function:

CComplex CComplex::operator+= ( const CComplex complexSrc)

operation overload for subsitution with reference parameter

Parameters
complexSrcopperand
Returns
Calculation result

Definition at line 182 of file Complex.cpp.

References AddComplex().

183 {
184  return AddComplex((*this), complexSrc);
185 }
static CComplex AddComplex(CComplex complex1, CComplex complex2)
Adding operation between complex numbers.
Definition: Complex.cpp:98

Here is the call graph for this function:

CComplex CComplex::operator- ( const CComplex complexSrc)

operation overload for subsitution with reference parameter

Parameters
complexSrcopperand
Returns
Calculation result

Definition at line 191 of file Complex.cpp.

References MinusComplex().

192 {
193  return MinusComplex((*this), complexSrc);
194 }
static CComplex MinusComplex(CComplex complex1, CComplex complex2)
Minus operation between complex numbers.
Definition: Complex.cpp:112

Here is the call graph for this function:

CComplex CComplex::operator-= ( const CComplex complexSrc)

operation overload for subsitution with reference parameter

Parameters
complexSrcopperand
Returns
Calculation result

Definition at line 200 of file Complex.cpp.

References MinusComplex().

201 {
202  return MinusComplex((*this), complexSrc);
203 }
static CComplex MinusComplex(CComplex complex1, CComplex complex2)
Minus operation between complex numbers.
Definition: Complex.cpp:112

Here is the call graph for this function:

CComplex CComplex::operator/ ( const CComplex complexSrc)

operation overload for subsitution with reference parameter

Parameters
complexSrcopperand
Returns
Calculation result

Definition at line 255 of file Complex.cpp.

References DivideComplex().

256 {
257  CComplex rtnValue;
258 
259  return DivideComplex((*this), complexSrc);
260 }
This class for complex operation and saving value.
Definition: Complex.h:16
static CComplex DivideComplex(CComplex complex1, CComplex complex2)
Divide operation between complex numbers.
Definition: Complex.cpp:143

Here is the call graph for this function:

CComplex CComplex::operator/ ( double  fScalar)

operation overload for subsitution with reference parameter

Parameters
fScalarScalar number that want to divide
Returns
Calculation result

Definition at line 266 of file Complex.cpp.

References GetImaginaryNumber(), GetRealNumber(), and SetComplexNumber().

267 {
268  CComplex rtnValue;
269 
270  rtnValue.SetComplexNumber(this->GetRealNumber() / fScalar, this->GetImaginaryNumber() / fScalar);
271  return rtnValue;
272 }
void SetComplexNumber(double fReal, double fImaginaray)
Set Complex number using real part and imaginary part.
Definition: Complex.cpp:58
This class for complex operation and saving value.
Definition: Complex.h:16
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

CComplex CComplex::operator/= ( const CComplex complexSrc)

operation overload for subsitution with reference parameter

Parameters
complexSrcopperand
Returns
Calculation result

Definition at line 278 of file Complex.cpp.

References DivideComplex().

279 {
280  CComplex rtnValue;
281 
282  return DivideComplex((*this), complexSrc);
283 }
This class for complex operation and saving value.
Definition: Complex.h:16
static CComplex DivideComplex(CComplex complex1, CComplex complex2)
Divide operation between complex numbers.
Definition: Complex.cpp:143

Here is the call graph for this function:

CComplex CComplex::operator/= ( double  fScalar)

operation overload for subsitution with reference parameter

Parameters
fScalarScalar number that want to divide
Returns
Calculation result

Definition at line 289 of file Complex.cpp.

References GetImaginaryNumber(), GetRealNumber(), and SetComplexNumber().

290 {
291  CComplex rtnValue;
292 
293  rtnValue.SetComplexNumber(this->GetRealNumber() / fScalar, this->GetImaginaryNumber() / fScalar);
294  return rtnValue;
295 }
void SetComplexNumber(double fReal, double fImaginaray)
Set Complex number using real part and imaginary part.
Definition: Complex.cpp:58
This class for complex operation and saving value.
Definition: Complex.h:16
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

void CComplex::operator= ( const CComplex complexSrc)

operation overload for subsitution with reference parameter

Parameters
complexSrcopperand

Definition at line 164 of file Complex.cpp.

References GetImaginaryNumber(), GetRealNumber(), and SetComplexNumber().

165 {
166  SetComplexNumber(complexSrc.GetRealNumber(), complexSrc.GetImaginaryNumber());
167 }
void SetComplexNumber(double fReal, double fImaginaray)
Set Complex number using real part and imaginary part.
Definition: Complex.cpp:58
double GetImaginaryNumber() const
Get imaginary part.
Definition: Complex.h:25
double GetRealNumber() const
Get real part.
Definition: Complex.h:24

Here is the call graph for this function:

bool CComplex::operator== ( double  fScalar)

operation overload for subsitution with reference parameter

Parameters
fScalarScalar number that want to compare
Returns
Comparing result

Definition at line 301 of file Complex.cpp.

References IsSame(), and SetComplexNumber().

302 {
303  CComplex complex;
304 
305  complex.SetComplexNumber(fScalar, 0);
306  return IsSame(*this, complex);
307 }
static bool IsSame(CComplex complex1, CComplex complex2)
Definition: Complex.cpp:323
void SetComplexNumber(double fReal, double fImaginaray)
Set Complex number using real part and imaginary part.
Definition: Complex.cpp:58
This class for complex operation and saving value.
Definition: Complex.h:16

Here is the call graph for this function:

bool CComplex::operator== ( CComplex complexSrc)

operation overload for subsitution with reference parameter

Parameters
complexSrcComplex number that want to divide
Returns
Comparing result

Definition at line 313 of file Complex.cpp.

References IsSame().

314 {
315  return IsSame(*this, complexSrc);
316 }
static bool IsSame(CComplex complex1, CComplex complex2)
Definition: Complex.cpp:323

Here is the call graph for this function:

void CComplex::SetComplexNumber ( double  fReal,
double  fImaginaray 
)

Set Complex number using real part and imaginary part.

Parameters
fRealReal part
fImaginaryImaginary part

Definition at line 58 of file Complex.cpp.

References SetImaginaryNumber(), and SetRealNumber().

Referenced by AddComplex(), CMPIManager::AllReduceComlex(), CLanczosResultAudit::AuditResult_WF(), DivideComplex(), CMatrixOperation::CVector::GetAt(), CMatrixOperation::CCSR::GetElement(), MinusComplex(), MulltiplyComplex(), operator*(), operator*=(), operator/(), operator/=(), operator=(), operator==(), CGeometricShape::RefillPeriodicBinding(), CMatrixOperation::CVector::ScalarDivision(), CMatrixOperation::CVector::ScalarMultiple(), and CMatrixOperation::VVDot().

59 {
60  SetRealNumber(fReal);
61  SetImaginaryNumber(fImaginaray);
62 }
void SetImaginaryNumber(double fImaginaryNumber)
Set imagenary part.
Definition: Complex.h:30
void SetRealNumber(double fRealNumber)
Set real part.
Definition: Complex.h:29

Here is the call graph for this function:

Here is the caller graph for this function:

void CComplex::SetImaginaryNumber ( double  fImaginaryNumber)
inline

Set imagenary part.

Definition at line 30 of file Complex.h.

References m_fImaginaryNumber.

Referenced by GetConjugate(), SetComplexNumber(), and CMatrixOperation::UpdateLocalCSR().

Here is the caller graph for this function:

void CComplex::SetRealNumber ( double  fRealNumber)
inline

Set real part.

Definition at line 29 of file Complex.h.

References m_fRealNumber.

Referenced by CTBMS_Solver::ApplyPhPotential(), CHamiltonianBuilder::FillMatrixFor10Band(), GetConjugate(), SetComplexNumber(), and CMatrixOperation::UpdateLocalCSR().

Here is the caller graph for this function:

Member Data Documentation

double CComplex::m_fImaginaryNumber

Imaginary part of complex number.

Definition at line 70 of file Complex.h.

Referenced by Add(), CComplex(), Division(), GetComplexNumber(), GetImaginaryNumber(), GetNorm(), Minus(), and SetImaginaryNumber().

double CComplex::m_fRealNumber

Real part of complex number.

Definition at line 69 of file Complex.h.

Referenced by Add(), CComplex(), Division(), GetComplexNumber(), GetNorm(), GetRealNumber(), Minus(), and SetRealNumber().


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