/** * Create a new {@link RealSum}. The fields for intermediate sums is * initialized with a given number of elements and will only be expanded * on demand as new elements are added and the number of existing elements * is not sufficient. This may be faster in cases where the required * number of elements is known in prior. * * @param capacity */ public RealSum( final int capacity ) { final int ldu = Util.ldu( capacity ) + 1; flags = new boolean[ ldu ]; sums = new double[ ldu ]; }
/** * Create a new {@link RealSum}. The fields for intermediate sums is * initialized with a given number of elements and will only be expanded * on demand as new elements are added and the number of existing elements * is not sufficient. This may be faster in cases where the required * number of elements is known in prior. * * @param capacity */ public RealSum( final int capacity ) { final int ldu = Util.ldu( capacity ) + 1; flags = new boolean[ ldu ]; sums = new double[ ldu ]; }