Commit e66b7c0d by Francois Gygi

Replace zeroing loops with memset in FourierTransform.C

parent 5af642dc
......@@ -700,15 +700,7 @@ void FourierTransform::bwd(complex<double>* val)
// copy from rbuf to val
// scatter index array iunpack
{
const int len = np012loc() * 2;
double* const pv = (double*) &val[0];
#pragma omp parallel for
for ( int i = 0; i < len; i++ )
{
pv[i] = 0.0;
}
}
memset((void*)&val[0],0,2*np012loc()*sizeof(double));
#if TIMING
tm_b_zero.stop();
......@@ -1594,15 +1586,10 @@ void FourierTransform::init_lib(void)
////////////////////////////////////////////////////////////////////////////////
void FourierTransform::vector_to_zvec(const complex<double> *c)
{
// map one real or complex function to zvec
memset((void*)&zvec_[0],0,zvec_.size()*sizeof(complex<double>));
const int ng = basis_.localsize();
const int zvec_size = zvec_.size();
double* const pz = (double*) &zvec_[0];
#pragma omp parallel for
for ( int i = 0; i < zvec_size; i++ )
{
pz[2*i] = 0.0;
pz[2*i+1] = 0.0;
}
const double* const pc = (double*) &c[0];
if ( basis_.real() )
{
......@@ -1655,16 +1642,10 @@ void FourierTransform::zvec_to_vector(complex<double> *c)
void FourierTransform::doublevector_to_zvec(const complex<double> *c1,
const complex<double> *c2)
{
// Mapping of two real functions onto zvec
// map two real functions to zvec
assert(basis_.real());
const int zvec_size = zvec_.size();
memset((void*)&zvec_[0],0,zvec_.size()*sizeof(complex<double>));
double* const pz = (double*) &zvec_[0];
#pragma omp parallel for
for ( int i = 0; i < zvec_size; i++ )
{
pz[2*i] = 0.0;
pz[2*i+1] = 0.0;
}
const int ng = basis_.localsize();
const double* const pc1 = (double*) &c1[0];
const double* const pc2 = (double*) &c2[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment