org.eclipse.january.dataset

## Class ComplexDoubleDataset

- java.lang.Object
- - org.eclipse.january.dataset.LazyDatasetBase
  - - org.eclipse.january.dataset.AbstractDataset
    - - org.eclipse.january.dataset.AbstractCompoundDataset
      - - org.eclipse.january.dataset.CompoundDoubleDataset
        - - org.eclipse.january.dataset.ComplexDoubleDataset

- All Implemented Interfaces:
    Serializable, CompoundDataset, Dataset, IDataset, ILazyDataset, IMetadataProvider, INameable

      public class ComplexDoubleDataset
      extends CompoundDoubleDataset

  Extend compound dataset to hold complex double values // PRIM_TYPE
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.january.dataset.CompoundDoubleDataset

      `data`

    - ### Fields inherited from class org.eclipse.january.dataset.AbstractCompoundDataset

      `isize`

    - ### Fields inherited from class org.eclipse.january.dataset.AbstractDataset

      `base, BLOCK_CLOSE, BLOCK_OPEN, odata, offset, size, stride, stringFormat`

    - ### Fields inherited from class org.eclipse.january.dataset.LazyDatasetBase

      `catchExceptions, logger, metadata, name, shape`

    - ### Fields inherited from interface org.eclipse.january.dataset.Dataset

      `ARRAYFLOAT32, ARRAYFLOAT64, ARRAYINT16, ARRAYINT32, ARRAYINT64, ARRAYINT8, ARRAYMUL, BOOL, COMPLEX, COMPLEX128, COMPLEX64, DATE, FLOAT, FLOAT32, FLOAT64, INT, INT16, INT32, INT64, INT8, OBJECT, RGB, STRING`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ComplexDoubleDataset` | `clone()` Clone dataset
    `ComplexDoubleDataset` | `fill(Object obj)` Fill dataset with given object
    `Complex` | `get()`
    `Complex` | `get(int... pos)`
    `Complex` | `get(int i)`
    `Complex` | `get(int i, int j)`
    `Complex` | `getComplex()`
    `Complex` | `getComplex(int... pos)`
    `Complex` | `getComplex(int i)`
    `Complex` | `getComplex(int i, int j)`
    `Complex` | `getComplexAbs(int index)` Get complex value at absolute index in the internal array.
    `int` | `getDType()`
    `double` | `getImag()`
    `double` | `getImag(int... pos)`
    `double` | `getImag(int i)`
    `double` | `getImag(int i, int j)`
    `DoubleDataset` | `getImaginaryPart()`
    `DoubleDataset` | `getImaginaryView()`
    `Object` | `getObject()` Get first item as an object.
    `Object` | `getObject(int... pos)`
    `Object` | `getObject(int i)` Get an item from given position as an object.
    `Object` | `getObject(int i, int j)` Get an item from given position as an object.
    `Object` | `getObjectAbs(int index)` Get an item from given absolute index as an object.
    `double` | `getReal()`
    `double` | `getReal(int... pos)`
    `double` | `getReal(int i)`
    `double` | `getReal(int i, int j)`
    `DoubleDataset` | `getRealPart()`
    `DoubleDataset` | `getRealView()`
    `ComplexDoubleDataset` | `getSlice(SliceIterator siter)` Get a slice of the dataset.
    `String` | `getStringAbs(int index)` Get an item from given absolute index as a string.
    `ComplexDoubleDataset` | `getView(boolean deepCopyMetadata)`
    `ComplexDoubleDataset` | `iadd(Object b)` In-place addition with object o
    `ComplexDoubleDataset` | `idivide(Object b)` In-place division with object o
    `ComplexDoubleDataset` | `imultiply(Object b)` In-place multiplication with object o
    `ComplexDoubleDataset` | `ipower(Object b)` In-place raise to power of object o
    `ComplexDoubleDataset` | `iremainder(Object b)` In-place remainder
    `ComplexDoubleDataset` | `isubtract(Object b)` In-place subtraction with object o
    `Number` | `max(boolean... switches)`
    `int[]` | `maxPos(boolean... switches)`
    `Object` | `mean(boolean... switches)`
    `Number` | `min(boolean... switches)`
    `int[]` | `minPos(boolean... switches)`
    `double` | `residual(Object b, Dataset w, boolean ignoreNaNs)` Calculate residual of dataset with object o and weight.
    `void` | `set(double dr, double di, int... pos)` Set real and imaginary values at given position
    `void` | `set(double dr, double di, int i)` Set real and imaginary values at given position
    `void` | `set(double dr, double di, int i, int j)` Set real and imaginary values at given position
    `void` | `set(Object obj, int... pos)` Set the value given by object at given position
    `void` | `set(Object obj, int i)` Set the value given by object at given position.
    `void` | `set(Object obj, int i, int j)` Set the value given by object at given position.
    `void` | `setAbs(int index, Complex val)` Set values at absolute index in the internal array.
    `void` | `setAbs(int index, double real, double imag)` Set item at index to complex value given by real and imaginary parts
    `void` | `setObjectAbs(int index, Object obj)` Set an item at absolute index from an object.
    `ComplexDoubleDataset` | `setSlice(Object o, IndexIterator siter)`
    `Object` | `sum(boolean... switches)`

    - ### Methods inherited from class org.eclipse.january.dataset.CompoundDoubleDataset

      `asNonCompoundDataset, containsInfs, containsInvalidNumbers, containsNans, copyElements, copyItemsFromAxes, createArray, createCompoundDatasetWithLastDimension, createFromObject, equals, fillDataset, getAbs, getAbs, getBufferLength, getByteArray, getByteArray, getByteArray, getByteArray, getData, getDoubleArray, getDoubleArray, getDoubleArray, getDoubleArray, getDoubleArrayAbs, getElementBooleanAbs, getElementDoubleAbs, getElementLongAbs, getElements, getElementsView, getFirstValue, getFirstValue, getFirstValue, getFirstValue, getFloatArray, getFloatArray, getFloatArray, getFloatArray, getIntArray, getIntArray, getIntArray, getIntArray, getLongArray, getLongArray, getLongArray, getLongArray, getShortArray, getShortArray, getShortArray, getShortArray, getString, getString, getString, getString, hashCode, ifloor, resize, set, setAbs, setAbs, setBy1DIndex, setByBoolean, setByIndexes, setData, setElements, setItem, setItem, setItem, setItem, setItemDirect, setItemsOnAxes`

    - ### Methods inherited from class org.eclipse.january.dataset.AbstractCompoundDataset

      `argMax, argMin, cast, cast, flatten, get1DIndex, get1DIndex, get1DIndexFromShape, getBoolean, getBoolean, getBoolean, getBoolean, getBroadcastView, getBy1DIndex, getByBoolean, getByIndexes, getByte, getByte, getByte, getByte, getCompoundStats, getDouble, getDouble, getDouble, getDouble, getDoubleArray, getDoubleArray, getDoubleArray, getDoubleArray, getElementsPerItem, getError, getError, getError, getErrorArray, getErrorArray, getErrorArray, getErrors, getFloat, getFloat, getFloat, getFloat, getInt, getInt, getInt, getInt, getIterator, getIterator, getLong, getLong, getLong, getLong, getShort, getShort, getShort, getShort, getSlice, getSlice, getSlice, getSlice, getSlice, getSlice, getSliceIterator, getSliceView, getSliceView, getSliceView, getTransposedView, getUniqueItems, ifloorDivide, max, maxItem, mean, min, minItem, peakToPeak, product, reshape, rootMeanSquare, rootMeanSquare, setSlice, setSlice, sort, squeeze, squeeze, squeezeEnds, stdDeviation, stdDeviation, sum, swapAxes, synchronizedCopy, transpose, variance, variance, variance`

    - ### Methods inherited from class org.eclipse.january.dataset.AbstractDataset

      `all, all, any, any, argMax, argMin, calcSteps, cast, checkAxis, checkAxis, checkCompatibility, copy, copy, copyToView, count, count, createStrides, createStrides, createStrides, createStrides, fillData, get1DIndex, get1DIndexFromShape, getBooleanIterator, getBooleanIterator, getBuffer, getElementClass, getError, getErrorBuffer, getFirst1DIndex, getIndices, getInternalSquaredError, getItemBytes, getIterator, getMaxLineLength, getMetadataMap, getName, getNbytes, getNDPosition, getOffset, getPositionIterator, getRank, getShape, getShapeRef, getSize, getSliceIterator, getSliceIteratorFromAxes, getStats, getStrides, getStringStats, hasFloatingPointElements, isCompatibleWith, isComplex, overrideInternal, peakToPeak, product, residual, residual, setDirty, setErrorBuffer, setMaxLineLength, setName, setShape, setSlice, setStringFormat, stdDeviation, stdDeviation, toString, toString, variance`

    - ### Methods inherited from class org.eclipse.january.dataset.LazyDatasetBase

      `addMetadata, checkPermutatedAxes, clearMetadata, copyMetadata, copyMetadata, createFromSerializable, dirtyMetadata, findMetadataTypeSubInterfaces, getErrorMetadata, getFirstMetadata, getMetadata, getMetadata, hasErrors, reshapeMetadata, restoreMetadata, setErrors, setMetadata, sliceMetadata, transposeMetadata`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.january.dataset.Dataset

      `all, all, any, any, argMax, argMin, cast, checkAxis, checkCompatibility, copy, copy, count, count, get1DIndex, getBooleanIterator, getBooleanIterator, getBuffer, getError, getErrorBuffer, getIndices, getIterator, getNbytes, getNDPosition, getOffset, getPositionIterator, getShapeRef, getSliceIterator, getSliceIteratorFromAxes, getStrides, hasFloatingPointElements, isCompatibleWith, isComplex, overrideInternal, peakToPeak, product, residual, residual, setDirty, setErrorBuffer, setSlice, stdDeviation, stdDeviation, toString, variance`

    - ### Methods inherited from interface org.eclipse.january.dataset.IDataset

      `getItemBytes, getMetadata, setStringFormat`

    - ### Methods inherited from interface org.eclipse.january.dataset.ILazyDataset

      `addMetadata, clearMetadata, getElementClass, getRank, getShape, getSize, hasErrors, setErrors, setMetadata, setShape`

    - ### Methods inherited from interface org.eclipse.january.dataset.IMetadataProvider

      `getFirstMetadata, getMetadata`

    - ### Methods inherited from interface org.eclipse.january.INameable

      `getName, setName`

- - ### Method Detail

    - #### getDType

          public int getDType()

      Specified by:
        `getDType` in interface `Dataset`
      Overrides:
        `getDType` in class `CompoundDoubleDataset`
      Returns:
        type of dataset item

    - #### clone

          public ComplexDoubleDataset clone()

      Description copied from interface: `ILazyDataset`
      Clone dataset
      Specified by:
        `clone` in interface `CompoundDataset`
      Specified by:
        `clone` in interface `Dataset`
      Specified by:
        `clone` in interface `IDataset`
      Specified by:
        `clone` in interface `ILazyDataset`
      Overrides:
        `clone` in class `CompoundDoubleDataset`
      Returns:
        a (shallow) copy of dataset

    - #### fill

          public ComplexDoubleDataset fill(Object obj)

      Description copied from interface: `Dataset`
      Fill dataset with given object
      Specified by:
        `fill` in interface `CompoundDataset`
      Specified by:
        `fill` in interface `Dataset`
      Overrides:
        `fill` in class `CompoundDoubleDataset`
      Returns:
        filled dataset with each item being equal to the given object

    - #### getView

          public ComplexDoubleDataset getView(boolean deepCopyMetadata)

      Specified by:
        `getView` in interface `CompoundDataset`
      Specified by:
        `getView` in interface `Dataset`
      Overrides:
        `getView` in class `CompoundDoubleDataset`
      Parameters:
        `deepCopyMetadata` - if true then deep-copy metadata
      Returns:
        whole view of dataset (i.e. data buffer is shared)

    - #### getComplexAbs

          public Complex getComplexAbs(int index)

      Get complex value at absolute index in the internal array. This is an internal method with no checks so can be dangerous. Use with care or ideally with an iterator.
      Parameters:
        `index` - absolute index
      Returns:
        value

    - #### getObjectAbs

          public Object getObjectAbs(int index)

      Description copied from interface: `Dataset`
      Get an item from given absolute index as an object. See warning in interface doc
      Specified by:
        `getObjectAbs` in interface `Dataset`
      Overrides:
        `getObjectAbs` in class `CompoundDoubleDataset`
      Returns:
        item

    - #### getStringAbs

          public String getStringAbs(int index)

      Description copied from interface: `Dataset`
      Get an item from given absolute index as a string. See warning in interface doc
      Specified by:
        `getStringAbs` in interface `Dataset`
      Overrides:
        `getStringAbs` in class `CompoundDoubleDataset`
      Returns:
        item

    - #### setAbs

          public void setAbs(int index,
                    Complex val)

      Set values at absolute index in the internal array. This is an internal method with no checks so can be dangerous. Use with care or ideally with an iterator.
      Parameters:
        `index` - absolute index
        `val` - new values

    - #### setObjectAbs

          public void setObjectAbs(int index,
                          Object obj)

      Description copied from interface: `Dataset`
      Set an item at absolute index from an object. See warning in interface doc
      Specified by:
        `setObjectAbs` in interface `Dataset`
      Overrides:
        `setObjectAbs` in class `CompoundDoubleDataset`

    - #### setAbs

          public void setAbs(int index,
                    double real,
                    double imag)

      Set item at index to complex value given by real and imaginary parts
      Parameters:
        `index` - absolute index
        `real` -
        `imag` -

    - #### get

          public Complex get()

      Returns:
        item in first position
      Since:
        2.0

    - #### get

          public Complex get(int i)

      Parameters:
        `i` -
      Returns:
        item in given position

    - #### get

          public Complex get(int i,
                    int j)

      Parameters:
        `i` -
        `j` -
      Returns:
        item in given position

    - #### get

          public Complex get(int... pos)

      Parameters:
        `pos` -
      Returns:
        item in given position

    - #### getObject

          public Object getObject()

      Description copied from interface: `Dataset`
      Get first item as an object. The dataset must not be null
      Specified by:
        `getObject` in interface `Dataset`
      Overrides:
        `getObject` in class `CompoundDoubleDataset`
      Returns:
        item

    - #### getObject

          public Object getObject(int i)

      Description copied from interface: `Dataset`
      Get an item from given position as an object. The dataset must be 1D
      Specified by:
        `getObject` in interface `Dataset`
      Overrides:
        `getObject` in class `CompoundDoubleDataset`
      Returns:
        item

    - #### getObject

          public Object getObject(int i,
                         int j)

      Description copied from interface: `Dataset`
      Get an item from given position as an object. The dataset must be 2D
      Specified by:
        `getObject` in interface `Dataset`
      Overrides:
        `getObject` in class `CompoundDoubleDataset`
      Returns:
        item

    - #### getObject

          public Object getObject(int... pos)

      Specified by:
        `getObject` in interface `IDataset`
      Overrides:
        `getObject` in class `CompoundDoubleDataset`
      Returns:
        Item in given position as an object

    - #### getReal

          public double getReal()

      Returns:
        item in first position
      Since:
        2.0

    - #### getReal

          public double getReal(int i)

      Parameters:
        `i` -
      Returns:
        item in given position

    - #### getReal

          public double getReal(int i,
                       int j)

      Parameters:
        `i` -
        `j` -
      Returns:
        item in given position

    - #### getReal

          public double getReal(int... pos)

      Parameters:
        `pos` -
      Returns:
        item in given position

    - #### getImag

          public double getImag()

      Returns:
        item in first position
      Since:
        2.0

    - #### getImag

          public double getImag(int i)

      Parameters:
        `i` -
      Returns:
        item in given position

    - #### getImag

          public double getImag(int i,
                       int j)

      Parameters:
        `i` -
        `j` -
      Returns:
        item in given position

    - #### getImag

          public double getImag(int... pos)

      Parameters:
        `pos` -
      Returns:
        item in given position

    - #### getComplex

          public Complex getComplex()

      Returns:
        item in first position
      Since:
        2.0

    - #### getComplex

          public Complex getComplex(int i)

      Parameters:
        `i` -
      Returns:
        item in given position

    - #### getComplex

          public Complex getComplex(int i,
                           int j)

      Parameters:
        `i` -
        `j` -
      Returns:
        item in given position

    - #### getComplex

          public Complex getComplex(int... pos)

      Parameters:
        `pos` -
      Returns:
        item in given position

    - #### set

          public void set(Object obj,
                 int i)

      Description copied from interface: `Dataset`
      Set the value given by object at given position. The dataset must be 1D
      Specified by:
        `set` in interface `Dataset`
      Overrides:
        `set` in class `CompoundDoubleDataset`

    - #### set

          public void set(Object obj,
                 int i,
                 int j)

      Description copied from interface: `Dataset`
      Set the value given by object at given position. The dataset must be 2D
      Specified by:
        `set` in interface `Dataset`
      Overrides:
        `set` in class `CompoundDoubleDataset`

    - #### set

          public void set(Object obj,
                 int... pos)

      Description copied from interface: `IDataset`
      Set the value given by object at given position
      Specified by:
        `set` in interface `IDataset`
      Overrides:
        `set` in class `CompoundDoubleDataset`

    - #### set

          public void set(double dr,
                 double di,
                 int i)

      Set real and imaginary values at given position
      Parameters:
        `dr` -
        `di` -
        `i` -

    - #### set

          public void set(double dr,
                 double di,
                 int i,
                 int j)

      Set real and imaginary values at given position
      Parameters:
        `dr` -
        `di` -
        `i` -
        `j` -

    - #### set

          public void set(double dr,
                 double di,
                 int... pos)

      Set real and imaginary values at given position
      Parameters:
        `dr` -
        `di` -
        `pos` -
      Since:
        2.0

    - #### getRealPart

          public DoubleDataset getRealPart()

      Specified by:
        `getRealPart` in interface `Dataset`
      Overrides:
        `getRealPart` in class `AbstractDataset`
      Returns:
        real part of dataset (if necessary, as new dataset)
      Since:
        2.0

    - #### getRealView

          public DoubleDataset getRealView()

      Specified by:
        `getRealView` in interface `Dataset`
      Overrides:
        `getRealView` in class `AbstractDataset`
      Returns:
        real part of dataset as a view
      Since:
        2.0

    - #### getImaginaryPart

          public DoubleDataset getImaginaryPart()

      Returns:
        imaginary part of dataset as new dataset
      Since:
        2.0

    - #### getImaginaryView

          public DoubleDataset getImaginaryView()

      Returns:
        view of imaginary values

    - #### max

          public Number max(boolean... switches)

      Specified by:
        `max` in interface `IDataset`
      Overrides:
        `max` in class `AbstractCompoundDataset`
      Parameters:
        `switches` - - Can be null, empty, or one or more booleans. By default, all booleans are false. If the first boolean is true, will ignore NaNs and ignore infinities. Use the second boolean to ignore infinities separately.
      Returns:
        Maximum value

    - #### min

          public Number min(boolean... switches)

      Specified by:
        `min` in interface `IDataset`
      Overrides:
        `min` in class `AbstractCompoundDataset`
      Parameters:
        `switches` - - see `IDataset.max(boolean...)`
      Returns:
        Minimum value

    - #### sum

          public Object sum(boolean... switches)

      Specified by:
        `sum` in interface `Dataset`
      Overrides:
        `sum` in class `AbstractCompoundDataset`
      Parameters:
        `switches` - - see `IDataset.max(boolean...)`
      Returns:
        sum over all items in dataset as a Double, array of doubles or a complex number

    - #### mean

          public Object mean(boolean... switches)

      Specified by:
        `mean` in interface `IDataset`
      Overrides:
        `mean` in class `AbstractCompoundDataset`
      Parameters:
        `switches` - - see `IDataset.max(boolean...)`
      Returns:
        mean of all items in dataset as a double, array of doubles or a complex number

    - #### maxPos

          public int[] maxPos(boolean... switches)

      Specified by:
        `maxPos` in interface `IDataset`
      Overrides:
        `maxPos` in class `AbstractCompoundDataset`
      Parameters:
        `switches` - - see `IDataset.max(boolean...)`
      Returns:
        Position of maximum value (or first position if there are more than one)

    - #### minPos

          public int[] minPos(boolean... switches)

      Specified by:
        `minPos` in interface `IDataset`
      Overrides:
        `minPos` in class `AbstractCompoundDataset`
      Parameters:
        `switches` - - see `IDataset.max(boolean...)`
      Returns:
        Position of minimum value (or first position if there are more than one)

    - #### getSlice

          public ComplexDoubleDataset getSlice(SliceIterator siter)

      Description copied from class: `AbstractDataset`
      Get a slice of the dataset. The returned dataset is a copied selection of items
      Overrides:
        `getSlice` in class `CompoundDoubleDataset`
      Parameters:
        `siter` - Slice iterator
      Returns:
        The dataset of the sliced data

    - #### setSlice

          public ComplexDoubleDataset setSlice(Object o,
                                      IndexIterator siter)

      Specified by:
        `setSlice` in interface `CompoundDataset`
      Specified by:
        `setSlice` in interface `Dataset`
      Overrides:
        `setSlice` in class `CompoundDoubleDataset`
      Parameters:
        `o` - specifies the object used to set the specified slice
        `siter` - specifies the slice iterator
      Returns:
        The dataset with the sliced set to object

    - #### iadd

          public ComplexDoubleDataset iadd(Object b)

      Description copied from interface: `Dataset`
      In-place addition with object o
      Specified by:
        `iadd` in interface `CompoundDataset`
      Specified by:
        `iadd` in interface `Dataset`
      Overrides:
        `iadd` in class `CompoundDoubleDataset`
      Returns:
        sum dataset

    - #### isubtract

          public ComplexDoubleDataset isubtract(Object b)

      Description copied from interface: `Dataset`
      In-place subtraction with object o
      Specified by:
        `isubtract` in interface `CompoundDataset`
      Specified by:
        `isubtract` in interface `Dataset`
      Overrides:
        `isubtract` in class `CompoundDoubleDataset`
      Returns:
        difference dataset

    - #### imultiply

          public ComplexDoubleDataset imultiply(Object b)

      Description copied from interface: `Dataset`
      In-place multiplication with object o
      Specified by:
        `imultiply` in interface `CompoundDataset`
      Specified by:
        `imultiply` in interface `Dataset`
      Overrides:
        `imultiply` in class `CompoundDoubleDataset`
      Returns:
        product dataset

    - #### idivide

          public ComplexDoubleDataset idivide(Object b)

      Description copied from interface: `Dataset`
      In-place division with object o
      Specified by:
        `idivide` in interface `CompoundDataset`
      Specified by:
        `idivide` in interface `Dataset`
      Overrides:
        `idivide` in class `CompoundDoubleDataset`
      Returns:
        dividend dataset

    - #### iremainder

          public ComplexDoubleDataset iremainder(Object b)

      Description copied from interface: `Dataset`
      In-place remainder
      Specified by:
        `iremainder` in interface `CompoundDataset`
      Specified by:
        `iremainder` in interface `Dataset`
      Overrides:
        `iremainder` in class `CompoundDoubleDataset`
      Returns:
        remaindered dataset

    - #### ipower

          public ComplexDoubleDataset ipower(Object b)

      Description copied from interface: `Dataset`
      In-place raise to power of object o
      Specified by:
        `ipower` in interface `CompoundDataset`
      Specified by:
        `ipower` in interface `Dataset`
      Overrides:
        `ipower` in class `CompoundDoubleDataset`
      Returns:
        raised dataset

    - #### residual

          public double residual(Object b,
                        Dataset w,
                        boolean ignoreNaNs)

      Description copied from interface: `Dataset`
      Calculate residual of dataset with object o and weight. The weight is used to multiply the squared differences
      Specified by:
        `residual` in interface `Dataset`
      Overrides:
        `residual` in class `CompoundDoubleDataset`
        `ignoreNaNs` - if true, skip NaNs
      Returns:
        sum of the squares of the differences

Copyright © 2017. All rights reserved.