|
|
@ -13,18 +13,8 @@ class BaseData |
|
|
|
protected: |
|
|
|
protected: |
|
|
|
static constexpr real fillval = 1.0e10; |
|
|
|
static constexpr real fillval = 1.0e10; |
|
|
|
std::vector<real> data; |
|
|
|
std::vector<real> data; |
|
|
|
std::vector<real> lons, lats; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BaseData(size_t n): data(n), lons(n), lats(n) {} |
|
|
|
BaseData(size_t n): data(n) {} |
|
|
|
|
|
|
|
|
|
|
|
template<class Lon, class Lat> BaseData(size_t n, Lon genlon, Lat genlat): data(n), lons(n), lats(n) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
for(size_t i = 0; i < n; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
lons[i] = genlon(i); |
|
|
|
|
|
|
|
lats[i] = genlat(i); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
public: |
|
|
|
BaseData() = default; |
|
|
|
BaseData() = default; |
|
|
@ -35,9 +25,6 @@ class BaseData |
|
|
|
const real& operator()(size_t i) const { return data[i]; } |
|
|
|
const real& operator()(size_t i) const { return data[i]; } |
|
|
|
real& operator()(size_t i) { return data[i]; } |
|
|
|
real& operator()(size_t i) { return data[i]; } |
|
|
|
|
|
|
|
|
|
|
|
real Lon(size_t i) const { return lons[i]; } |
|
|
|
|
|
|
|
real Lat(size_t i) const { return lats[i]; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
size_t N() const { return data.size(); } |
|
|
|
size_t N() const { return data.size(); } |
|
|
|
|
|
|
|
|
|
|
|
bool IsFill(size_t i) const { return V(i) == Fillval(); } |
|
|
|
bool IsFill(size_t i) const { return V(i) == Fillval(); } |
|
|
|