while (low <= high) { int mid =(low + high)/2; double midVal = get(mid);
while (low <= high) { int mid =(low + high)/2; double midVal = get(mid);
while (low <= high) { int mid = (low + high) / 2; double midVal = get(mid);
/** * Applies a procedure to each element of the receiver, if any. * Starts at index 0, moving rightwards. * @param procedure the procedure to be applied. Stops iteration if the procedure returns <tt>false</tt>, otherwise continues. * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. */ public boolean forEach(DoubleProcedure procedure) { for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false; return true; } /**
/** * Applies a procedure to each element of the receiver, if any. * Starts at index 0, moving rightwards. * @param procedure the procedure to be applied. Stops iteration if the procedure returns <tt>false</tt>, otherwise continues. * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. */ public boolean forEach(DoubleProcedure procedure) { for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false; return true; } /**
/** * Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver. */ public java.util.ArrayList toList() { int mySize = size(); java.util.ArrayList list = new java.util.ArrayList(mySize); for (int i=0; i < mySize; i++) list.add(new Double(get(i))); return list; } /**
/** * Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver. */ public java.util.ArrayList toList() { int mySize = size(); java.util.ArrayList list = new java.util.ArrayList(mySize); for (int i=0; i < mySize; i++) list.add(new Double(get(i))); return list; } /**
/** * Returns a <code>java.util.ArrayList</code> containing all the elements in * the receiver. */ public java.util.ArrayList toList() { int mySize = size(); java.util.ArrayList list = new java.util.ArrayList(mySize); for (int i = 0; i < mySize; i++) list.add(new Double(get(i))); return list; }
/** * Returns the element at the specified position in this list. * * @param index index of element to return. * * @return the element at the specified position in this list. * @throws IndexOutOfBoundsException if the given index is out of range * (<tt>index < 0 || index >= size()</tt>). */ public Object get(int index) { return object(content.get(index)); } /**
/** * Returns the element at the specified position in this list. * * @param index index of element to return. * * @return the element at the specified position in this list. * @throws IndexOutOfBoundsException if the given index is out of range * (<tt>index < 0 || index >= size()</tt>). */ public Object get(int index) { return object(content.get(index)); } /**
/** * Applies a procedure to each element of the receiver, if any. Starts at * index 0, moving rightwards. * * @param procedure * the procedure to be applied. Stops iteration if the procedure * returns <tt>false</tt>, otherwise continues. * @return <tt>false</tt> if the procedure stopped before all elements where * iterated over, <tt>true</tt> otherwise. */ public boolean forEach(DoubleProcedure procedure) { for (int i = 0; i < size;) if (!procedure.apply(get(i++))) return false; return true; }
/** * Constructs a matrix from the values of the given list. * The values are copied. So subsequent changes in <tt>values</tt> are not reflected in the matrix, and vice-versa. * * @param values The values to be filled into the new matrix. * @return a new matrix. */ public DoubleMatrix1D make(cern.colt.list.AbstractDoubleList values) { int size = values.size(); DoubleMatrix1D vector = make(size); for (int i=size; --i >= 0; ) vector.set(i, values.get(i)); return vector; } /**
/** * Constructs a matrix from the values of the given list. * The values are copied. So subsequent changes in <tt>values</tt> are not reflected in the matrix, and vice-versa. * * @param values The values to be filled into the new matrix. * @return a new matrix. */ public DoubleMatrix1D make(cern.colt.list.AbstractDoubleList values) { int size = values.size(); DoubleMatrix1D vector = make(size); for (int i=size; --i >= 0; ) vector.set(i, values.get(i)); return vector; } /**