Class LinearScaling

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double factor
      Scaling factor
      private double shift
      Shift
    • Constructor Summary

      Constructors 
      Constructor Description
      LinearScaling()
      Constructor with defaults resulting in identity.
      LinearScaling​(double factor)
      Constructor with scaling only.
      LinearScaling​(double factor, double shift)
      Full constructor.
      LinearScaling​(DoubleMinMax minmax)
      Constructor from a double minmax.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static LinearScaling fromMinMax​(double min, double max)
      Make a linear scaling from a given minimum and maximum.
      double getMax()
      Get maximum resulting value.
      double getMin()
      Get minimum resulting value.
      double getScaled​(double d)
      Transform a given value using the scaling function.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • factor

        private double factor
        Scaling factor
      • shift

        private double shift
        Shift
    • Constructor Detail

      • LinearScaling

        public LinearScaling()
        Constructor with defaults resulting in identity.
      • LinearScaling

        public LinearScaling​(double factor)
        Constructor with scaling only.
        Parameters:
        factor - Scaling factor
      • LinearScaling

        public LinearScaling​(double factor,
                             double shift)
        Full constructor.
        Parameters:
        factor - Scaling factor
        shift - Shift value
      • LinearScaling

        public LinearScaling​(DoubleMinMax minmax)
        Constructor from a double minmax.
        Parameters:
        minmax - Minimum and Maximum
    • Method Detail

      • getScaled

        public double getScaled​(double d)
        Description copied from interface: ScalingFunction
        Transform a given value using the scaling function.
        Specified by:
        getScaled in interface ScalingFunction
        Parameters:
        d - Original value
        Returns:
        Scaled value
      • getMin

        public double getMin()
        Description copied from interface: ScalingFunction
        Get minimum resulting value. May be Double.NaN or Double.NEGATIVE_INFINITY.
        Specified by:
        getMin in interface ScalingFunction
        Returns:
        Minimum resulting value.
      • getMax

        public double getMax()
        Description copied from interface: ScalingFunction
        Get maximum resulting value. May be Double.NaN or Double.POSITIVE_INFINITY.
        Specified by:
        getMax in interface ScalingFunction
        Returns:
        Maximum resulting value.
      • fromMinMax

        public static LinearScaling fromMinMax​(double min,
                                               double max)
        Make a linear scaling from a given minimum and maximum. The minimum will be mapped to zero, the maximum to one.
        Parameters:
        min - Minimum
        max - Maximum
        Returns:
        New linear scaling.