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

vector.h File Reference

Declaration/definition of Vector and Matrix classes. More...

#include <config.h>
#include <string.h>
#include <util/data_types.h>
#include <util/vector_asm.h>

Go to the source code of this file.

Namespaces

namespace  cps

Classes

class  cps::Matrix
 A class of general 3x3 complex matrices. More...
class  cps::Vector
 A class implementing a general 3 component complex vector. More...

Defines

#define INCLUDED_VECTOR_H
 Prevent multiple inclusion.

Enumerations

enum  { COLORS = 3 }
 The rank of the matrices represented by the Matrix class. More...

Functions

void moveMem (void *b, const void *a, int len)
 vector copy; b = a
void moveFloat (Float *b, const Float *a, int len)
void mDotMEqual (IFloat *c, const IFloat *a, const IFloat *b)
 3x3 complex matrix multiplication; c = ab
void mDotMPlus (IFloat *c, const IFloat *a, const IFloat *b)
 3x3 complex matrix multiplication and sum; c += ab
void uDotXEqual (IFloat *y, const IFloat *m, const IFloat *x)
 3x3 complex matrix times vector; y = Mx
IFloat dotProduct (const IFloat *a, const IFloat *b, int)
 vector scalar product; a.b
void vecAddEquVec (IFloat *a, const IFloat *b, int)
 vector addition; a += b
void vecMinusEquVec (IFloat *a, const IFloat *b, int)
 vector subtraction; a -= b
void vecNegative (IFloat *a, const IFloat *b, int)
 vector negation; a = -b
void vecZero (IFloat *a, int size)
 set all elements to zero
void vecTimesEquFloat (IFloat *a, IFloat b, int)
 real scalar times vector multiplication; a *= b
void vecEqualsVecTimesEquFloat (IFloat *a, IFloat *b, IFloat c, int)
 real scalar times vector multiplication; a = c*b
void fTimesV1PlusV2 (IFloat *a, IFloat b, const IFloat *c, const IFloat *d, int size)
 vector linear combination; a = bc+d
void fTimesV1MinusV2 (IFloat *a, IFloat b, const IFloat *c, const IFloat *d, int size)
 vector linear combination; a = bc-d
void compDotProduct (IFloat *c_r, IFloat *c_i, const IFloat *a, const IFloat *b, int)
 complex vector scalar product; a.b
void cTimesV1PlusV2 (IFloat *a, IFloat b_re, IFloat b_im, const IFloat *c, const IFloat *d, int size)
 complex vector linear combination; a = bc+d
void cTimesV1MinusV2 (IFloat *a, IFloat b_re, IFloat b_im, const IFloat *c, const IFloat *d, int size)
 Not implemented on qcdsp.
void oneMinusfTimesMatrix (IFloat *a, IFloat b, const IFloat *c, int n)
 matrix linear combination; a = 1-bc
void uDotXPlus (IFloat *y, const IFloat *u, const IFloat *x)
 Multiplication of complex vector by matrix and addition; y += Mx.
void uDotXMinus (IFloat *y, const IFloat *u, const IFloat *x)
 Multiplication of complex vector by matrix and subtraction; y -= Mx.
void uDagDotXEqual (IFloat *y, const IFloat *u, const IFloat *x)
 Multiplication of complex vector by hermitian conjugate matrix and summation; y += M^dagger x.
void uDagDotXPlus (IFloat *y, const IFloat *u, const IFloat *x)
 Multiplication of complex vector by hermitian conjugate matrix; y = M^dagger x.
IFloat reChar6 (IFloat *p)
IFloat imChar6 (IFloat *p)
IFloat reChar8 (IFloat *p)
IFloat reChar10 (IFloat *p)
IFloat imChar10 (IFloat *p)


Detailed Description

Declaration/definition of Vector and Matrix classes.

Also declarations of functions that perform operations on complex vectors.

Id
vector.h,v 1.27 2008/02/12 18:16:30 chulwoo Exp

Definition in file vector.h.


Define Documentation

#define INCLUDED_VECTOR_H
 

Prevent multiple inclusion.

Definition at line 2 of file vector.h.


Enumeration Type Documentation

anonymous enum
 

The rank of the matrices represented by the Matrix class.

Enumeration values:
COLORS 

Definition at line 137 of file vector.h.


Function Documentation

void cps::compDotProduct IFloat c_r,
IFloat c_i,
const IFloat a,
const IFloat b,
int  len
 

complex vector scalar product; a.b

Parameters:
c_r The real part of the scalar product of the vectors.
c_i The imaginary part of the scalar product of the vectors.
a A complex vector
b Another complex vector
len The length of the vectors

Definition at line 406 of file vector_util.C.

Referenced by cps::WspectExtendedMesons::ColorAlgebra(), cps::Vector::CompDotProductGlbSum(), cps::Vector::CompDotProductGlbSum4D(), and cps::Vector::CompDotProductNode().

void cps::cTimesV1MinusV2 IFloat a,
IFloat  re,
IFloat  im,
const IFloat c,
const IFloat d,
int  len
 

Not implemented on qcdsp.

Parameters:
re The real part of the scalar complex factor
im The imaginary part of the scalar complex factor
a The resulting vector
c A vector
d Another vector
len The length of the vectors

Definition at line 444 of file vector_util.C.

References cps::Float.

Referenced by cps::Vector::CTimesV1MinusV2().

void cps::cTimesV1PlusV2 IFloat a,
IFloat  re,
IFloat  im,
const IFloat c,
const IFloat d,
int  len
 

complex vector linear combination; a = bc+d

Parameters:
re The real part of the scalar complex factor
im The imaginary part of the scalar complex factor
a The resulting vector
c A vector
d Another vector
len The length of the vectors

Definition at line 425 of file vector_util.C.

References cps::Float.

Referenced by cps::Vector::CTimesV1PlusV2().

IFloat cps::dotProduct const IFloat a,
const IFloat b,
int  len
 

vector scalar product; a.b

If the vectors are real, this function computes the scalar product.

Parameters:
a A vector
b Another vector
len The size of the vectors.
Returns:
The scalar product of the vectors.

Definition at line 278 of file vector_util.C.

References cps::IFloat.

Referenced by cps::Matrix::ErrorSU3(), cps::FdwfBase::FeigSolv(), cps::FstagTypes::FhamiltonNode(), cps::DiracOpStag::MatPcDagMatPc(), cps::DiracOpP4::MatPcDagMatPc(), cps::DiracOpAsqtad::MatPcDagMatPc(), cps::Vector::Normalize(), cps::Vector::NormSqArraySliceSum(), cps::Vector::NormSqGlbSum(), cps::Vector::NormSqGlbSum4D(), cps::Vector::NormSqNode(), cps::Vector::ReDotProductGlbSum(), cps::Vector::ReDotProductGlbSum4D(), cps::Vector::ReDotProductNode(), and cps::wilson_mdagm().

void cps::fTimesV1MinusV2 IFloat a,
IFloat  b,
const IFloat c,
const IFloat d,
int  len
 

vector linear combination; a = bc-d

Parameters:
a The resulting vector
b A real scalar
c A vector
d A vector
len The length of the vectors.

Definition at line 362 of file vector_util.C.

Referenced by cps::Vector::FTimesV1MinusV2(), cps::DiracOpStag::MatInv(), cps::DiracOpP4::MatInv(), cps::DiracOpAsqtad::MatInv(), cps::Fstag::SetPhi(), cps::Fp4::SetPhi(), and cps::Fasqtad::SetPhi().

void cps::fTimesV1PlusV2 IFloat a,
IFloat  b,
const IFloat c,
const IFloat d,
int  len
 

vector linear combination; a = bc+d

Parameters:
a The resulting vector
b A real scalar
c A vector
d A vector
len The length of the vectors.

Definition at line 347 of file vector_util.C.

Referenced by cps::dwf_dslash_5_plus(), cps::AlgActionQuotient::evolve(), cps::Fstag::EvolveMomFforce(), cps::Gwilson::EvolveMomGforce(), cps::GtadpoleRect::EvolveMomGforce(), cps::GpowerRect::EvolveMomGforce(), cps::GpowerPlaq::EvolveMomGforce(), cps::GimprRect::EvolveMomGforce(), cps::GimprOLSym::EvolveMomGforce(), cps::LatVector::FTimesV1PlusV2(), cps::FermionVectorTp::GaussianSmearVector(), cps::DiracOpWilson::Mat(), cps::DiracOpDwf::Mat(), cps::DiracOpWilson::MatDag(), cps::DiracOpDwf::MatDag(), cps::DiracOpClover::MatDagOrNotDbg(), cps::DiracOpWilson::MatInv(), cps::DiracOpDwf::MatInv(), cps::DiracOpClover::MatInv(), cps::DiracOpClover::MatPcDagOrNot(), cps::Fwilson::RHMC_EvolveMomFforce(), cps::Fstag::RHMC_EvolveMomFforce(), cps::Fp4::RHMC_EvolveMomFforce(), cps::FdwfBase::RHMC_EvolveMomFforce(), cps::Fasqtad::RHMC_EvolveMomFforce(), and cps::wilson_mdagm().

IFloat cps::imChar10 IFloat p  ) 
 

Definition at line 89 of file su3_char.C.

References cps::IFloat.

Referenced by cps::Matrix::Char10().

IFloat cps::imChar6 IFloat p  ) 
 

Definition at line 46 of file su3_char.C.

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

Referenced by cps::Matrix::Char6().

void cps::mDotMEqual IFloat c,
const IFloat a,
const IFloat b
 

3x3 complex matrix multiplication; c = ab

The 3x3 complex matrices are assumed to be stored in a linear form where the real part of the (i,j) element is at array position [6i+2j] and the imaginary part of the (i,j) element is at array position [6i+2j+1].

Parameters:
c the product matrix ab
a the matrix a
b the matrix b
The array c must not alias arrays a or b

Definition at line 99 of file vector_util.C.

Referenced by cps::asqtad_dirac_init_g(), cps::Matrix::DotMEqual(), cps::Lattice::EvolveGfield(), cps::Gwilson::GforceSite(), cps::GtadpoleRect::GforceSite(), cps::GpowerRect::GforceSite(), cps::GpowerPlaq::GforceSite(), cps::GimprRect::GforceSite(), cps::GimprOLSym::GforceSite(), cps::Parallel(), cps::Lattice::PathOrdProd(), cps::Lattice::PathOrdProdPlus(), cps::Lattice::Plaq(), cps::GpowerRect::PowerRectStaple(), cps::GpowerRect::PowerStaple(), cps::GpowerPlaq::PowerStaple(), cps::pt_mat(), cps::pt_mat_norm(), cps::Lattice::RectStaple(), cps::Lattice::ReTrPlaq(), cps::Lattice::ReTrRect(), cps::Lattice::Staple(), cps::Staple5_NN(), cps::Staple5_NP(), cps::Staple5_PN(), cps::Staple5_PP(), cps::Staple7_NN(), cps::Staple7_NP(), cps::Staple7_PN(), and cps::Staple7_PP().

void cps::mDotMPlus IFloat c,
const IFloat a,
const IFloat b
 

3x3 complex matrix multiplication and sum; c += ab

The 3x3 complex matrices are assumed to be stored in a linear form where the real part of the (i,j) element is at array position [6i+2j] and the imaginary part of the (i,j) element is at array position [6i+2j+1].

Parameters:
c the product matrix c + ab
a the matrix a
b the matrix b
The array c must not alias arrays a or b

Definition at line 175 of file vector_util.C.

Referenced by cps::Matrix::DotMPlus(), cps::GtadpoleRect::GforceSite(), cps::GpowerRect::GforceSite(), cps::GimprRect::GforceSite(), cps::Lattice::PathOrdProdPlus(), cps::Lattice::RectStaple(), and cps::Lattice::Staple().

void cps::moveFloat Float b,
const Float a,
int  len
 

Definition at line 58 of file vector_util.C.

References cps::dclock(), cps::Float, and cps::print_flops().

Referenced by cps::CanonToAnything(), cps::Lattice::Convert(), cps::Vector::CopyVec(), and cps::FdwfBase::Fconvert().

void cps::moveMem void *  b,
const void *  a,
int  len
 

vector copy; b = a

Parameters:
b The vector to be copied to
a The vector to be copied from.
len The number of bytes to be copied.
The arrays c and b must not alias each other.

Definition at line 45 of file vector_util.C.

References cps::dclock(), and cps::print_flops().

Referenced by cps::Lattice::BufferedChairStaple(), cps::Lattice::BufferedCubeStaple(), cps::Lattice::BufferedRectStaple(), cps::Lattice::BufferedStaple(), cps::WspectQuark::Clone(), cps::CloverLeaf(), cps::CloverLeaf1x3(), cps::CloverLeaf2x2(), cps::CloverLeaf3x3(), cps::CloverLeafRect(), cps::Lattice::CopyGaugeField(), cps::Lattice::EvolveGfield(), cps::Fp4::EvolveMomFforce(), cps::Fasqtad::EvolveMomFforce(), cps::Fstag::FforceSite(), cps::five_staple(), cps::Lattice::GaugeField(), cps::LinkBuffer::GetBufferedLink(), cps::WspectField::getField(), cps::Gwilson::GforceSite(), cps::GtadpoleRect::GforceSite(), cps::GpowerRect::GforceSite(), cps::GpowerPlaq::GforceSite(), cps::GimprRect::GforceSite(), cps::GimprOLSym::GforceSite(), cps::lepage_staple(), cps::DiracOpWilson::MatInv(), cps::DiracOpStag::MatInv(), cps::DiracOpP4::MatInv(), cps::DiracOpDwf::MatInv(), cps::DiracOpAsqtad::MatInv(), cps::Vector::operator=(), cps::Matrix::operator=(), cps::Lattice::PathOrdProd(), cps::Lattice::PathOrdProdPlus(), cps::Lattice::Plaq(), cps::GpowerRect::PowerRectStaple(), cps::GpowerRect::PowerStaple(), cps::GpowerPlaq::PowerStaple(), cps::Lattice::RectStaple(), cps::Lattice::ReTrPlaq(), cps::seven_staple(), cps::QPropWRand::ShiftPropBackward(), cps::QPropW::ShiftPropBackward(), cps::QPropWRand::ShiftPropForward(), cps::QPropW::ShiftPropForward(), cps::Lattice::Staple(), cps::three_staple(), cps::three_staple2(), and cps::twist_links().

void cps::oneMinusfTimesMatrix IFloat a,
IFloat  b,
const IFloat c,
int  n
 

matrix linear combination; a = 1-bc

The 3x3 complex matrix is assumed to be stored in a linear form where the real part of the (i,j) element is at array position [6i+2j] and the imaginary part of the (i,j) element is at array position [6i+2j+1].

Parameters:
a The resulting matrix
b A real scalar factor
c A matrix
n This must be 18 in order for this function to do anything meaningful

Definition at line 378 of file vector_util.C.

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

Referenced by cps::Lattice::EvolveGfield(), and cps::Matrix::OneMinusfTimesM().

IFloat cps::reChar10 IFloat p  ) 
 

Definition at line 84 of file su3_char.C.

References cps::IFloat.

Referenced by cps::Matrix::Char10().

IFloat cps::reChar6 IFloat p  ) 
 

Definition at line 23 of file su3_char.C.

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

Referenced by cps::Matrix::Char6().

IFloat cps::reChar8 IFloat p  ) 
 

Definition at line 68 of file su3_char.C.

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

Referenced by cps::Matrix::Char8().

void cps::uDagDotXEqual IFloat y,
const IFloat u,
const IFloat x
 

Multiplication of complex vector by hermitian conjugate matrix and summation; y += M^dagger x.

The 3x3 complex matrix is assumed to be stored in a linear form where the real part of the (i,j) element is at vector position [6i+2j] and the imaginary part of the (i,j) element is at vector position [6i+2j+1].

Parameters:
y The vector M^dagger x
u The matrix M
x The complex 3-vector x
The vector y must not alias vector x or u

Definition at line 521 of file vector.C.

Referenced by cps::DiracOpAsqtad::Dslash(), cps::FermionVectorTp::GaussianSmearVector(), cps::pt_1vec(), cps::pt_1vec_cb_norm(), cps::pt_1vec_cb_pad(), cps::stag_dirac(), and cps::WilsonMatrix::UdagMultSource().

void cps::uDagDotXPlus IFloat y,
const IFloat u,
const IFloat x
 

Multiplication of complex vector by hermitian conjugate matrix; y = M^dagger x.

The 3x3 complex matrix is assumed to be stored in a linear form where the real part of the (i,j) element is at vector position [6i+2j] and the imaginary part of the (i,j) element is at vector position [6i+2j+1].

Parameters:
y The vector y
u The matrix M
x The complex 3-vector x
Postcondition:
y is the vector y + M^dagger x
The vector y must not alias vector x or u

Definition at line 496 of file vector.C.

Referenced by cps::DiracOpAsqtad::Dslash(), cps::FermionVectorTp::GaussianSmearVector(), and cps::stag_dirac().

void cps::uDotXEqual IFloat y,
const IFloat u,
const IFloat x
 

3x3 complex matrix times vector; y = Mx

The 3x3 complex matrix is assumed to be stored in a linear form where the real part of the (i,j) element is at array position [6i+2j] and the imaginary part of the (i,j) element is at array position [6i+2j+1].

Parameters:
y The product vector Mx
u The matrix M
x The complex 3-vector
The array y must not alias array x or u

Definition at line 253 of file vector_util.C.

Referenced by cps::Vector::DotXEqual(), cps::DiracOpAsqtad::Dslash(), cps::FermionVector::gaugeFixSink(), cps::FermionVectorTp::GaugeFixSink(), cps::FermionVectorTp::GaussianSmearVector(), cps::FermionVectorTp::GFWallSource(), cps::FermionVectorTp::LandauGaugeFixSink(), cps::pt_1vec(), cps::pt_1vec_cb_norm(), cps::pt_1vec_cb_pad(), cps::FermionVectorTp::SetLandauGaugeMomentaSource(), cps::stag_dirac(), and cps::WilsonMatrix::UMultSource().

void cps::uDotXMinus IFloat y,
const IFloat u,
const IFloat x
 

Multiplication of complex vector by matrix and subtraction; y -= Mx.

The 3x3 complex matrix is assumed to be stored in a linear form where the real part of the (i,j) element is at vector position [6i+2j] and the imaginary part of the (i,j) element is at vector position [6i+2j+1].

Parameters:
y The vector y
u The matrix M
x The complex 3-vector
Postcondition:
y is the vector y-Mx
The vector y must not alias vector x or u

Definition at line 470 of file vector.C.

Referenced by cps::DiracOpAsqtad::Dslash(), and cps::stag_dirac().

void cps::uDotXPlus IFloat y,
const IFloat u,
const IFloat x
 

Multiplication of complex vector by matrix and addition; y += Mx.

Definition at line 444 of file vector.C.

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

void cps::vecAddEquVec IFloat a,
const IFloat b,
int  len
 

vector addition; a += b

Parameters:
a A vector to be added to.
b Another vector.
len The length of the vectors.
Postcondition:
a is the sum vector.

Definition at line 320 of file vector_util.C.

Referenced by cps::GtadpoleRect::AllStaple(), cps::GimprRect::AllStaple(), cps::GimprOLSym::AllStaple(), cps::GtadpoleRect::GactionGradient(), cps::GpowerRect::GactionGradient(), cps::GimprRect::GactionGradient(), cps::Vector::operator+=(), cps::Matrix::operator+=(), cps::GpowerRect::PowerRectStaple(), cps::GpowerRect::PowerStaple(), cps::GpowerPlaq::PowerStaple(), cps::Lattice::Staple(), and cps::Vector::VecAddEquVec().

void vecEqualsVecTimesEquFloat IFloat a,
IFloat b,
IFloat  c,
int 
 

real scalar times vector multiplication; a = c*b

void cps::vecMinusEquVec IFloat a,
const IFloat b,
int  len
 

vector subtraction; a -= b

Parameters:
a A vector to be subtracted from.
b Another vector.
len The length of the vectors.
Postcondition:
a is the difference vector.

Definition at line 333 of file vector_util.C.

Referenced by cps::Fstag::FforceSite(), cps::DiracOpStag::MatInv(), cps::DiracOpP4::MatInv(), cps::DiracOpAsqtad::MatInv(), cps::Vector::operator-=(), cps::Matrix::operator-=(), and cps::Vector::VecMinusEquVec().

void cps::vecNegative IFloat a,
const IFloat b,
int  len
 

vector negation; a = -b

Parameters:
a The resulting negated vector
b A vector
len The length of the vectors.

Definition at line 392 of file vector_util.C.

Referenced by cps::Matrix::NegMatrix(), and cps::Vector::VecNegative().

void cps::vecTimesEquFloat IFloat a,
IFloat  b,
int  len
 

real scalar times vector multiplication; a *= b

Parameters:
a The vector to be multiplied
b The real scalar
len The length of the vectors.
Postcondition:
a is the multiplied vector.

Definition at line 293 of file vector_util.C.

Referenced by cps::GtadpoleRect::AllStaple(), cps::GimprRect::AllStaple(), cps::GimprOLSym::AllStaple(), cps::Gwilson::GactionGradient(), cps::GtadpoleRect::GactionGradient(), cps::GpowerRect::GactionGradient(), cps::GimprRect::GactionGradient(), cps::GimprOLSym::GactionGradient(), cps::QuarkPropS::getQuarkPropS(), cps::Gwilson::GforceSite(), cps::GtadpoleRect::GforceSite(), cps::GpowerRect::GforceSite(), cps::GpowerPlaq::GforceSite(), cps::GimprRect::GforceSite(), cps::GimprOLSym::GforceSite(), cps::DiracOpStag::MatInv(), cps::DiracOpP4::MatInv(), cps::DiracOpAsqtad::MatInv(), cps::Lattice::MltFloatImpl(), cps::Vector::Normalize(), cps::Vector::operator *=(), cps::Matrix::operator *=(), cps::GpowerRect::PowerRectStaple(), cps::GpowerRect::PowerStaple(), cps::GpowerPlaq::PowerStaple(), cps::Matrix::TrLessAntiHermMatrix(), and cps::Vector::VecTimesEquFloat().

void cps::vecZero IFloat a,
int  len
 

set all elements to zero

Assign vector to zero.

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

Definition at line 459 of file vector_util.C.

Referenced by cps::Vector::VecZero().


Generated on Sat Oct 10 14:11:42 2009 for Columbia Physics System by  doxygen 1.3.9.1