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