Divides each row by its max

@param toScale the matrix to divide by its row maxes
434054
public static void scaleByMax(INDArray toScale) {
        INDArray scale = toScale.max(1);
        for (int i = 0; i < toScale.rows(); i++) {
            double scaleBy = scale.getDouble(i);
            toScale.putRow(i, toScale.getRow(i).divi(scaleBy));
        }
    }
952746
public static double interpolate(double[][] matrix, double tol) {
        return interpolate(matrix, tol, 2 * Math.max(matrix.length, matrix[0].length));
    }
866421
public int getScale(int column) throws SQLException
    {
        sourceResultSet.checkColumnBounds(column);
        VoltType type = sourceResultSet.table.getColumnType(column - 1);
        Integer result = type.getMaximumScale();
        if (result == null) {
            result = 0;
        }
        return result;
    }
886626
@Override
    public void setExpectedMaxSize( int numRows , int numCols ) {
        super.setExpectedMaxSize(numRows,numCols);

        // if the matrix that is being decomposed is smaller than the block we really don't
        // see the B matrix.
        if( numRows < blockWidth)
            B = new DMatrixRMaj(0,0);
        else
            B = new DMatrixRMaj(blockWidth,maxWidth);

        chol = new CholeskyBlockHelper_DDRM(blockWidth);
    }
1045323
public static void divideRowBy(DenseDoubleMatrix2D matrix, long aRow, long fromCol, double value) {
		long cols = matrix.getColumnCount();
		for (long col = fromCol; col < cols; col++) {
			matrix.setDouble(matrix.getDouble(aRow, col) / value, aRow, col);
		}
	}
770512
public static INDArray unitVec(INDArray toScale) {
        double length = toScale.norm2Number().doubleValue();

        if (length > 0) {
            if (toScale.data().dataType() == (DataType.FLOAT))
                return Nd4j.getBlasWrapper().scal(1.0f / (float) length, toScale);
            else
                return Nd4j.getBlasWrapper().scal(1.0 / length, toScale);

        }
        return toScale;
    }
1305153
@Pure
	@SuppressWarnings("checkstyle:magicnumber")
	public void getScaleVector(Tuple2D<?> scale) {
		assert scale != null : AssertMessages.notNullParameter();
		final double[] tmpScale = new double[3];
		final double[] tmpRot = new double[9];
		getScaleRotate2x2(tmpScale, tmpRot);
		scale.set(tmpScale[0], tmpScale[1]);
	}
1274443
public static int[] selectPyramidScale( int imageWidth , int imageHeight, int minSize ) {
		int w = Math.max(imageWidth,imageHeight);

		int maxScale = w/minSize;
		int n = 1;
		int scale = 1;
		while( scale*2 < maxScale ) {
			n++;
			scale *= 2;
		}

		int ret[] = new int[n];
		scale = 1;
		for( int i = 0; i < n; i++ ) {
			ret[i] = scale;
			scale *= 2;
		}

		return ret;
	}
961288
private static float computeScale(float minScale, float maxScale, float currentScale, float delta) {
		if(currentScale * delta < minScale) {
			return minScale / currentScale;
		} else if(currentScale * delta > maxScale) {
			return maxScale / currentScale;
		}

		return delta;
	}
405215
protected LinearScale computeScale(ClusterOrder order) {
    DoubleMinMax range = new DoubleMinMax();
    // calculate range
    for(DBIDIter it = order.iter(); it.valid(); it.advance()) {
      final double reach = co.getReachability(it);
      if(reach < Double.POSITIVE_INFINITY) {
        range.put(reach);
      }
    }
    // Ensure we have a valid range
    if(!range.isValid()) {
      range.put(0.0);
      range.put(1.0);
    }
    return new LinearScale(range.getMin(), range.getMax());
  }
500396
byte[] getScaledRow(int scale) {
    byte[] output = new byte[row.length * scale];
    for (int i = 0; i < output.length; i++) {
      output[i] = row[i / scale];
    }
    return output;
  }
943640
public static void scale( double alpha , DMatrix3 a ) {
        a.a1 *= alpha;
        a.a2 *= alpha;
        a.a3 *= alpha;
    }
946544
func ToScale(input, min, max float64) float64 {
	i := input*(math.Max(min, max)-math.Min(min, max)) + math.Min(min, max)
	if i < math.Min(min, max) {
		return math.Min(min, max)
	} else if i > math.Max(min, max) {
		return math.Max(min, max)
	} else {
		return i
	}
}
913112
function MinMaxScalerTransforms(vector = [], nan_value = -1, return_nan=false) {
              const average = avg$2(vector);
              const standard_dev = sd(vector);
              const maximum = max$1(vector);
              const minimum = min$1(vector);
              const scale = (z) => {
                const scaledValue = (z - average) / (maximum - minimum);
                if (isNaN(scaledValue) && return_nan) return scaledValue;
                else if (isNaN(scaledValue) && return_nan === false) return (isNaN(standard_dev)) ? z : standard_dev;
                else return scaledValue;
              }; // equivalent to MinMaxScaler(z)
              const descale = (scaledZ) => {
                const descaledValue = (scaledZ * (maximum - minimum)) + average;
                if (isNaN(descaledValue) && return_nan) return descaledValue;
                else if (isNaN(descaledValue) && return_nan === false) return (isNaN(standard_dev)) ? scaledZ : standard_dev;
                else return descaledValue;
              };
              const values = vector.map(scale)
                .map(val => {
                  if (isNaN(val)) return nan_value;
                  else return val;
                });
              return {
                components: {
                  average,
                  standard_dev,
                  maximum,
                  minimum,
                },
                scale,
                descale,
                values,
              };
            }
246500
private static void doLayout(
            final Graphics2D graphics2d, final ScalebarAttributeValues scalebarParams,
            final ScaleBarRenderSettings settings) {
        final Dimension maxLabelSize = getMaxLabelSize(settings);

        int numSubIntervals = 1;
        if (scalebarParams.subIntervals) {
            numSubIntervals = getNbSubIntervals(
                    settings.getScaleUnit(), settings.getIntervalLengthInWorldUnits(),
                    settings.getIntervalUnit());
        }

        settings.setBarSize(getBarSize(settings));
        settings.setLabelDistance(getLabelDistance(settings));
        settings.setLineWidth(getLineWidth(settings));
        settings.setSize(getSize(scalebarParams, settings, maxLabelSize));
        settings.setMaxLabelSize(maxLabelSize);
        settings.setNumSubIntervals(numSubIntervals);

        ScalebarDrawer drawer = scalebarParams.getType().createDrawer(graphics2d, settings);
        drawer.draw();
    }
755636
static void divide(Slice dividend, int dividendScaleFactor, Slice divisor, int divisorScaleFactor, Slice quotient, Slice remainder)
    {
        divide(getRawLong(dividend, 0), getRawLong(dividend, 1), dividendScaleFactor, getRawLong(divisor, 0), getRawLong(divisor, 1), divisorScaleFactor, quotient, remainder);
    }
944524
public void scaleWeights(double scale) {
    for (int i = 0; i < weights.length; i++) {
      for (int j = 0; j < weights[i].length; j++) {
        weights[i][j] *= scale;
      }
    }
  }