|
PSCF v1.5.0
|
Functions that perform reductions (C++ CPU backend). More...
Functions | |
| double | Pscf::Reduce::sum (Array< double > const &in) |
| Compute sum of array elements (real). | |
| double | Pscf::Reduce::sum (Array< double > const &in, int begin, int end) |
| Compute sum of elements of an array slice (real). | |
| double | Pscf::Reduce::sumSq (Array< double > const &in) |
| Compute sum of of squares of array elements (real). | |
| std::complex< double > | Pscf::Reduce::sum (Array< fftw_complex > const &a) |
| Compute sum of all elements of an array (complex). | |
| std::complex< double > | Pscf::Reduce::sum (Array< fftw_complex > const &a, int begin, int end) |
| Compute sum of elements of an array slice (complex). | |
| std::complex< double > | Pscf::Reduce::sumSq (Array< fftw_complex > const &a) |
| Compute sum of squares of elements of a complex array. | |
| double | Pscf::Reduce::innerProduct (Array< double > const &a, Array< double > const &b) |
| Compute Euclidean inner product of two real arrays . | |
| std::complex< double > | Pscf::Reduce::sumProduct (Array< fftw_complex > const &a, Array< fftw_complex > const &b) |
| Compute sum of complex products of elements of two arrays (complex). | |
| double | Pscf::Reduce::max (Array< double > const &in) |
| Get maximum of array elements (real). | |
| double | Pscf::Reduce::max (Array< double > const &in, int begin, int end) |
| Get value of maximum element in an array slice (real). | |
| double | Pscf::Reduce::maxAbs (Array< double > const &in) |
| Get maximum absolute magnitude of array elements . | |
| double | Pscf::Reduce::min (Array< double > const &in) |
| Get minimum of array elements . | |
| double | Pscf::Reduce::min (Array< double > const &in, int begin, int end) |
| Get value of minimum element in an array slice (real). | |
| double | Pscf::Reduce::minAbs (Array< double > const &in) |
| Get minimum absolute magnitude of array elements . | |
Functions that perform reductions (C++ CPU backend).
A reduction is a operation that takes one or more arrays as inputs and returns a scalar result, such as a sum of elements, a maximum or minimum element, or an inner product.
Complex reduction results are returned as std::complex<double> values because the fftw_complex type is an alias for an array types, double[2], that cannot be returned by value.
| double Pscf::Reduce::sum | ( | Array< double > const & | in | ) |
Compute sum of array elements (real).
| in | input array |
Definition at line 19 of file Reduce.cpp.
References Util::Array< Data >::capacity(), sum(), and UTIL_CHECK.
Referenced by Pscf::Rp::FourthOrderParameter< D, T >::compute(), Pscf::Rp::Solvent< D, T >::compute(), Pscf::Rp::PropagatorBase< D, T >::computeQ(), Pscf::Rp::Block< D, CUT >::computeStressBead(), Pscf::Rp::Block< D, CUT >::computeStressThread(), innerProduct(), innerProduct(), Pscf::Rp::ForceBiasMoveBase< D, T >::move(), Pscf::Rp::Mask< D, T >::phiTot(), Pscf::Rp::FilmFieldGenMask< D, CUT >::stress(), sum(), sum(), sum(), sum(), sum(), sum(), sum(), sum(), sumProduct(), sumSq(), sumSq(), sumSq(), sumSq(), and sumSqAbs().
| double Pscf::Reduce::sum | ( | Array< double > const & | in, |
| int | begin, | ||
| int | end ) |
Compute sum of elements of an array slice (real).
| in | input array |
| begin | index of first element in slice |
| end | index one past the last in slice |
Definition at line 49 of file Reduce.cpp.
References Util::Array< Data >::capacity(), sum(), and UTIL_CHECK.
| double Pscf::Reduce::sumSq | ( | Array< double > const & | in | ) |
Compute sum of of squares of array elements (real).
| in | input array |
Definition at line 121 of file Reduce.cpp.
References Util::Array< Data >::capacity(), sum(), sumSq(), and UTIL_CHECK.
Referenced by Pscf::Rp::EinsteinCrystalPerturbation< D, T >::hamiltonian(), sumSq(), sumSq(), sumSq(), and sumSq().
| std::complex< double > Pscf::Reduce::sum | ( | Array< fftw_complex > const & | a | ) |
Compute sum of all elements of an array (complex).
| a | input array |
Definition at line 81 of file Reduce.cpp.
References Util::Array< Data >::capacity(), sum(), and UTIL_CHECK.
| std::complex< double > Pscf::Reduce::sum | ( | Array< fftw_complex > const & | a, |
| int | begin, | ||
| int | end ) |
Compute sum of elements of an array slice (complex).
| a | input array |
| begin | index of first element of slice |
| end | index one past the last element |
Definition at line 98 of file Reduce.cpp.
References Util::Array< Data >::capacity(), sum(), and UTIL_CHECK.
| std::complex< double > Pscf::Reduce::sumSq | ( | Array< fftw_complex > const & | a | ) |
Compute sum of squares of elements of a complex array.
| a | input array |
Definition at line 154 of file Reduce.cpp.
References Util::Array< Data >::capacity(), sum(), sumSq(), and UTIL_CHECK.
Compute Euclidean inner product of two real arrays .
| a | first input array |
| b | second input array |
Definition at line 176 of file Reduce.cpp.
References Util::Array< Data >::capacity(), innerProduct(), sum(), and UTIL_CHECK.
Referenced by Pscf::Rp::PropagatorBase< D, T >::computeQ(), innerProduct(), innerProduct(), Pscf::Rp::FilmFieldGenExt< D, CUT >::stress(), Pscf::Rp::FilmFieldGenMask< D, CUT >::stress(), and Pscf::Rp::ScftThermo< D, CPT >::write().
| std::complex< double > Pscf::Reduce::sumProduct | ( | Array< fftw_complex > const & | a, |
| Array< fftw_complex > const & | b ) |
Compute sum of complex products of elements of two arrays (complex).
| a | first input array |
| b | second input array |
Definition at line 208 of file Reduce.cpp.
References Util::Array< Data >::capacity(), sum(), sumProduct(), and UTIL_CHECK.
Referenced by sumProduct().
| double Pscf::Reduce::max | ( | Array< double > const & | in | ) |
Get maximum of array elements (real).
| in | input array |
Definition at line 229 of file Reduce.cpp.
References Util::Array< Data >::capacity(), max(), and UTIL_CHECK.
Referenced by max(), max(), max(), max(), maxAbs(), and maxAbs().
| double Pscf::Reduce::max | ( | Array< double > const & | in, |
| int | begin, | ||
| int | end ) |
Get value of maximum element in an array slice (real).
| in | input array |
| begin | index of first element in slice |
| end | index one past the last in slice |
Definition at line 243 of file Reduce.cpp.
References Util::Array< Data >::capacity(), max(), and UTIL_CHECK.
| double Pscf::Reduce::maxAbs | ( | Array< double > const & | in | ) |
Get maximum absolute magnitude of array elements .
| in | input array |
Definition at line 260 of file Reduce.cpp.
References Util::Array< Data >::capacity(), max(), maxAbs(), and UTIL_CHECK.
| double Pscf::Reduce::min | ( | Array< double > const & | in | ) |
Get minimum of array elements .
| in | input array |
Definition at line 276 of file Reduce.cpp.
References Util::Array< Data >::capacity(), min(), and UTIL_CHECK.
Referenced by min(), min(), min(), min(), minAbs(), and minAbs().
| double Pscf::Reduce::min | ( | Array< double > const & | in, |
| int | begin, | ||
| int | end ) |
Get value of minimum element in an array slice (real).
| in | input array |
| begin | index of first element in slice |
| end | index one past the last in slice |
Definition at line 290 of file Reduce.cpp.
References Util::Array< Data >::capacity(), min(), and UTIL_CHECK.
| double Pscf::Reduce::minAbs | ( | Array< double > const & | in | ) |
Get minimum absolute magnitude of array elements .
| in | input array |
Definition at line 307 of file Reduce.cpp.
References Util::Array< Data >::capacity(), min(), minAbs(), and UTIL_CHECK.