Package eu.simuline.octave.type
Class OctaveLong
- java.lang.Object
-
- eu.simuline.octave.type.matrix.AbstractGenericMatrix<long[],it.unimi.dsi.fastutil.longs.LongArrayList>
-
- eu.simuline.octave.type.OctaveLong
-
- All Implemented Interfaces:
OctaveObject
public final class OctaveLong extends AbstractGenericMatrix<long[],it.unimi.dsi.fastutil.longs.LongArrayList>
Represents a matrix of ints.
-
-
Field Summary
-
Fields inherited from class eu.simuline.octave.type.matrix.AbstractGenericMatrix
dataL, size
-
-
Constructor Summary
Constructors Constructor Description OctaveLong(int... size)
Create new matrix.OctaveLong(long[] data, int... size)
Constructor that reuses the input data.OctaveLong(OctaveLong o)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
get(int... pos)
Get the value.protected long[]
getDataA()
Returns the data store as an array.String
getPlainString(int pos)
Returns the string representation of the given plain position.protected int
initL(long[] data, int size)
protected it.unimi.dsi.fastutil.longs.LongArrayList
newL(int size)
Returns a new data store with given size and entries carrying the default value.void
set(long value, int... pos)
Set the value resizing by need.void
setPlain(long value, int pos)
Set the value assuming resize is not necessary.void
setPlain(String value, int pos)
Sets the entry with plain positionpos
to value parsing the stringvalue
.OctaveLong
shallowCopy()
Make a shallow copy of this object.-
Methods inherited from class eu.simuline.octave.type.matrix.AbstractGenericMatrix
dataSize, equals, getSize, getSizeLength, hashCode, main, pos2ind, resizeUp, toString
-
-
-
-
Constructor Detail
-
OctaveLong
public OctaveLong(int... size)
Create new matrix.- Parameters:
size
-
-
OctaveLong
public OctaveLong(long[] data, int... size)
Constructor that reuses the input data.- Parameters:
data
-size
-
-
OctaveLong
public OctaveLong(OctaveLong o)
Copy constructor.- Parameters:
o
-
-
-
Method Detail
-
newL
protected final it.unimi.dsi.fastutil.longs.LongArrayList newL(int size)
Description copied from class:AbstractGenericMatrix
Returns a new data store with given size and entries carrying the default value. The latter depends on the types: false for boolean, 0 for int, 0.0 for double and null for GenericMatrix's.- Specified by:
newL
in classAbstractGenericMatrix<long[],it.unimi.dsi.fastutil.longs.LongArrayList>
- Returns:
- new D[size]
-
initL
protected final int initL(long[] data, int size)
- Specified by:
initL
in classAbstractGenericMatrix<long[],it.unimi.dsi.fastutil.longs.LongArrayList>
-
getDataA
protected long[] getDataA()
Description copied from class:AbstractGenericMatrix
Returns the data store as an array. There are subclasses with array of primitive types.- Specified by:
getDataA
in classAbstractGenericMatrix<long[],it.unimi.dsi.fastutil.longs.LongArrayList>
-
set
public final void set(long value, int... pos)
Set the value resizing by need.- Parameters:
value
-pos
-- See Also:
setPlain(long, int)
-
setPlain
public final void setPlain(long value, int pos)
Set the value assuming resize is not necessary.- Parameters:
value
-pos
-- See Also:
set(long, int[])
-
setPlain
public final void setPlain(String value, int pos)
Description copied from class:AbstractGenericMatrix
Sets the entry with plain positionpos
to value parsing the stringvalue
. Note that this base class cannot provide setter methods for java's primitive data types.- Specified by:
setPlain
in classAbstractGenericMatrix<long[],it.unimi.dsi.fastutil.longs.LongArrayList>
pos
- see e.g.AbstractObjectMatrix.setPlain(String, int)
andOctaveDouble.setPlain(String, int)
-
get
public final long get(int... pos)
Get the value.- Parameters:
pos
-- Returns:
- value at pos
-
getPlainString
public final String getPlainString(int pos)
Description copied from class:AbstractGenericMatrix
Returns the string representation of the given plain position.- Specified by:
getPlainString
in classAbstractGenericMatrix<long[],it.unimi.dsi.fastutil.longs.LongArrayList>
-
shallowCopy
public OctaveLong shallowCopy()
Description copied from interface:OctaveObject
Make a shallow copy of this object. In general when anOctaveObject
is returned from a getter, e.g. onOctaveStruct
orOctaveStruct
, a shallow copy is returned in order to follow the way octave behaves. This method is used to make that copy.- Specified by:
shallowCopy
in interfaceOctaveObject
- Specified by:
shallowCopy
in classAbstractGenericMatrix<long[],it.unimi.dsi.fastutil.longs.LongArrayList>
- Returns:
- a shallow copy of this
-
-