PSCF v1.3.2
|
Functions that perform element-wise vector operations on the Cpu. More...
Functions | |
void | eqV (Array< double > &a, Array< double > const &b) |
Vector assignment, a[i] = b[i]. | |
void | eqS (Array< double > &a, double b) |
Vector assignment, a[i] = b. | |
void | addVV (Array< double > &a, Array< double > const &b, Array< double > const &c) |
Vector addition, a[i] = b[i] + c[i]. | |
void | addVS (Array< double > &a, Array< double > const &b, double c) |
Vector addition, a[i] = b[i] + c. | |
void | subVV (Array< double > &a, Array< double > const &b, Array< double > const &c) |
Vector subtraction, a[i] = b[i] - c[i]. | |
void | subVS (Array< double > &a, Array< double > const &b, double c) |
Vector subtraction, a[i] = b[i] - c. | |
void | mulVV (Array< double > &a, Array< double > const &b, Array< double > const &c) |
Vector multiplication, a[i] = b[i] * c[i]. | |
void | mulVS (Array< double > &a, Array< double > const &b, double c) |
Vector multiplication, a[i] = b[i] * c. | |
void | divVV (Array< double > &a, Array< double > const &b, Array< double > const &c) |
Vector division, a[i] = b[i] / c[i]. | |
void | divVS (Array< double > &a, Array< double > const &b, double c) |
Vector division, a[i] = b[i] / c. | |
void | divSV (Array< double > &a, double b, Array< double > const &c) |
Vector division, a[i] = b / c[i]. | |
void | expV (Array< double > &a, Array< double > const &b) |
Vector exponentiation, a[i] = exp(b[i]). | |
void | addEqV (Array< double > &a, Array< double > const &b) |
Vector addition in-place, a[i] += b[i]. | |
void | addEqS (Array< double > &a, double b) |
Vector addition in-place, a[i] += b. | |
void | subEqV (Array< double > &a, Array< double > const &b) |
Vector subtraction in-place, a[i] -= b[i]. | |
void | subEqS (Array< double > &a, double b) |
Vector subtraction in-place, a[i] -= b. | |
void | mulEqV (Array< double > &a, Array< double > const &b) |
Vector multiplication in-place, a[i] *= b[i]. | |
void | mulEqS (Array< double > &a, double b) |
Vector multiplication in-place, a[i] *= b. | |
void | divEqV (Array< double > &a, Array< double > const &b) |
Vector division in-place, a[i] /= b[i]. | |
void | divEqS (Array< double > &a, double b) |
Vector division in-place, a[i] /= b. |
Functions that perform element-wise vector operations on the Cpu.
Operations that are performed by these functions include addition, subtraction, multiplication, division, exponentiation, and assignment. The function names will, correspondingly, begin with "add", "sub", "mul", "div", "exp", or "eq" to indicate the relevant operation. Functions are also included to perform compound assignment operations, i.e. those that are performed using +=, -=, *=, and /= in C++. These functions have names that begin with "addEq", "subEq", "mulEq", and "divEq", respectively.
The output (the LHS of the vector operation) is always the first parameter passed to the function. The input argument(s) (on the RHS of the vector operation) may be vectors or scalars. If an argument is a vector (scalar), the function name will contain a V (S). For example, the function addVV(A,B,C) implements vector-vector addition A[i] = B[i] + C[i], while addVS(A,B,c) implements vector-scalar addition A[i] = B[i] + c in which c is a scalar that is added to every element of B. In commutative operations involving both vectors and scalars, the vectors are listed first. So, for example, addVS exists, but addSV does not.
Vector assignment, a[i] = b[i].
a | output array (LHS) |
b | input array (RHS) |
Definition at line 23 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Rpg::RealMove< D >::attemptMove(), Pscf::Rpg::FourthOrderParameter< D >::compute(), Pscf::Rpg::MaxOrderParameter< D >::compute(), Pscf::Prdc::Cuda::VecOp::eqV(), Pscf::Prdc::Cuda::VecOp::eqV(), Pscf::Rpg::ForceBiasMove< D >::move(), Pscf::Rpg::Simulator< D >::restoreState(), Pscf::Rpg::Simulator< D >::saveState(), Pscf::Rpg::AmCompressor< D >::setup(), Pscf::Rpg::LrAmCompressor< D >::setup(), Pscf::Rpg::Propagator< D >::solve(), Pscf::Rpg::Propagator< D >::solve(), Pscf::Rpg::ExplicitBdStep< D >::step(), Pscf::Rpg::LMBdStep< D >::step(), Pscf::Rpg::PredCorrBdStep< D >::step(), and Pscf::Rpg::FilmFieldGenMask< D >::stress().
void Pscf::Prdc::Cpu::VecOp::eqS | ( | Array< double > & | a, |
double | b ) |
Vector assignment, a[i] = b.
a | output array (LHS) |
b | input scalar (RHS) |
Definition at line 36 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Rpg::Simulator< D >::computeCc(), Pscf::Rpg::Block< D >::computeConcentrationBead(), Pscf::Rpg::Block< D >::computeConcentrationThread(), Pscf::Rpg::Simulator< D >::computeWc(), Pscf::Prdc::Cuda::VecOp::eqS(), Pscf::Prdc::Cuda::VecOp::eqS(), and Pscf::Rpg::FourthOrderParameter< D >::setup().
void Pscf::Prdc::Cpu::VecOp::addVV | ( | Array< double > & | a, |
Array< double > const & | b, | ||
Array< double > const & | c ) |
Vector addition, a[i] = b[i] + c[i].
a | output array (LHS) |
b | input array (RHS) |
c | input array (RHS) |
Definition at line 50 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::addVMany(), Pscf::Prdc::Cuda::VecOp::addVMany(), Pscf::Prdc::Cuda::VecOp::addVV(), Pscf::Prdc::Cuda::VecOp::addVV(), Pscf::Prdc::Cuda::VecOp::addVV(), and Pscf::Prdc::Cuda::VecOp::addVV().
Vector addition, a[i] = b[i] + c.
a | output array (LHS) |
b | input array (RHS) |
c | input scalar (RHS) |
Definition at line 65 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::addVS(), Pscf::Prdc::Cuda::VecOp::addVS(), Pscf::Prdc::Cuda::VecOp::addVS(), and Pscf::Prdc::Cuda::VecOp::addVS().
void Pscf::Prdc::Cpu::VecOp::subVV | ( | Array< double > & | a, |
Array< double > const & | b, | ||
Array< double > const & | c ) |
Vector subtraction, a[i] = b[i] - c[i].
a | output array (LHS) |
b | input array (RHS) |
c | input array (RHS) |
Definition at line 81 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Rpg::EinsteinCrystalPerturbation< D >::hamiltonian(), Pscf::Rpg::EinsteinCrystalPerturbation< D >::incrementDc(), Pscf::Rpg::PredCorrBdStep< D >::step(), Pscf::Rpg::FilmFieldGenMask< D >::stress(), Pscf::Prdc::Cuda::VecOp::subVV(), Pscf::Prdc::Cuda::VecOp::subVV(), Pscf::Prdc::Cuda::VecOp::subVV(), and Pscf::Prdc::Cuda::VecOp::subVV().
Vector subtraction, a[i] = b[i] - c.
a | output array (LHS) |
b | input array (RHS) |
c | input scalar (RHS) |
Definition at line 96 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Rpg::Simulator< D >::computeHamiltonian(), Pscf::Prdc::Cuda::VecOp::subVS(), Pscf::Prdc::Cuda::VecOp::subVS(), Pscf::Prdc::Cuda::VecOp::subVS(), and Pscf::Prdc::Cuda::VecOp::subVS().
void Pscf::Prdc::Cpu::VecOp::mulVV | ( | Array< double > & | a, |
Array< double > const & | b, | ||
Array< double > const & | c ) |
Vector multiplication, a[i] = b[i] * c[i].
a | output array (LHS) |
b | input array (RHS) |
c | input array (RHS) |
Definition at line 111 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::mulVMany(), Pscf::Prdc::Cuda::VecOp::mulVMany(), Pscf::Prdc::Cuda::VecOp::mulVV(), Pscf::Prdc::Cuda::VecOp::mulVV(), Pscf::Prdc::Cuda::VecOp::mulVV(), and Pscf::Prdc::Cuda::VecOp::mulVV().
Vector multiplication, a[i] = b[i] * c.
a | output array (LHS) |
b | input array (RHS) |
c | input scalar (RHS) |
Definition at line 126 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::mulVS(), Pscf::Prdc::Cuda::VecOp::mulVS(), Pscf::Prdc::Cuda::VecOp::mulVS(), and Pscf::Prdc::Cuda::VecOp::mulVS().
void Pscf::Prdc::Cpu::VecOp::divVV | ( | Array< double > & | a, |
Array< double > const & | b, | ||
Array< double > const & | c ) |
Vector division, a[i] = b[i] / c[i].
a | output array (LHS) |
b | input array (RHS) |
c | input array (RHS) |
Definition at line 141 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::divVV(), and Pscf::Prdc::Cuda::VecOp::divVV().
Vector division, a[i] = b[i] / c.
a | output array (LHS) |
b | input array (RHS) |
c | input scalar (RHS) |
Definition at line 156 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::divVS(), and Pscf::Prdc::Cuda::VecOp::divVS().
Vector division, a[i] = b / c[i].
a | output array (LHS) |
b | input scalar (RHS) |
c | input array (RHS) |
Definition at line 169 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::divSV(), and Pscf::Rpg::Block< D >::setupSolver().
Vector exponentiation, a[i] = exp(b[i]).
a | output array (LHS) |
b | input array (RHS) |
Definition at line 184 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::expV(), and Pscf::Prdc::Cuda::VecOp::expV().
Vector addition in-place, a[i] += b[i].
a | output array (LHS) |
b | input array (RHS) |
Definition at line 199 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::addEqV(), Pscf::Prdc::Cuda::VecOp::addEqV(), Pscf::Prdc::Cuda::VecOp::addEqV(), and Pscf::Rpg::PredCorrBdStep< D >::step().
void Pscf::Prdc::Cpu::VecOp::addEqS | ( | Array< double > & | a, |
double | b ) |
Vector addition in-place, a[i] += b.
a | output array (LHS) |
b | input scalar (RHS) |
Definition at line 212 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::addEqS(), Pscf::Prdc::Cuda::VecOp::addEqS(), and Pscf::Prdc::Cuda::VecOp::addEqS().
Vector subtraction in-place, a[i] -= b[i].
a | output array (LHS) |
b | input array (RHS) |
Definition at line 227 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::subEqV(), Pscf::Prdc::Cuda::VecOp::subEqV(), and Pscf::Prdc::Cuda::VecOp::subEqV().
void Pscf::Prdc::Cpu::VecOp::subEqS | ( | Array< double > & | a, |
double | b ) |
Vector subtraction in-place, a[i] -= b.
a | output array (LHS) |
b | input scalar (RHS) |
Definition at line 240 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::subEqS(), Pscf::Prdc::Cuda::VecOp::subEqS(), and Pscf::Prdc::Cuda::VecOp::subEqS().
Vector multiplication in-place, a[i] *= b[i].
a | output array (LHS) |
b | input array (RHS) |
Definition at line 254 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Rpg::FourthOrderParameter< D >::compute(), Pscf::Rpg::Block< D >::computeStressBead(), Pscf::Prdc::Cuda::VecOp::mulEqV(), Pscf::Prdc::Cuda::VecOp::mulEqV(), Pscf::Prdc::Cuda::VecOp::mulEqV(), Pscf::Rpg::Block< D >::stepBondBead(), Pscf::Rpg::Block< D >::stepFieldBead(), Pscf::Rpg::Block< D >::stepHalfBondBead(), and Pscf::Rpg::Block< D >::stepThread().
void Pscf::Prdc::Cpu::VecOp::mulEqS | ( | Array< double > & | a, |
double | b ) |
Vector multiplication in-place, a[i] *= b.
a | output array (LHS) |
b | input scalar (RHS) |
Definition at line 267 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Rpg::Solvent< D >::compute(), Pscf::Rpg::Block< D >::computeConcentrationBead(), Pscf::Rpg::Block< D >::computeConcentrationThread(), Pscf::Rpg::EinsteinCrystalPerturbation< D >::incrementDc(), Pscf::Prdc::Cuda::VecOp::mulEqS(), Pscf::Prdc::Cuda::VecOp::mulEqS(), Pscf::Prdc::Cuda::VecOp::mulEqS(), Pscf::Rpg::FieldIo< D >::scaleFieldRGrid(), and Pscf::Rpg::PredCorrBdStep< D >::step().
Vector division in-place, a[i] /= b[i].
a | output array (LHS) |
b | input array (RHS) |
Definition at line 281 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::divEqV(), and Pscf::Prdc::Cuda::VecOp::divEqV().
void Pscf::Prdc::Cpu::VecOp::divEqS | ( | Array< double > & | a, |
double | b ) |
Vector division in-place, a[i] /= b.
a | output array (LHS) |
b | input scalar (RHS) |
Definition at line 294 of file VecOp.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::VecOp::divEqS(), and Pscf::Prdc::Cuda::VecOp::divEqS().