crowlogic / arb4j

arb4j is a Java API for the arbitrary precision ball arithmetic library found at http://arblib.org
Other
1 stars 0 forks source link

test Real.newAlignedVectorViaAllocativeNative #355

Closed crowlogic closed 7 months ago

crowlogic commented 7 months ago
  public static Real newAlignedVectorViaAllocativeNative(int size)
  {

    Real x = new Real(0,
                      false);
    x.nativeSegment = arena.allocate(Real.BYTES * size, 4096);
    x.swigCPtr      = x.nativeSegment.address();
    x.dim           = size;
    x.elements      = new Real[x.dim];
    for (int j = 0; j < x.dim; j++)
    {
      Real y = x.elements[j] = new Real(x.swigCPtr + (Real.BYTES * j),
                                        false);
      y.init();
    }
    return x;
  }
crowlogic commented 7 months ago

screw that.. it'll be tested by virtue of it being used when its needed