/** * Constructs an array lookup table for the lookup values and dimensions supplied as arguments. * * @param length the length of the lookup vector. * @param values the lookup values. The {@code values} array must be laid out in row-major * order, so that the dimension associated with the last axis varies fastest. * @param dimensions the interval partitions defining the dimensions associated with the lookup * table. An interval partition is a strictly increasing sequence of at least * two real numbers, see {@link IntervalPartition}. * @throws IllegalArgumentException if {@code length} is less than {@code 1} or the length of * {@code values} is not equal to {@code length} times the number * of coordinate grid vertices. * @throws NullPointerException if the {@code values} array or the {@code dimensions} array * is {@code null} or any dimension is {@code null}. */ public VectorLookupTable(int length, final double[] values, final IntervalPartition... dimensions) { this(length, new Array.Double(values), dimensions); }
/** * Constructs a lookup table for the lookup values and dimensions supplied as arguments. * * @param values the lookup values. The {@code values} array must be laid out in row-major * order, so that the dimension associated with the last axis varies fastest. * @param dimensions the interval partitions defining the dimensions associated with the lookup * table. An interval partition is a strictly increasing sequence of at least * two real numbers, see {@link IntervalPartition}. * * @throws IllegalArgumentException if the length of the {@code values} array is not equal to * the number of coordinate grid vertices. * @throws NullPointerException if the {@code values} array or the {@code dimensions} array * is {@code null} or any dimension is {@code null}. */ public LookupTable(final double[] values, final IntervalPartition... dimensions) { this(new Array.Double(values), dimensions); }
public MatrixLookupTable(int m, int n, MatrixFactory matrixFactory, double[] values, IntervalPartition... dimensions) { this(m, n, matrixFactory, new Array.Double(values), dimensions); }
/** * Constructs an interval partition from a sequence of real numbers. * * @param sequence the sequence. The sequence must increase strictly and * consist of at least two real numbers. * * @throws IllegalArgumentException if the sequence is not strictly increasing * or consists of less than two real numbers. * @throws NullPointerException if the sequence is {@code null}. */ public IntervalPartition(final double... sequence) { this(new Array.Double(sequence)); }
public void testDoubleCopyTo() { final Array array = new Array.Double(new double[]{1, 2, 3, 4, 5}); final double[] dest = new double[3]; array.copyTo(1, dest, 0, 3); assertEquals(2.0, dest[0], 0.0); assertEquals(3.0, dest[1], 0.0); assertEquals(4.0, dest[2], 0.0); }