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