Package eu.simuline.octave.type
Class OctaveDouble
- java.lang.Object
-
- eu.simuline.octave.type.matrix.AbstractGenericMatrix<double[],it.unimi.dsi.fastutil.doubles.DoubleArrayList>
-
- eu.simuline.octave.type.OctaveDouble
-
- All Implemented Interfaces:
OctaveObject
public final class OctaveDouble extends AbstractGenericMatrix<double[],it.unimi.dsi.fastutil.doubles.DoubleArrayList>
Represents a matrix of doubles.
-
-
Field Summary
-
Fields inherited from class eu.simuline.octave.type.matrix.AbstractGenericMatrix
dataL, size
-
-
Constructor Summary
Constructors Modifier Constructor Description OctaveDouble(double[] data, int... size)Constructor that reuses the input data.OctaveDouble(int... size)Create new matrix.protectedOctaveDouble(OctaveDouble o)Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleget(int... pos)Get the value.protected double[]getDataA()Returns the data store as an array.StringgetPlainString(int pos)Returns the string representation of the given plain position.protected intinitL(double[] data, int size)protected it.unimi.dsi.fastutil.doubles.DoubleArrayListnewL(int size)Returns a new data store with given size and entries carrying the default value.voidset(double value, int... pos)Set the value resizing by need.voidsetPlain(double value, int pos)Set the value assuming resize is not necessary.voidsetPlain(String value, int pos)Sets the entry with plain positionposto value parsing the stringvalue.OctaveDoubleshallowCopy()Make a shallow copy of this object.OctaveDoublezero()-
Methods inherited from class eu.simuline.octave.type.matrix.AbstractGenericMatrix
dataSize, equals, getSize, getSizeLength, hashCode, main, pos2ind, resizeUp, toString
-
-
-
-
Constructor Detail
-
OctaveDouble
public OctaveDouble(int... size)
Create new matrix.- Parameters:
size-
-
OctaveDouble
public OctaveDouble(double[] data, int... size)Constructor that reuses the input data.- Parameters:
data-size-
-
OctaveDouble
protected OctaveDouble(OctaveDouble o)
Copy constructor.- Parameters:
o-
-
-
Method Detail
-
newL
protected final it.unimi.dsi.fastutil.doubles.DoubleArrayList newL(int size)
Description copied from class:AbstractGenericMatrixReturns 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:
newLin classAbstractGenericMatrix<double[],it.unimi.dsi.fastutil.doubles.DoubleArrayList>- Returns:
- new D[size]
-
initL
protected final int initL(double[] data, int size)- Specified by:
initLin classAbstractGenericMatrix<double[],it.unimi.dsi.fastutil.doubles.DoubleArrayList>
-
getDataA
protected double[] getDataA()
Description copied from class:AbstractGenericMatrixReturns the data store as an array. There are subclasses with array of primitive types.- Specified by:
getDataAin classAbstractGenericMatrix<double[],it.unimi.dsi.fastutil.doubles.DoubleArrayList>
-
set
public final void set(double value, int... pos)Set the value resizing by need.- Parameters:
value-pos-- See Also:
setPlain(double, int)
-
setPlain
public final void setPlain(double value, int pos)Set the value assuming resize is not necessary.- Parameters:
value-pos-- See Also:
set(double, int[])
-
setPlain
public final void setPlain(String value, int pos)
Description copied from class:AbstractGenericMatrixSets the entry with plain positionposto value parsing the stringvalue. Note that this base class cannot provide setter methods for java's primitive data types.- Specified by:
setPlainin classAbstractGenericMatrix<double[],it.unimi.dsi.fastutil.doubles.DoubleArrayList>pos- see e.g.AbstractObjectMatrix.setPlain(String, int)andsetPlain(String, int)
-
get
public final double get(int... pos)
Get the value.- Parameters:
pos-- Returns:
- value at pos
-
getPlainString
public final String getPlainString(int pos)
Description copied from class:AbstractGenericMatrixReturns the string representation of the given plain position.- Specified by:
getPlainStringin classAbstractGenericMatrix<double[],it.unimi.dsi.fastutil.doubles.DoubleArrayList>
-
zero
public OctaveDouble zero()
-
shallowCopy
public OctaveDouble shallowCopy()
Description copied from interface:OctaveObjectMake a shallow copy of this object. In general when anOctaveObjectis returned from a getter, e.g. onOctaveStructorOctaveStruct, a shallow copy is returned in order to follow the way octave behaves. This method is used to make that copy.- Specified by:
shallowCopyin interfaceOctaveObject- Specified by:
shallowCopyin classAbstractGenericMatrix<double[],it.unimi.dsi.fastutil.doubles.DoubleArrayList>- Returns:
- a shallow copy of this
-
-