Creates a constant {@link Basic2DMatrix} of the given shape and {@code value}.
769455
public static Basic2DMatrix constant(int rows, int columns, double constant) {
        double[][] array = new double[rows][columns];

        for (int i = 0; i < rows; i++) {
            Arrays.fill(array[i], constant);
        }

        return new Basic2DMatrix(array);
    }
1327742
public NDArrayDoublesProto.NDArrayDoubles.Builder getProtoBuilder() {
    NDArrayDoublesProto.NDArrayDoubles.Builder b = NDArrayDoublesProto.NDArrayDoubles.newBuilder();
    for (int n : getDimensions()) {
      b.addDimensionSize(n);
    }
    for (double value : values) {
      b.addValues(value);
    }
    return b;
  }
197448
public static <T extends Geometry> JTSGeometryExpression<T> asJTSGeometry(T value) {
        return asJTSGeometry(Expressions.constant(value));
    }
4857
public static MatrixFunction asConstFunction(final double arg) {
        return new MatrixFunction() {
            @Override
            public double evaluate(int i, int j, double value) {
                return arg;
            }
        };
    }
298581
public SDVariable constant(String name, float value) {
        try(MemoryWorkspace ws = Nd4j.getMemoryManager().scopeOutOfWorkspaces()) {
            return constant(name, Nd4j.scalar(value));
        }
    }
132090
public static Matrix constant(int rows, int columns, double constant) {
        return DenseMatrix.constant(rows, columns, constant);
    }
134940
@VisibleForTesting
  static TypedValue createTypedValue(Value value) {
    return value.match(
        typedValueDoubleFunction,
        typedValueLongFunction,
        typedValueDistributionFunction,
        typedValueSummaryFunction,
        Functions.<TypedValue>throwIllegalArgumentException());
  }
491280
@Override
    public INDArray create(int[] shape, int[] stride, long offset) {
        DataBuffer buffer = Nd4j.createBuffer(ArrayUtil.prodLong(shape));
        return create(buffer, shape, stride, offset);
    }
475849
public static <T> T newInstance(final T value) throws MIDDException {
        if (value == null) {
            return null;
        } else {
            return newInstance(value, value.getClass());
        }

    }
587872
public static Value.Builder makeValue(Value.Builder value1, Value.Builder value2,
      Value.Builder... rest) {
    ArrayValue.Builder arrayValue = ArrayValue.newBuilder();
    arrayValue.addValues(value1);
    arrayValue.addValues(value2);
    for (Value.Builder builder : rest) {
      arrayValue.addValues(builder);
    }
    return Value.newBuilder().setArrayValue(arrayValue);
  }
439845
public static SimpleMatrix convertSimple( DMatrixRBlock A ) {
        DMatrixRMaj B = ConvertDMatrixStruct.convert(A, null);

        return SimpleMatrix.wrap(B);
    }
1293418
public static Basic1DMatrix fromCSV(String csv) {
        return Matrix.fromCSV(csv).to(Matrices.BASIC_1D);
    }
1149278
private void setBar( final double VALUE ) {

        currentValueAngle = Helper.clamp(90.0, 270.0, ( VALUE - minValue ) * angleStep + 90.0);

        double smallHeight     = 0.675 * height;
        double tinyHeight      = 0.3 * height;
        double currentValueSin = Math.sin(-Math.toRadians(currentValueAngle));
        double currentValueCos = Math.cos(-Math.toRadians(currentValueAngle));

        dataBarOuterArc.setX(centerX + smallHeight * currentValueSin);
        dataBarOuterArc.setY(centerX + smallHeight * currentValueCos);
        dataBarLineToInnerArc.setX(centerX + tinyHeight * currentValueSin);
        dataBarLineToInnerArc.setY(centerX + tinyHeight * currentValueCos);

        if (gauge.isStartFromZero()) {

            double min = gauge.getMinValue();
            double max = gauge.getMaxValue();

            if ( ( VALUE > min || min < 0 ) && ( VALUE < max || max > 0 ) ) {
                if ( max < 0 ) {
                    dataBarStart.setX(centerX + smallHeight);
                    dataBarStart.setY(smallHeight);
                    dataBarOuterArc.setSweepFlag(false);
                    dataBarInnerArc.setX(centerX + tinyHeight);
                    dataBarInnerArc.setY(smallHeight);
                    dataBarInnerArc.setSweepFlag(true);
                } else if ( min > 0 ) {
                    dataBarStart.setX(0);
                    dataBarStart.setY(smallHeight);
                    dataBarOuterArc.setSweepFlag(true);
                    dataBarInnerArc.setX(0.27778 * width);
                    dataBarInnerArc.setY(smallHeight);
                    dataBarInnerArc.setSweepFlag(false);
                } else {

                    double zeroAngle = Helper.clamp(90.0, 270.0, 90.0 - minValue * angleStep);
                    double zeroSin   = Math.sin(-Math.toRadians(zeroAngle));
                    double zeroCos   = Math.cos(-Math.toRadians(zeroAngle));

                    dataBarStart.setX(centerX + smallHeight * zeroSin);
                    dataBarStart.setY(centerX + smallHeight * zeroCos);
                    dataBarInnerArc.setX(centerX + tinyHeight * zeroSin);
                    dataBarInnerArc.setY(centerX + tinyHeight * zeroCos);

                    if ( VALUE < 0 ) {
                        dataBarOuterArc.setSweepFlag(false);
                        dataBarInnerArc.setSweepFlag(true);
                    } else {
                        dataBarOuterArc.setSweepFlag(true);
                        dataBarInnerArc.setSweepFlag(false);
                    }

                }
            }

        } else {
            dataBarStart.setX(0);
            dataBarStart.setY(smallHeight);
            dataBarOuterArc.setSweepFlag(true);
            dataBarInnerArc.setX(0.27778 * width);
            dataBarInnerArc.setY(smallHeight);
            dataBarInnerArc.setSweepFlag(false);
        }

        setBarColor(VALUE);

        valueText.setText(formatNumber(gauge.getLocale(), gauge.getFormatString(), gauge.getDecimals(), VALUE));
        if ( valueText.getLayoutBounds().getWidth() > 0.28 * width ) {
            Helper.adjustTextSize(valueText, 0.28 * width, size * 0.24);
        }
        valueText.relocate(( width - valueText.getLayoutBounds().getWidth() ) * 0.5, 0.615 * height + ( 0.3 * height - valueText.getLayoutBounds().getHeight() ) * 0.5);
    }
205992
public static DenseMatrix constant(int rows, int columns, double constant) {
        return Basic2DMatrix.constant(rows, columns, constant);
    }
590146
public static Basic2DMatrix fromCSV(String csv) {
        return Matrix.fromCSV(csv).to(Matrices.BASIC_2D);
    }
116148
public static BasicVector constant(int length, double value) {
        double[] array = new double[length];
        Arrays.fill(array, value);

        return new BasicVector(array);
    }
816369
public static DoubleStreamEx constant(double value, long length) {
        return of(new ConstSpliterator.OfDouble(value, length, false));
    }