BasicMLComplexData
org.encog.ml.data.basic

Class BasicMLComplexData

  • All Implemented Interfaces:
    Cloneable, MLComplexData, MLData, CentroidFactory<MLData>


    public class BasicMLComplexDataextends Objectimplements MLComplexData
    This class implements a data object that can hold complex numbers. It implements the interface MLData, so it can be used with nearly any Encog machine learning method. However, not all Encog machine learning methods are designed to work with complex numbers. A Encog machine learning method that does not support complex numbers will only be dealing with the real-number portion of the complex number.
    • Constructor Detail

      • BasicMLComplexData

        public BasicMLComplexData(double[] d)
        Construct this object with the specified data. Use only real numbers.
        Parameters:
        d - The data to construct this object with.
      • BasicMLComplexData

        public BasicMLComplexData(ComplexNumber[] d)
        Construct this object with the specified data. Use complex numbers.
        Parameters:
        d - The data to construct this object with.
      • BasicMLComplexData

        public BasicMLComplexData(int size)
        Construct this object with blank data and a specified size.
        Parameters:
        size - The amount of data to store.
      • BasicMLComplexData

        public BasicMLComplexData(MLData d)
        Construct a new BasicMLData object from an existing one. This makes a copy of an array. If MLData is not complex, then only reals will be created.
        Parameters:
        d - The object to be copied.
    • Method Detail

      • add

        public void add(int index,       double value)
        Add a value to the specified index.
        Specified by:
        add in interface MLData
        Parameters:
        index - The index to add to.
        value - The value to add.
      • add

        public void add(int index,       ComplexNumber value)
        Add a complex number to the specified index.
        Specified by:
        add in interface MLComplexData
        Parameters:
        index - The index to use.
        value - The complex number value to add.
      • clear

        public void clear()
        Clear any data to zero.
        Specified by:
        clear in interface MLData
      • clone

        public MLData clone()
        Clone this object.
        Specified by:
        clone in interface MLData
        Overrides:
        clone in class Object
        Returns:
        A cloned version of this object.
      • getData

        public double[] getData()
        Specified by:
        getData in interface MLData
        Returns:
        All of the elements as an array.
      • getData

        public double getData(int index)
        Get the element specified index value.
        Specified by:
        getData in interface MLData
        Parameters:
        index - The index to read.
        Returns:
        The value at the specified inedx.
      • getComplexData

        public ComplexNumber getComplexData(int index)
        Get the complex data at the specified index.
        Specified by:
        getComplexData in interface MLComplexData
        Parameters:
        index - The index to get the complex data at.
        Returns:
        The complex data.
      • setData

        public void setData(double[] theData)
        Set all of the data as an array of doubles.
        Specified by:
        setData in interface MLData
        Parameters:
        theData - An array of doubles.
      • setData

        public void setData(int index,           double d)
        Set the data at the specified index. Note, this will only set the real part of the complex number.
        Specified by:
        setData in interface MLData
        Parameters:
        index - The index to to set.
        d - The numeric value to set.
      • setData

        public void setData(int index,           ComplexNumber d)
        Set a data element to a complex number.
        Specified by:
        setData in interface MLComplexData
        Parameters:
        index - The index to set.
        d - The complex number.
      • size

        public int size()
        Specified by:
        size in interface MLData
        Returns:
        How many elements are stored in this object.

SCaVis 1.7 © jWork.org