Unverified Commit 3b07dc1e authored by Kelvin Rodriguez's avatar Kelvin Rodriguez Committed by GitHub
Browse files

replaced custom min/max with std::max/std::min (#5490)

* replaced custom min/max with std::max/std::min

* left a gdal reference in

* oops
parent 7edf07d9
Loading
Loading
Loading
Loading
+4 −22
Original line number Diff line number Diff line
@@ -25,24 +25,6 @@ using namespace std;

namespace Isis {

  template <typename T> inline T MIN(const T &A, const T &B) {
    if(A < B) {
      return (A);
    }
    else         {
      return (B);
    }
  }

  template <typename T> inline T MAX(const T &A, const T &B) {
    if(A > B) {
      return (A);
    }
    else         {
      return (B);
    }
  }

  static inline double SetFloor(double value, const int precision) {
    double scale = pow(10.0, precision);
    value = floor(value * scale) / scale;
@@ -295,13 +277,13 @@ namespace Isis {
                          "meters/pixel");
    mapping += PvlKeyword("CenterLongitude", toString(SetRound(avgLon, digits)));
    mapping += PvlKeyword("CenterLatitude",  toString(SetRound(avgLat, digits)));
    mapping += PvlKeyword("MinimumLatitude", toString(MAX(SetFloor(latitudeStat.Minimum(),
    mapping += PvlKeyword("MinimumLatitude", toString(std::max(SetFloor(latitudeStat.Minimum(),
                                                                   digits), -90.0)));
    mapping += PvlKeyword("MaximumLatitude", toString(MIN(SetCeil(latitudeStat.Maximum(),
    mapping += PvlKeyword("MaximumLatitude", toString(std::min(SetCeil(latitudeStat.Maximum(),
                                                                   digits), 90.0)));
    mapping += PvlKeyword("MinimumLongitude", toString(MAX(SetFloor(longitudeStat.Minimum(),
    mapping += PvlKeyword("MinimumLongitude", toString(std::max(SetFloor(longitudeStat.Minimum(),
                                                                    digits), -180.0)));
    mapping += PvlKeyword("MaximumLongitude", toString(MIN(SetCeil(longitudeStat.Maximum(),
    mapping += PvlKeyword("MaximumLongitude", toString(std::min(SetCeil(longitudeStat.Maximum(),
                                                                   digits), 360.0)));

    PvlKeyword clat("PreciseCenterLongitude", toString(avgLon));
+0 −21
Original line number Diff line number Diff line
@@ -34,27 +34,6 @@

namespace Isis {

  /** Implement templatized MIN fumnction */
  template <typename T> inline T MIN(const T &A, const T &B) {
    if(A < B) {
      return (A);
    }
    else         {
      return (B);
    }
  }

  /** Implement templatized MAX function */
  template <typename T> inline T MAX(const T &A, const T &B) {
    if(A > B) {
      return (A);
    }
    else         {
      return (B);
    }
  }


  class PvlObject;
  class Camera;

+0 −3
Original line number Diff line number Diff line
@@ -4,9 +4,6 @@
#include "IException.h"
#include "IString.h"

#define MIN(x,y) (((x) < (y)) ? (x) : (y))
#define MAX(x,y) (((x) > (y)) ? (x) : (y))

namespace Isis {
  /**
   * Constructs AlbedoAtm object using a Pvl, PhotoModel, and
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ find files of those names at the top level of this repository. **/
#include "TProjection.h"
#include "Longitude.h"


using namespace std;

namespace Isis {
+0 −3
Original line number Diff line number Diff line
@@ -9,9 +9,6 @@ find files of those names at the top level of this repository. **/
#include "SpecialPixel.h"
#include "IException.h"

#define MIN(x,y) (((x) < (y)) ? (x) : (y))
#define MAX(x,y) (((x) > (y)) ? (x) : (y))

namespace Isis {
  MoonAlbedo::MoonAlbedo(Pvl &pvl, PhotoModel &pmodel) :
    NormModel(pvl, pmodel) {
Loading