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

cps::Vector Class Reference

A class implementing a general 3 component complex vector. More...

#include <vector.h>

List of all members.

Public Member Functions

 Vector ()
Vectoroperator= (const Vector &x)
 Overloaded assignment.
Vectoroperator *= (IFloat p)
 Multiplies this vector by a real scalar.
Vectoroperator+= (const Vector &x)
 Adds a vector m to this vector.
Vectoroperator-= (const Vector &x)
 Subtracts a vector m to this vector.
void DotXEqual (const Matrix &m, const Vector &x)
 Assignment to matrix-vector product.
void Normalize (void)
 Normalisation.
void Orthogonalize (const Vector &p1)
 Orthogonalisation.
void Zero ()
 Zeroing a color vector.
Complexoperator[] (int i)
 simple element access (as a Complex)
void CopyVec (const Vector *b, int len)
 Assignment to another vector.
Float NormSqNode (int len)
 Square norm.
Float NormSqGlbSum (int len)
 Square norm with global sum.
Float NormSqGlbSum4D (int len)
void Print (int len)
 Print the vector content to the screen.
Float ReDotProductNode (const Vector *b, int len)
 The real part of the dot product.
Float ReDotProductGlbSum (const Vector *b, int len)
 The real part of the dot product with global sum.
Float ReDotProductGlbSum4D (const Vector *b, int len)
void NormSqArraySliceSum (Float *f_out, const int size, const int dir)
 Sum the square norms of vectors in 3-dim slices.
void SliceArraySum (Float *sum, const Float *f_in, const int dir)
 Sum an array of Floats on a 4-dim lattice in 3-dim slices.
void SliceArraySumFive (Float *sum, const Float *f_in, const int dir)
 Sum an array of Floats on a 5-dim lattice in 4-dim slices.
void VecZero (int len)
 Assign vector to zero.
void VecNegative (const Vector *b, int len)
 Assignment to a negated vector.
void VecTimesEquFloat (const Float &fb, int len)
 Multiplication by a real scalar.
void VecEqualsVecTimesEquFloat (const Vector *u, const Float &fb, int len)
 Multiplication by a real scalar.
void VecAddEquVec (const Vector *b, int len)
 Addition of another vector.
void VecMinusEquVec (const Vector *b, int len)
 Subtraction of another vector.
void FTimesV1PlusV2 (Float fb, Vector *c, Vector *d, int len)
 Assignment of the linear combination fb * c + d.
void FTimesV1MinusV2 (const Float &fb, const Vector *c, const Vector *d, int len)
 Assignment of the linear combination fb * c - d.
Complex CompDotProductNode (const Vector *b, int len)
 The dot product with another vector.
Complex CompDotProductGlbSum (const Vector *b, int len)
 The dot product with another vector, with global sum.
Complex CompDotProductGlbSum4D (const Vector *b, int len)
void CTimesV1PlusV2 (const Complex &fb, const Vector *c, const Vector *d, int len)
 Assignment of the linear combination fb * c + d.
void CTimesV1MinusV2 (const Complex &fb, const Vector *c, const Vector *d, int len)
 Assignment of the linear combination fb * c - d.

Friends

class Matrix


Detailed Description

A class implementing a general 3 component complex vector.

This is a schizophrenic class. It is really designed to be a class of complex 3-vectors, and many methods carry out operations on just such an object; e.g. the overloaded binary operators, the matrix-vector multiplications and the normalisation and orthogonalisation methods. However, some methods, those with take an argument int len, are really wrappers for functions operating on 1-dimensional floating point arrays of any length. They are meant to be used with an array of Vectors: the first Vector in the array operates not only on its own data but on that of all the other objects in the array by assuming that it is at the beginning of a contiguous floating point array. For the sake of sanity the argument len should be a multiple of 6.

Definition at line 389 of file vector.h.


Constructor & Destructor Documentation

cps::Vector::Vector  ) 
 

Definition at line 224 of file vector.C.


Member Function Documentation

Complex cps::Vector::CompDotProductGlbSum const Vector b,
int  len
 

The dot product with another vector, with global sum.

Parameters:
b Another vector
len The number of real numbers in the vectors.
Returns:
The dot product of this vector with b, summed over all nodes.

Definition at line 287 of file vector.C.

References cps::compDotProduct(), cps::Complex, cps::Float, cps::glb_sum_five(), and cps::IFloat.

Referenced by cps::DiracOpWilsonTypes::BiCGstab(), cps::DiracOp::GramSchm(), cps::GramSchmNorm(), cps::MatHermElements(), cps::DiracOp::MinResExt(), cps::DiracOp::Ritz(), cps::DiracOpWilsonTypes::RitzEig(), cps::AlgEig::run(), and cps::AlgDens::run().

Complex cps::Vector::CompDotProductGlbSum4D const Vector b,
int  len
 

Definition at line 295 of file vector.C.

References cps::compDotProduct(), cps::Complex, cps::Float, cps::glb_sum(), and cps::IFloat.

Referenced by cps::DiracOpStagTypes::RitzEig().

Complex cps::Vector::CompDotProductNode const Vector b,
int  len
[inline]
 

The dot product with another vector.

Parameters:
b Another vector
len The number of real numbers in the vectors.
Returns:
The dot product of this vector with b.

Definition at line 623 of file vector.h.

References cps::compDotProduct(), cps::Complex, and cps::IFloat.

void cps::Vector::CopyVec const Vector b,
int  len
[inline]
 

Assignment to another vector.

Parameters:
b Another vector
len The number of real numbers in the vectors.
Postcondition:
This vector = b
b should not alias this vector.

Definition at line 489 of file vector.h.

References cps::Float, and cps::moveFloat().

Referenced by cps::DiracOpWilsonTm::CalcBsnForceVecs(), cps::DiracOpWilsonTm::CalcHmdForceVecs(), cps::DiracOpWilson::CalcHmdForceVecs(), cps::DiracOpDwf::CalcHmdForceVecs(), cps::DiracOpClover::CalcHmdForceVecs(), cps::FdwfBase::EvolveMomFforce(), cps::Fclover::EvolveMomFforce(), cps::FermionVector::gaugeFixSink(), cps::FermionVectorTp::GaugeFixSink(), cps::FermionVectorTp::GFWallSource(), cps::DiracOp::InvCg(), cps::DiracOp::Jacobi(), cps::FermionVectorTp::LandauGaugeFixSink(), cps::DiracOp::MInvCG(), cps::DiracOp::Ritz(), cps::DiracOpWilsonTypes::RitzEig(), cps::AlgHmcPhi::run(), cps::AlgEig::run(), cps::FermionVectorTp::SetLandauGaugeMomentaSource(), cps::FermionVector::sumOverHyperPlane(), and cps::FermionVector::sumOverHyperPlaneStride().

void cps::Vector::CTimesV1MinusV2 const Complex fb,
const Vector c,
const Vector d,
int  len
[inline]
 

Assignment of the linear combination fb * c - d.

Parameters:
fb A complex scalar
c A vector
d A vector
len The number of real numbers in the vectors.
Postcondition:
This vector takes the value fb * c - d

Definition at line 655 of file vector.h.

References cps::Complex, cps::cTimesV1MinusV2(), and cps::IFloat.

void cps::Vector::CTimesV1PlusV2 const Complex fb,
const Vector c,
const Vector d,
int  len
[inline]
 

Assignment of the linear combination fb * c + d.

Parameters:
fb A complex scalar
c A vector
d A vector
len The number of real numbers in the vectors.
Postcondition:
This vector takes the value fb * c + d

Definition at line 642 of file vector.h.

References cps::Complex, cps::cTimesV1PlusV2(), and cps::IFloat.

Referenced by cps::DiracOp::GramSchm(), cps::GramSchmNorm(), cps::DiracOp::Jacobi(), cps::DiracOp::MinResExt(), and cps::DiracOp::Ritz().

void cps::Vector::DotXEqual const Matrix m,
const Vector x
[inline]
 

Assignment to matrix-vector product.

Parameters:
m A matrix.
x a vector
Postcondition:
This vector is takes the value Mx

Definition at line 443 of file vector.h.

References cps::IFloat, cps::Matrix::u, cps::uDotXEqual(), and v.

void cps::Vector::FTimesV1MinusV2 const Float fb,
const Vector c,
const Vector d,
int  len
[inline]
 

Assignment of the linear combination fb * c - d.

Parameters:
fb A real scalar
c A vector
d A vector
len The number of real numbers in the vectors.
Postcondition:
This vector takes the value fb * c - d

Definition at line 613 of file vector.h.

References cps::fTimesV1MinusV2(), and cps::IFloat.

Referenced by cps::DiracOpP4::MatPcDagMatPc(), and cps::AlgHmcPhi::run().

void cps::Vector::FTimesV1PlusV2 Float  fb,
Vector c,
Vector d,
int  len
[inline]
 

Assignment of the linear combination fb * c + d.

Parameters:
fb A real scalar
c A vector
d A vector
len The number of real numbers in the vectors.
Postcondition:
This vector takes the value fb * c + d

Definition at line 596 of file vector.h.

References BGL, cps::Float, QCDOC, TARGET, and vaxpy3().

Referenced by cps::Fp4::EvolveMomFforce(), cps::Fasqtad::EvolveMomFforce(), cps::DiracOp::InvCg(), cps::DiracOp::Ritz(), and cps::DiracOpWilsonTypes::RitzEig().

void cps::Vector::Normalize void   ) 
 

Normalisation.

Postcondition:
The L2 norm of this vector is 1

Definition at line 229 of file su3_util.C.

References cps::dotProduct(), cps::IFloat, and cps::vecTimesEquFloat().

void cps::Vector::NormSqArraySliceSum Float f_out,
const int  size,
const int  dir
 

Sum the square norms of vectors in 3-dim slices.

For this array of vectors, with one on each lattice site, and some direction dir, sum the square norms of the vectors over the entire lattice on sites which have the same coordinate in direction dir. In other words, divide the global lattice into 3-dim slices perpendicular to direction dir and sum the square norms of the vectors in each slice.

Parameters:
f_out The array holding the global sum for each slice.
size The size of this vector on each lattice site.
dir The direction perpendicular to the slices.

Definition at line 316 of file vector.C.

References cps::dir, cps::dotProduct(), cps::ERR, cps::Float, cps::GJP, cps::IFloat, cps::Error::Pointer(), cps::sfree(), cps::Verbose::Sfree(), SliceArraySum(), cps::Verbose::Smalloc(), cps::smalloc(), cps::GlobalJobParameter::VolNodeSites(), and cps::VRB.

Referenced by cps::Fwilson::FeigSolv().

Float cps::Vector::NormSqGlbSum int  len  ) 
 

Square norm with global sum.

Parameters:
len The number of real numbers in the vectors.
Returns:
The square norm of this vector summed over all nodes.

Definition at line 234 of file vector.C.

References cps::dotProduct(), cps::Float, cps::glb_sum_five(), and cps::IFloat.

Referenced by cps::Fstag::FmatEvlInv(), cps::DiracOp::MinResExt(), cps::Norm(), and cps::DiracOp::Ritz().

Float cps::Vector::NormSqGlbSum4D int  len  ) 
 

Definition at line 240 of file vector.C.

References cps::dotProduct(), cps::Float, cps::glb_sum(), and cps::IFloat.

Float cps::Vector::NormSqNode int  len  )  [inline]
 

Square norm.

Parameters:
len The number of real numbers in the vectors.
Returns:
The square norm of this vector.

Definition at line 501 of file vector.h.

References cps::dotProduct(), Float, cps::Float, and cps::IFloat.

Referenced by cps::FwilsonTm::BhamiltonNode(), cps::Fwilson::BhamiltonNode(), cps::FdwfBase::BhamiltonNode(), cps::Fclover::BhamiltonNode(), cps::DiracOpWilsonTypes::BiCGstab(), cps::dwf_mdagm(), cps::FdwfBase::FeigSolv(), cps::FermionVectorTp::GaussianSmearVector(), cps::DiracOp::InvCg(), cps::DiracOpClover::MatDagMatDbg(), and cps::DiracOpClover::MatPcDagMatPc().

Vector& cps::Vector::operator *= IFloat  p  )  [inline]
 

Multiplies this vector by a real scalar.

Parameters:
p The real scalar
Returns:
The multiplied vector

Definition at line 415 of file vector.h.

References COLORS, cps::IFloat, cps::p(), and cps::vecTimesEquFloat().

Vector& cps::Vector::operator+= const Vector x  )  [inline]
 

Adds a vector m to this vector.

Parameters:
m The vector to be added.
Returns:
The vector sum.

Definition at line 424 of file vector.h.

References COLORS, cps::IFloat, v, and cps::vecAddEquVec().

Vector& cps::Vector::operator-= const Vector x  )  [inline]
 

Subtracts a vector m to this vector.

Parameters:
m The vector to be subtracted.
Returns:
The vector difference.

Definition at line 433 of file vector.h.

References COLORS, cps::IFloat, v, and cps::vecMinusEquVec().

Vector& cps::Vector::operator= const Vector x  )  [inline]
 

Overloaded assignment.

x should not alias this matrix

Definition at line 401 of file vector.h.

References COLORS, cps::Float, and cps::moveMem().

Complex& cps::Vector::operator[] int  i  )  [inline]
 

simple element access (as a Complex)

added by Sam 1/9/2006 to implement disconnected F.T

Definition at line 466 of file vector.h.

References cps::Complex.

void cps::Vector::Orthogonalize const Vector p1  ) 
 

Orthogonalisation.

Parameters:
p1 A vector
Postcondition:
This vector is orthogonalised against the vector p1 so that its inner product with p1 vanishes.

Definition at line 249 of file su3_util.C.

References cps::IFloat, and v.

void cps::Vector::Print int  len  ) 
 

Print the vector content to the screen.

Parameters:
len The number of real numbers in the vectors. For debugging purposes

Definition at line 254 of file vector.C.

References cps::MPISCU::printf().

Float cps::Vector::ReDotProductGlbSum const Vector b,
int  len
 

The real part of the dot product with global sum.

Parameters:
b Another vector
len The number of real numbers in the vectors.
Returns:
The real part of the dot product (v,b) summed over all nodes.

Definition at line 267 of file vector.C.

References cps::dotProduct(), cps::Float, cps::glb_sum_five(), and cps::IFloat.

Referenced by cps::MatHermElements(), cps::DiracOp::Ritz(), cps::DiracOpWilsonTypes::RitzEig(), and cps::WspectQuark::WspectQuark().

Float cps::Vector::ReDotProductGlbSum4D const Vector b,
int  len
 

Definition at line 273 of file vector.C.

References cps::dotProduct(), cps::Float, cps::glb_sum(), and cps::IFloat.

Referenced by cps::Fwilson::FeigSolv(), cps::Fclover::FeigSolv(), cps::DiracOpStagTypes::RitzEig(), cps::AlgPbp::run(), and cps::AlgPbp::runPointSource().

Float cps::Vector::ReDotProductNode const Vector b,
int  len
[inline]
 

The real part of the dot product.

Parameters:
b Another vector
len The number of real numbers in the vectors.
Returns:
The real part of the dot product (v,b).

Definition at line 516 of file vector.h.

References cps::dotProduct(), Float, cps::Float, and cps::IFloat.

Referenced by cps::FdwfBase::FeigSolv(), cps::FwilsonTypes::FhamiltonNode(), and cps::FdwfBase::FhamiltonNode().

void cps::Vector::SliceArraySum Float sum,
const Float f_in,
const int  dir
 

Sum an array of Floats on a 4-dim lattice in 3-dim slices.

For an array of floating point numbers, one on each lattice site, and some direction dir, sum all the numbers over the entire lattice which have the same coordinate in direction dir. In other words, divide the global lattice into 3-dim slices perpendicular to direction dir and sum the array in each slice.

Parameters:
sum The array holding the global sum for each slice.
f_in The array to be sliced and summed
dir The direction perpendicular to the slices.

Definition at line 346 of file vector.C.

References cps::ERR, cps::Error::General(), cps::GJP, cps::glb_sum(), cps::GlobalJobParameter::TnodeCoor(), cps::GlobalJobParameter::Tnodes(), cps::GlobalJobParameter::TnodeSites(), cps::GlobalJobParameter::VolNodeSites(), cps::GlobalJobParameter::XnodeCoor(), cps::GlobalJobParameter::Xnodes(), cps::GlobalJobParameter::XnodeSites(), cps::GlobalJobParameter::YnodeCoor(), cps::GlobalJobParameter::Ynodes(), cps::GlobalJobParameter::YnodeSites(), cps::GlobalJobParameter::ZnodeCoor(), cps::GlobalJobParameter::Znodes(), and cps::GlobalJobParameter::ZnodeSites().

Referenced by NormSqArraySliceSum().

void cps::Vector::SliceArraySumFive Float sum,
const Float f_in,
const int  dir
 

Sum an array of Floats on a 5-dim lattice in 4-dim slices.

For an array of floating point numbers, one on each 5-dim lattice site, and some direction dir, sum all the numbers over the entire lattice which have the same coordinate in direction dir. In other words, divide the global lattice into 4-dim slices perpendicular to direction dir and sum the array in each slice.

Parameters:
sum The array holding the global sum for each slice.
f_in The array to be sliced and summed
dir The direction perpendicular to the slices.

Definition at line 398 of file vector.C.

References cps::ERR, cps::Error::General(), cps::GJP, cps::glb_sum(), cps::GlobalJobParameter::SnodeCoor(), cps::GlobalJobParameter::Snodes(), cps::GlobalJobParameter::SnodeSites(), cps::GlobalJobParameter::TnodeCoor(), cps::GlobalJobParameter::Tnodes(), cps::GlobalJobParameter::TnodeSites(), cps::GlobalJobParameter::VolNodeSites(), cps::GlobalJobParameter::XnodeCoor(), cps::GlobalJobParameter::Xnodes(), cps::GlobalJobParameter::XnodeSites(), cps::GlobalJobParameter::YnodeCoor(), cps::GlobalJobParameter::Ynodes(), cps::GlobalJobParameter::YnodeSites(), cps::GlobalJobParameter::ZnodeCoor(), cps::GlobalJobParameter::Znodes(), and cps::GlobalJobParameter::ZnodeSites().

Referenced by cps::FdwfBase::FeigSolv().

void cps::Vector::VecAddEquVec const Vector b,
int  len
[inline]
 

Addition of another vector.

Parameters:
b Another vector
len The number of real numbers in the vectors.
Postcondition:
b is added to this vector.

Definition at line 574 of file vector.h.

References cps::IFloat, and cps::vecAddEquVec().

Referenced by cps::FermionVector::sumOverHyperPlane(), and cps::FermionVector::sumOverHyperPlaneStride().

void cps::Vector::VecEqualsVecTimesEquFloat const Vector u,
const Float fb,
int  len
[inline]
 

Multiplication by a real scalar.

Parameters:
u The input vector
fb The real scalar
len The number of real numbers in the vectors.
Postcondition:
This vector is multiplied by fb

Definition at line 565 of file vector.h.

References cps::IFloat, and cps::vecEqualsVecTimesEquFloat().

void cps::Vector::VecMinusEquVec const Vector b,
int  len
[inline]
 

Subtraction of another vector.

Parameters:
b Another vector
len The number of real numbers in the vectors.
Postcondition:
b is subtracted from this vector.

Definition at line 583 of file vector.h.

References cps::IFloat, and cps::vecMinusEquVec().

Referenced by cps::DiracOp::InvCg().

void cps::Vector::VecNegative const Vector b,
int  len
[inline]
 

Assignment to a negated vector.

Parameters:
b A vector.
len The number of real numbers in the vectors.
Postcondition:
This vector has the value -b.

Definition at line 546 of file vector.h.

References cps::IFloat, and cps::vecNegative().

Referenced by cps::DiracOpWilsonTypes::RitzEigMat(), cps::DiracOpWilsonTypes::RitzMat(), cps::DiracOpStag::RitzMat(), cps::DiracOpP4::RitzMat(), and cps::DiracOpAsqtad::RitzMat().

void cps::Vector::VecTimesEquFloat const Float fb,
int  len
[inline]
 

Multiplication by a real scalar.

Parameters:
fb The real scalar
len The number of real numbers in the vectors.
Postcondition:
This vector is multiplied by fb

Definition at line 555 of file vector.h.

References cps::IFloat, and cps::vecTimesEquFloat().

Referenced by cps::DiracOpWilsonTm::CalcBsnForceVecs(), cps::DiracOpWilsonTm::CalcHmdForceVecs(), cps::DiracOpWilson::CalcHmdForceVecs(), cps::DiracOpDwf::CalcHmdForceVecs(), cps::DiracOpClover::CalcHmdForceVecs(), cps::FdwfBase::EvolveMomFforce(), cps::FdwfBase::FeigSolv(), cps::DiracOp::Jacobi(), cps::Norm(), cps::Fp4::RHMC_EvolveMomFforce(), cps::Fasqtad::RHMC_EvolveMomFforce(), cps::DiracOp::Ritz(), cps::DiracOpStagTypes::RitzEig(), cps::DiracOpStag::RitzMat(), cps::DiracOpP4::RitzMat(), cps::DiracOpAsqtad::RitzMat(), and cps::AlgHmcRHMC::run().

void cps::Vector::VecZero int  len  )  [inline]
 

Assign vector to zero.

Parameters:
len The number of real numbers in the vectors.
Postcondition:
This vector has the value 0.

Definition at line 537 of file vector.h.

References cps::IFloat, and cps::vecZero().

Referenced by cps::DiracOpWilsonTypes::BiCGstab(), cps::DiracOp::MinResExt(), cps::FermionVector::sumOverHyperPlane(), and cps::FermionVector::sumOverHyperPlaneStride().

void cps::Vector::Zero  )  [inline]
 

Zeroing a color vector.

added by Sam 1/9/2006 to implement disconnected F.T

Definition at line 457 of file vector.h.

Referenced by cps::FermionVectorTp::SetLandauGaugeMomentaSource().


Friends And Related Function Documentation

friend class Matrix [friend]
 

Definition at line 393 of file vector.h.


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