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:
@ -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.;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user