|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| DenseDoubleMatrix1D.java | - | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
package baseCode.dataStructure.matrix;
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
/**
|
|
| 5 |
* Use this class when fast iteration over the matrix is of primary interest. The primary change
|
|
| 6 |
* is that getQuick is faster, and toArray returns the actual elements, not a copy. The latter
|
|
| 7 |
* is an important change to the contract of DouleMatrix1D, the former might have some unintended consequences
|
|
| 8 |
* because it hasn't been tested thoroughly.
|
|
| 9 |
*
|
|
| 10 |
* <hr>
|
|
| 11 |
* <p>Copyright (c) 2004 Columbia University
|
|
| 12 |
* @author pavlidis
|
|
| 13 |
* @version $Id: DenseDoubleMatrix1D.java,v 1.3 2004/08/17 21:17:41 pavlidis Exp $
|
|
| 14 |
*/
|
|
| 15 |
public class DenseDoubleMatrix1D extends |
|
| 16 |
cern.colt.matrix.impl.DenseDoubleMatrix1D {
|
|
| 17 |
|
|
| 18 |
/**
|
|
| 19 |
* @param size
|
|
| 20 |
* @param elements
|
|
| 21 |
* @param zero
|
|
| 22 |
* @param stride
|
|
| 23 |
*/
|
|
| 24 | 0 |
protected DenseDoubleMatrix1D( int size, double[] elements, int zero, int stride ) { |
| 25 | 0 |
super( size, elements, zero, stride );
|
| 26 |
} |
|
| 27 |
|
|
| 28 |
/**
|
|
| 29 |
* @param values
|
|
| 30 |
*/
|
|
| 31 | 0 |
public DenseDoubleMatrix1D( double[] values ) { |
| 32 | 0 |
super( values );
|
| 33 |
} |
|
| 34 |
|
|
| 35 |
/**
|
|
| 36 |
* @param size
|
|
| 37 |
*/
|
|
| 38 | 0 |
public DenseDoubleMatrix1D( int size ) { |
| 39 | 0 |
super( size );
|
| 40 |
} |
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
/**
|
|
| 45 |
* This is an optimized version of getQuick. Implementation note: the superclass uses an add and a multiply.
|
|
| 46 |
* This is faster, but there might be unforseen consequences...
|
|
| 47 |
*
|
|
| 48 |
* @see cern.colt.matrix.DoubleMatrix1D#getQuick(int)
|
|
| 49 |
*/
|
|
| 50 | 0 |
public double getQuick(int i) { |
| 51 | 0 |
return elements[i];
|
| 52 |
} |
|
| 53 |
|
|
| 54 |
|
|
| 55 |
/**
|
|
| 56 |
* WARNING unlike the superclass, this returns the actual underlying array, not a copy.
|
|
| 57 |
*
|
|
| 58 |
* @return the elements
|
|
| 59 |
* @see cern.colt.matrix.DoubleMatrix1D#toArray()
|
|
| 60 |
*/
|
|
| 61 | 0 |
public double[] toArray() { |
| 62 | 0 |
return elements;
|
| 63 |
} |
|
| 64 |
|
|
| 65 |
} |
|
| 66 |
|
|
||||||||||