@Override public void continuousIndicesOf( Longs xs, ContinuousIndexArray result ) { int nx = xs.n( ); for ( int ix = 0; ix < nx; ix++ ) { long x = xs.v( ix ); long offset = x - v0; long i = max( 0, min( n - 2, ( offset / vStep ) ) ); float f = ( float ) ( ( offset - i * vStep ) * oneOverVStep ); result.put( ix, ( int ) i, f ); } }
@Override public void append( Longs vs ) { append( vs, 0, vs.n( ) ); }
@Override public void insert( int i, Longs vs, int from, int to ) { int c = to - from; prepForInsert( i, c ); vs.copyTo( from, a, i, c ); }
@Override public void prepend( Longs vs ) { prepend( vs, 0, vs.n( ) ); }
@Override public void append( Longs vs, int from, int to ) { int c = to - from; prepForAppend( c ); vs.copyTo( from, a, n - c, c ); }
/** * @throws RuntimeException if n is less than 2 */ @Override public void continuousIndicesOf( Longs xs, ContinuousIndexArray result ) { int n = this.n; if ( n < 2 ) throw new RuntimeException( ); int nx = xs.n( ); ContinuousIndex h = new ContinuousIndex( ); for ( int ix = 0; ix < nx; ix++ ) { long x = xs.v( ix ); continuousIndexOf( x, h ); result.put( ix, h ); } }
@Override public void insert( int i, Longs vs ) { insert( i, vs, 0, vs.n( ) ); }
@Override public void prepend( Longs vs, int from, int to ) { int c = to - from; prepForPrepend( c ); vs.copyTo( from, a, 0, c ); }
/** * @throws RuntimeException if n is less than 2 */ @Override public ContinuousIndexArray continuousIndicesOf( Longs xs ) { ContinuousIndexArray hs = new ContinuousIndexArray( xs.n( ) ); continuousIndicesOf( xs, hs ); return hs; }
@Override public ContinuousIndexArray continuousIndicesOf( Longs xs ) { ContinuousIndexArray hs = new ContinuousIndexArray( xs.n( ) ); continuousIndicesOf( xs, hs ); return hs; }