WSL/SLF GitLab Repository

Commit ef5ded52 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

The >> operator was not 100% properly implemented...

parent 583981b1
......@@ -254,6 +254,7 @@ template<class P> std::iostream& operator>>(std::iostream& is, Array1D<P>& array
is.read(reinterpret_cast<char*>(&array.nx), sizeof(array.nx));
array.vecData.resize(array.nx);
is.read(reinterpret_cast<char*>(&array.vecData[0]), array.nx*sizeof(P)); //30 times faster than assign() or copy()
return is;
}
template<class T> void Array1D<T>::insertAt(const int& index, T e) {
......
......@@ -407,6 +407,7 @@ template<class P> std::iostream& operator>>(std::iostream& is, Array2D<P>& array
is.read(reinterpret_cast<char*>(&array.ny), sizeof(array.ny));
array.vecData.resize(array.nx*array.ny);
is.read(reinterpret_cast<char*>(&array.vecData[0]), array.nx*array.ny*sizeof(P)); //30 times faster than assign() or copy()
return is;
}
......
......@@ -470,6 +470,7 @@ template<class P> std::iostream& operator>>(std::iostream& is, Array3D<P>& array
is.read(reinterpret_cast<char*>(&array.nz), sizeof(array.nz));
array.vecData.resize(array.nx*array.ny*array.nz);
is.read(reinterpret_cast<char*>(&array.vecData[0]), array.nx*array.ny*array.nz*sizeof(P)); //30 times faster than assign() or copy()
return is;
}
template<class T> T Array3D<T>::getMin() const {
......
......@@ -438,6 +438,7 @@ template<class P> std::iostream& operator>>(std::iostream& is, Array4D<P>& array
is.read(reinterpret_cast<char*>(&array.nw), sizeof(array.nw));
array.vecData.resize(array.nx*array.ny*array.nz*array.nw);
is.read(reinterpret_cast<char*>(&array.vecData[0]), array.nx*array.ny*array.nz*array.nw*sizeof(P)); //30 times faster than assign() or copy()
return is;
}
template<class T> T Array4D<T>::getMin() const {
......
......@@ -136,6 +136,7 @@ std::iostream& operator>>(std::iostream& is, Config& cfg) {
cfg.properties[key] = value;
}
return is;
}
//Parsing
......
......@@ -283,6 +283,7 @@ std::iostream& operator>>(std::iostream& is, Coords& coord) {
is.read(reinterpret_cast<char*>(&coord.coordparam[0]), s_coordparam*sizeof(coord.coordparam[0]));
is.read(reinterpret_cast<char*>(&coord.distance_algo), sizeof(coord.distance_algo));
return is;
}
/**
......
......@@ -1031,6 +1031,7 @@ std::iostream& operator>>(std::iostream& is, DEMObject& dem) {
is.read(reinterpret_cast<char*>(&dem.dflt_algorithm), sizeof(dem.dflt_algorithm));
is.read(reinterpret_cast<char*>(&dem.slope_failures), sizeof(dem.slope_failures));
is.read(reinterpret_cast<char*>(&dem.curvature_failures), sizeof(dem.curvature_failures));
return is;
}
......
......@@ -943,7 +943,7 @@ std::iostream& operator>>(std::iostream& is, Date& date) {
is.read(reinterpret_cast<char*>(&date.dst), sizeof(date.dst));
is.read(reinterpret_cast<char*>(&date.undef), sizeof(date.undef));
return is;
}
// PRIVATE METHODS
......
......@@ -336,6 +336,7 @@ std::iostream& operator>>(std::iostream& is, Grid2DObject& grid) {
is.read(reinterpret_cast<char*>(&grid.cellsize), sizeof(grid.cellsize));
is >> grid.llcorner;
is >> grid.grid2D;
return is;
}
} //namespace
......
......@@ -363,6 +363,7 @@ std::iostream& operator>>(std::iostream& is, Grid3DObject& grid) {
is >> grid.llcorner;
is >> grid.grid3D;
return is;
}
} //end namespace
......
......@@ -333,6 +333,7 @@ std::iostream& operator>>(std::iostream& is, MeteoData& data) {
is.read(reinterpret_cast<char*>(&data.nrOfAllParameters), sizeof(data.nrOfAllParameters));
is.read(reinterpret_cast<char*>(&data.resampled), sizeof(data.resampled));
return is;
}
void MeteoData::merge(std::vector<MeteoData>& vec1, const std::vector<MeteoData>& vec2, const bool& simple_merge)
......
......@@ -140,6 +140,7 @@ std::iostream& operator>>(std::iostream& is, StationData& station) {
is.read(reinterpret_cast<char*>(&station.slope), sizeof(station.slope));
is.read(reinterpret_cast<char*>(&station.azi), sizeof(station.azi));
return is;
}
} //end namespace
......
Supports Markdown
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