public abstract class AbstractMatrix1D extends AbstractMatrix
int, double, etc.
First see the package summary and javadoc tree view to get the broad picture.
Note that this implementation is not synchronized.
| Modifier and Type | Field and Description |
|---|---|
protected int |
size
the number of cells this matrix (view) has
|
protected int |
stride
the number of indexes between any two elements, i.e.
|
protected int |
zero
the index of the first element
|
isNoViewserialVersionUID| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMatrix1D()
Makes this class non instantiable, but still let's others inherit from it.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
_offset(int absRank)
Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array.
|
protected int |
_rank(int rank)
Returns the absolute rank of the given relative rank.
|
protected void |
checkIndex(int index)
Sanity check for operations requiring an index to be within bounds.
|
protected void |
checkIndexes(int[] indexes)
Checks whether indexes are legal and throws an exception, if necessary.
|
protected void |
checkRange(int index,
int width)
Checks whether the receiver contains the given range and throws an exception, if necessary.
|
void |
checkSize(AbstractMatrix1D B)
Sanity check for operations requiring two matrices with the same size.
|
protected void |
checkSize(double[] B)
Sanity check for operations requiring two matrices with the same size.
|
protected int |
index(int rank)
Returns the position of the element with the given relative rank within the (virtual or non-virtual) internal 1-dimensional array.
|
protected void |
setUp(int size)
Sets up a matrix with a given number of cells.
|
protected void |
setUp(int size,
int zero,
int stride)
Sets up a matrix with the given parameters.
|
int |
size()
Returns the number of cells.
|
protected int |
stride(int dimension)
Returns the stride of the given dimension (axis, rank).
|
String |
toStringShort()
Returns a string representation of the receiver's shape.
|
protected AbstractMatrix1D |
vFlip()
Self modifying version of viewFlip().
|
protected AbstractMatrix1D |
vPart(int index,
int width)
Self modifying version of viewPart().
|
protected AbstractMatrix1D |
vStrides(int stride)
Self modifying version of viewStrides().
|
ensureCapacity, isView, trimToSizecloneprotected int size
protected int zero
protected int stride
protected AbstractMatrix1D()
protected int _offset(int absRank)
rank - the absolute rank of the element.protected int _rank(int rank)
rank - the relative rank of the element.protected void checkIndex(int index)
IndexOutOfBoundsException - if index < 0 || index >= size().protected void checkIndexes(int[] indexes)
IndexOutOfBoundsException - if ! (0 <= indexes[i] < size()) for any i=0..indexes.length()-1.protected void checkRange(int index,
int width)
IndexOutOfBoundsException - if index<0 || index+width>size().protected void checkSize(double[] B)
IllegalArgumentException - if size() != B.size().public void checkSize(AbstractMatrix1D B)
IllegalArgumentException - if size() != B.size().protected int index(int rank)
rank - the rank of the element.protected void setUp(int size)
size - the number of cells the matrix shall have.IllegalArgumentException - if size<0.protected void setUp(int size,
int zero,
int stride)
size - the number of elements the matrix shall have.zero - the index of the first element.stride - the number of indexes between any two elements, i.e. index(i+1)-index(i).IllegalArgumentException - if size<0.public int size()
size in class AbstractMatrixprotected int stride(int dimension)
IllegalArgumentException - if dimension != 0.public String toStringShort()
protected AbstractMatrix1D vFlip()
protected AbstractMatrix1D vPart(int index, int width)
IndexOutOfBoundsException - if index<0 || index+width>size().protected AbstractMatrix1D vStrides(int stride)
IndexOutOfBoundsException - if stride <= 0.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.