edu.rit.numeric

## Class SeriesComplex

- java.lang.Object
- edu.rit.numeric.SeriesComplex

public abstract class SeriesComplexextends Object

Class SeriesComplex is the abstract base class for a series of complex values (type`double`).

### Constructor Summary

Constructors Constructor and Description **SeriesComplex**()Construct a new complex series.

### Method Summary

Methods Modifier and Type Method and Description `abstract double`

**imag**(int i)Returns the imaginary part of the given complex value in this series.`Series`

**imagSeries**()Returns a new series consisting of the imaginary parts of the complex values in this series.`boolean`

**isEmpty**()Determine if this series is empty.`abstract int`

**length**()Returns the number of values in this series.`double`

**magnitude**(int i)Returns the magnitude of the given complex value in this series.`Series`

**magnitudeSeries**()Returns a new series consisting of the magnitudes of the complex values in this series.`double`

**phase**(int i)Returns the phase of the given complex value in this series.`Series`

**phaseSeries**()Returns a new series consisting of the phases of the complex values in this series.`void`

**print**()Print this complex series on the standard output.`void`

**print**(PrintStream theStream)Print this complex series on the given print stream.`void`

**print**(PrintWriter theWriter)Print this complex series on the given print writer.`abstract double`

**real**(int i)Returns the real part of the given complex value in this series.`Series`

**realSeries**()Returns a new series consisting of the real parts of the complex values in this series.`double`

**squaredMagnitude**(int i)Returns the squared magnitude of the given complex value in this series.`Series`

**squaredMagnitudeSeries**()Returns a new series consisting of the squared magnitudes of the complex values in this series.

### Method Detail

#### length

public abstract int length()

Returns the number of values in this series.

#### isEmpty

public boolean isEmpty()

Determine if this series is empty.- Returns:
- True if this series is empty (length = 0), false otherwise.

#### real

public abstract double real(int i)

Returns the real part of the given complex value in this series.- Parameters:
`i`

- Index.- Returns:
- The real part of the complex value in this series at index
`i`. - Throws:
`ArrayIndexOutOfBoundsException`

- (unchecked exception) Thrown if`i`is not in the range`0`..`length()-1`.

#### imag

public abstract double imag(int i)

Returns the imaginary part of the given complex value in this series.- Parameters:
`i`

- Index.- Returns:
- The imaginary part of the complex value in this series at index
`i`. - Throws:
`ArrayIndexOutOfBoundsException`

- (unchecked exception) Thrown if`i`is not in the range`0`..`length()-1`.

#### magnitude

public double magnitude(int i)

Returns the magnitude of the given complex value in this series. The magnitude is greater than or equal to 0.- Parameters:
`i`

- Index.- Returns:
- The magnitude of the complex value in this series at index
`i`. - Throws:
`ArrayIndexOutOfBoundsException`

- (unchecked exception) Thrown if`i`is not in the range`0`..`length()-1`.

#### squaredMagnitude

public double squaredMagnitude(int i)

Returns the squared magnitude of the given complex value in this series.- Parameters:
`i`

- Index.- Returns:
- The squared magnitude of the complex value in this series at index
`i`. - Throws:
`ArrayIndexOutOfBoundsException`

- (unchecked exception) Thrown if`i`is not in the range`0`..`length()-1`.

#### phase

public double phase(int i)

Returns the phase of the given complex value in this series. The phase is in the range -pi to +pi.- Parameters:
`i`

- Index.- Returns:
- The phase of the complex value in this series at index
`i`. - Throws:
`ArrayIndexOutOfBoundsException`

- (unchecked exception) Thrown if`i`is not in the range`0`..`length()-1`.

#### realSeries

public Series realSeries()

Returns a new series consisting of the real parts of the complex values in this series.- Returns:
- Series of real parts.

#### imagSeries

public Series imagSeries()

Returns a new series consisting of the imaginary parts of the complex values in this series.- Returns:
- Series of imaginary parts.

#### magnitudeSeries

public Series magnitudeSeries()

Returns a new series consisting of the magnitudes of the complex values in this series. Each magnitude is greater than or equal to 0.- Returns:
- Series of magnitudes.

#### squaredMagnitudeSeries

public Series squaredMagnitudeSeries()

Returns a new series consisting of the squared magnitudes of the complex values in this series.- Returns:
- Series of squared magnitudes.

#### phaseSeries

public Series phaseSeries()

Returns a new series consisting of the phases of the complex values in this series. Each phase is in the range -pi to +pi.- Returns:
- Series of phases.

#### print

public void print()

Print this complex series on the standard output. Each line of output consists of the index, the value's real part, the value's imaginary part, the value's magnitude, and the value's phase, separated by tabs.

#### print

public void print(PrintStream theStream)

Print this complex series on the given print stream. Each line of output consists of the index, the value's real part, the value's imaginary part, the value's magnitude, and the value's phase, separated by tabs.- Parameters:
`theStream`

- Print stream.

#### print

public void print(PrintWriter theWriter)

Print this complex series on the given print writer. Each line of output consists of the index, the value's real part, the value's imaginary part, the value's magnitude, and the value's phase, separated by tabs.- Parameters:
`theWriter`

- Print writer.

**SCaVis 2.0 © jWork.ORG**