D - an array type, partially of primitive element typeL - a list corresponding with the array of type Dpublic abstract class AbstractGenericMatrix<D,L extends List<?>> extends Object implements OctaveObject
| Modifier and Type | Field and Description |
|---|---|
protected L |
dataL
The data, vectorized.
|
private static int |
PRIME |
protected int[] |
size
The dimensions, rows x columns x depth x ....
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractGenericMatrix(AbstractGenericMatrix<D,L> o)
Copy constructor.
|
protected |
AbstractGenericMatrix(D dataA,
int... size)
Constructor that reuses data in the new object.
|
protected |
AbstractGenericMatrix(int... size)
Constructor that creates new blank matrix.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
checkDataSize(int dataLength)
Check that the overall size given by the product of
size
does not exceed the length of the backed array. |
private void |
checkSize()
Checks the field
size: dimension at lest two
and each entry non-negative. |
int |
dataSize()
The number of data entries.
|
boolean |
equals(Object obj) |
protected abstract D |
getDataA()
Returns the data store as an array.
|
abstract String |
getPlainString(int pos)
Returns the string representation of the given plain position.
|
int |
getSize(int i) |
int |
getSizeLength() |
int |
hashCode() |
protected abstract int |
initL(D data,
int size) |
static void |
main(String[] args) |
protected abstract L |
newL(int size)
Returns a new data store with given size
and entries carrying the default value.
|
int |
pos2ind(int... pos) |
private static int |
product(int... ns) |
void |
resizeUp(int... pos)
Resize matrix up to include pos if necessary,
i.e. if an entry of
pos is greater
than the according entry in size. |
abstract void |
setPlain(String value,
int pos)
Sets the entry with plain position
pos
to value parsing the string value. |
abstract OctaveObject |
shallowCopy()
Make a shallow copy of this object.
|
private static final int PRIME
protected final int[] size
protected AbstractGenericMatrix(int... size)
size - protected AbstractGenericMatrix(D dataA, int... size)
dataA - data as an arraysize - must have at least two dimensionsprotected AbstractGenericMatrix(AbstractGenericMatrix<D,L> o)
o - private void checkSize()
throws IllegalArgumentException
size: dimension at lest two
and each entry non-negative.IllegalArgumentExceptionprivate void checkDataSize(int dataLength)
size
does not exceed the length of the backed array.protected abstract L newL(int size)
size - protected abstract int initL(D data, int size)
public final int dataSize()
protected abstract D getDataA()
public abstract void setPlain(String value, int pos)
pos
to value parsing the string value.
Note that this base class cannot provide setter methods
for java's primitive data types.value - pos - see e.g. AbstractObjectMatrix.setPlain(String, int)
and OctaveDouble.setPlain(String, int)private static int product(int... ns)
ns - public final void resizeUp(int... pos)
pos is greater
than the according entry in size.pos - an index vector with same dimension as sizeUnsupportedOperationException - if pos has dimension other than that of size.public final int pos2ind(int... pos)
pos - public abstract String getPlainString(int pos)
public final int getSizeLength()
public final int getSize(int i)
i - dimension number in 1 based numbering, 1=row, 2=columnpublic abstract OctaveObject shallowCopy()
OctaveObjectOctaveObject is returned from a getter,
e.g. on OctaveStruct or OctaveStruct,
a shallow copy is returned in order to follow the way octave behaves.
This method is used to make that copy.shallowCopy in interface OctaveObjectpublic static void main(String[] args)
Copyright © 2006–2018 Simuline Organization (l2r). All rights reserved.