Esempio n. 1
0
 public static RDouble expandXVector(DoubleImpl xarg, int xsize, int count) {
     int nsize = xsize * count;
     double[] x = xarg.getContent();
     double[] res = new double[nsize];
     int offset = 0;
     for (int rep = 0; rep < count; rep++) {
         System.arraycopy(x, 0, res, offset, xsize);
         offset += xsize;
     }
     return RDouble.RDoubleFactory.getFor(res);
 }
Esempio n. 2
0
    public static RDouble expandYVector(DoubleImpl yarg, int ysize, int count) {
        int size = ysize;
        int nsize = size * count;
        double[] y = yarg.getContent();

        double[] res = new double[nsize];
        int offset = 0;
        for (int elem = 0; elem < size; elem++) {
            double v = y[elem];
            Arrays.fill(res, offset, offset + count, v);
            offset += count;
        }
        return RDouble.RDoubleFactory.getFor(res);
    }