public class WrapperDoubleMatrix1D extends DoubleMatrix1D
Constructor and Description |
---|
WrapperDoubleMatrix1D(DoubleMatrix1D newContent) |
Modifier and Type | Method and Description |
---|---|
Object |
elements()
Returns the elements of this matrix.
|
double |
getQuick(int index)
Returns the matrix cell value at coordinate index.
|
DoubleMatrix1D |
like(int size)
Construct and returns a new empty matrix of the same dynamic type
as the receiver, having the specified size.
|
DoubleMatrix2D |
like2D(int rows,
int columns)
Construct and returns a new 2-d matrix of the corresponding dynamic
type, entirelly independent of the receiver.
|
DoubleMatrix2D |
reshape(int rows,
int columns)
Returns new DoubleMatrix2D of size rows x columns whose elements are
taken column-wise from this matrix.
|
DoubleMatrix3D |
reshape(int slices,
int rows,
int columns)
Returns new DoubleMatrix3D of size slices x rows x columns, whose
elements are taken column-wise from this matrix.
|
void |
setQuick(int index,
double value)
Sets the matrix cell at coordinate index to the specified value.
|
DoubleMatrix1D |
viewFlip()
Constructs and returns a new flip view.
|
DoubleMatrix1D |
viewPart(int index,
int width)
Constructs and returns a new sub-range view that is a
width sub matrix starting at index.
|
DoubleMatrix1D |
viewSelection(int[] indexes)
Constructs and returns a new selection view that is a matrix
holding the indicated cells.
|
DoubleMatrix1D |
viewStrides(int _stride)
Constructs and returns a new stride view which is a sub matrix
consisting of every i-th cell.
|
aggregate, aggregate, aggregate, assign, assign, assign, assign, assign, assign, assign, assign, cardinality, copy, equals, equals, get, getMaxLocation, getMinLocation, getNegativeValues, getNonZeros, getNonZeros, getPositiveValues, like, normalize, set, swap, toArray, toArray, toString, viewSelection, viewSorted, zDotProduct, zDotProduct, zDotProduct, zSum
checkSize, index, size, stride, toStringShort
ensureCapacity, isView, trimToSize
clone
public WrapperDoubleMatrix1D(DoubleMatrix1D newContent)
public double getQuick(int index)
DoubleMatrix1D
Provided with invalid parameters this method may return invalid objects without throwing any exception. You should only use this method when you are absolutely sure that the coordinate is within bounds. Precondition (unchecked): index<0 || index>=size().
getQuick
in class DoubleMatrix1D
index
- the index of the cell.public Object elements()
DoubleMatrix1D
elements
in class DoubleMatrix1D
public DoubleMatrix1D like(int size)
DoubleMatrix1D
like
in class DoubleMatrix1D
size
- the number of cell the matrix shall have.public DoubleMatrix2D like2D(int rows, int columns)
DoubleMatrix1D
like2D
in class DoubleMatrix1D
rows
- the number of rows the matrix shall have.columns
- the number of columns the matrix shall have.public DoubleMatrix2D reshape(int rows, int columns)
DoubleMatrix1D
reshape
in class DoubleMatrix1D
rows
- number of rowscolumns
- number of columnspublic DoubleMatrix3D reshape(int slices, int rows, int columns)
DoubleMatrix1D
reshape
in class DoubleMatrix1D
rows
- number of rowscolumns
- number of columnspublic void setQuick(int index, double value)
DoubleMatrix1D
Provided with invalid parameters this method may access illegal indexes without throwing any exception. You should only use this method when you are absolutely sure that the coordinate is within bounds. Precondition (unchecked): index<0 || index>=size().
setQuick
in class DoubleMatrix1D
index
- the index of the cell.value
- the value to be filled into the specified cell.public DoubleMatrix1D viewFlip()
DoubleMatrix1D
viewFlip
in class DoubleMatrix1D
public DoubleMatrix1D viewPart(int index, int width)
DoubleMatrix1D
Note that the view is really just a range restriction: The returned matrix is backed by this matrix, so changes in the returned matrix are reflected in this matrix, and vice-versa.
The view contains the cells from index..index+width-1. and has view.size() == width. A view's legal coordinates are again zero based, as usual. In other words, legal coordinates of the view are 0 .. view.size()-1==width-1. As usual, any attempt to access a cell at other coordinates will throw an IndexOutOfBoundsException.
viewPart
in class DoubleMatrix1D
index
- The index of the first cell.width
- The width of the range.public DoubleMatrix1D viewSelection(int[] indexes)
DoubleMatrix1D
Example:
this = (0,0,8,0,7) indexes = (0,2,4,2) --> view = (0,8,7,8)Note that modifying indexes after this call has returned has no effect on the view. The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa.
viewSelection
in class DoubleMatrix1D
indexes
- The indexes of the cells that shall be visible in the new
view. To indicate that all cells shall be visible,
simply set this parameter to null.public DoubleMatrix1D viewStrides(int _stride)
DoubleMatrix1D
viewStrides
in class DoubleMatrix1D
_stride
- the step factor.Jump to the Parallel Colt Homepage