1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-16 23:07:05 +01:00

fix vector assign bug

This commit is contained in:
Yong-Chull Jang
2017-11-27 13:39:52 -05:00
parent 91cc33e907
commit 2c35c89b92
2 changed files with 15 additions and 7 deletions

View File

@ -84,7 +84,8 @@ namespace Grid {
public:
void csv(std::ostream &out){
RealD diff = hi-lo;
for (RealD x=lo-0.2*diff; x<hi+0.2*diff; x+=(hi-lo)/1000) {
//for (RealD x=lo-0.2*diff; x<hi+0.2*diff; x+=(hi-lo)/1000) {
for (RealD x=lo-0.2*diff; x<hi+0.2*diff; x+=diff/1000.0) { // ypj [note] divide by float
RealD f = approx(x);
out<< x<<" "<<f<<std::endl;
}
@ -115,7 +116,10 @@ namespace Grid {
if(order < 2) exit(-1);
Coeffs.resize(order);
Coeffs.assign(0.,order);
//Coeffs.assign(0.,order);
// ypj [note] Does it mean 0 initiallization?
// Then, arguments of the assign() have to be swapped:
Coeffs.assign(order,0.);
Coeffs[order-1] = 1.;
};