geotopmodel / geotop

GEOtop is a distributed model of the mass and energy balance of the hydrological cycle, which is applicable to simulations in continuum in small catchments. GEOtop deals with the effects of topography on the interaction between energy balance and hydrological cycle with peculiar solutions.
GNU General Public License v3.0
38 stars 29 forks source link

implement norm_inf inside vector class #94

Closed asartori86 closed 5 years ago

asartori86 commented 5 years ago

I formatted vector.h with clang-format that's why you see all these changes but I just inserted this member function

  T norm_inf() const noexcept {
    auto m = (*this)[nl];
    for (auto i = nl + 1; i <= nh; ++i) {
      if ((*this)[i] > m)
        m = (*this)[i];
    }
    return m;
  }
asartori86 commented 5 years ago

Oh yes, I remember we had this discussion earlier and the norm_inf implemented actually does not compute the norm inf but the maximum in a given range, which is not the full array