FIXED a recently introduced bug in vec.h
This commit is contained in:
6
t.cc
6
t.cc
@@ -4506,11 +4506,11 @@ if(0)
|
||||
int n,m;
|
||||
cin>>n >>m;
|
||||
NRSMat<complex<double> > a(n);
|
||||
a.randomize(.5);
|
||||
a.randomize(.1);
|
||||
|
||||
for(int i=0;i<n;++i)
|
||||
{
|
||||
a(i,i)= RANDDOUBLE() + .2*(i-n);
|
||||
a(i,i)= RANDDOUBLE() + .5*(i-n);
|
||||
}
|
||||
//cout <<"test matrix = "<<a;
|
||||
|
||||
@@ -4522,7 +4522,7 @@ cout <<"Exact energies "<<rr;
|
||||
|
||||
NRVec<complex<double> > r(m);
|
||||
NRVec<complex<double> > *eivecs = new NRVec<complex<double> >[m];
|
||||
davidson(a,r,eivecs,NULL,m,true,1e-6,true,10*n,n*10);
|
||||
davidson(a,r,eivecs,NULL,m,true,1e-5,true,10*n,n);
|
||||
|
||||
cout <<"Davidson energies " <<r;
|
||||
cout <<"Exact energies "<<rr;
|
||||
|
||||
4
vec.h
4
vec.h
@@ -314,7 +314,7 @@ public:
|
||||
|
||||
//! compute the Euclidean inner product (with conjugation in complex case) with a stride-vector
|
||||
inline const T dot(const T *a, const int stride = 1, bool conjugate=true) const;
|
||||
inline const T dot(const NRVec &rhs, bool conjugate=true) const {return dot(&((*this)[0]),1,conjugate);};
|
||||
inline const T dot(const NRVec &rhs, bool conjugate=true) const {return dot(&(rhs[0]),1,conjugate);};
|
||||
|
||||
void gemv(const T beta, const NRMat<T> &a, const char trans, const T alpha, const NRVec &x);
|
||||
void gemv(const T beta, const NRSMat<T> &a, const char trans /**< just for compatibility reasons */, const T alpha, const NRVec &x);
|
||||
@@ -1832,7 +1832,7 @@ inline const std::complex<double> NRVec<std::complex<double> >::dot(const std::c
|
||||
std::complex<double> dot;
|
||||
NOT_GPU(*this);
|
||||
if(conjugate) cblas_zdotc_sub(nn, v,1,y, stride, &dot);
|
||||
else cblas_zdotc_sub(nn, v,1,y, stride, &dot);
|
||||
else cblas_zdotu_sub(nn, v,1,y, stride, &dot);
|
||||
return dot;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user