drasys.or.matrix.complex
Interface VectorI

All Known Subinterfaces:
ContiguousVectorI, SizableVectorI
All Known Implementing Classes:
Vect

public interface VectorI
extends ComplexContainerI

Abstract interface to a generic vector.


Method Summary
 Complex elementAt(int index)
          Gets the value of an element by its index.
 Complex elementAt(int index, Complex results)
          Gets the value of an element by its index.
 java.util.Enumeration elements()
          Returns an enumeration of the non-null elements in the vector.
 boolean equals(VectorI vector)
          Returns true if the vectors are numerically equal.
 double[] getArray()
          Returns a new array containing the values in vector.
 boolean isNull(int index)
          Returns true if an element has no value associated with it.
 void setElementAt(int index, ComplexI value)
          Sets the value of an element by its index.
 void setElements(ComplexI value)
          Sets the value of all the non-null elements.
 void setElements(VectorI values)
          Sets the value of the elements from the non-null values in 'values'.
 int size()
          Returns the number of elements in the vector.
 int sizeOfElements()
          Returns the number of non-null elements in the vector.
 Complex sum()
          Returns the sum of the elements in the vector.
 Complex sum(int begin)
          Returns the sum of the elements in the subvector.
 Complex sum(int begin, int end)
          Returns the sum of the elements in the subvector.
 Complex sumOfSquaredDifferences(ComplexI scaler)
          Returns the sum the squared differences between 'scaler' and the elements in the vector.
 Complex sumOfSquaredDifferences(int begin, ComplexI scaler)
          Returns the sum the squared differences between 'scaler' and the elements in the subvector.
 Complex sumOfSquaredDifferences(int begin, int end, ComplexI scaler)
          Returns the sum the squared differences between 'scaler' and the selected elements in the subvector.
 Complex sumOfSquares()
          Returns the sum of the squares of the elements in the vector.
 Complex sumOfSquares(int begin)
          Returns the sum of the squares of the elements in the subvector.
 Complex sumOfSquares(int begin, int end)
          Returns the sum of the squares of the selected elements in the subvector.
 
Methods inherited from interface drasys.or.matrix.complex.ComplexContainerI
equals, getEpsilon, setEpsilon
 

Method Detail

isNull

public boolean isNull(int index)
Returns true if an element has no value associated with it. Elements which have no value assigned return 0.0 when accessed.

size

public int size()
Returns the number of elements in the vector.

sizeOfElements

public int sizeOfElements()
Returns the number of non-null elements in the vector.

getArray

public double[] getArray()
Returns a new array containing the values in vector. Each complex element occupies two adjacent array positions, the real component has an even index and the imaginary component has the next higher index.
EG: complex[0] = (array[0],array[1])

setElementAt

public void setElementAt(int index,
                         ComplexI value)
Sets the value of an element by its index.

setElements

public void setElements(ComplexI value)
Sets the value of all the non-null elements.

setElements

public void setElements(VectorI values)
Sets the value of the elements from the non-null values in 'values'. Elements corresponding to null elements in 'values' are not changed.

elementAt

public Complex elementAt(int index)
Gets the value of an element by its index.
Returns:
null if the element is null.

elementAt

public Complex elementAt(int index,
                         Complex results)
Gets the value of an element by its index. The argument 'results' is used to hold the returned result. If 'results' is null then a new object is returned.
Returns:
null if the element is null.

elements

public java.util.Enumeration elements()
Returns an enumeration of the non-null elements in the vector. The Enumeration is free to reuse the same object for each call to 'nextElement', so the contents must be use before getting another element.
Returns:
an enumeration whose elements are mutable and of type 'MatrixElementI'

sum

public Complex sum()
Returns the sum of the elements in the vector.

sum

public Complex sum(int begin)
Returns the sum of the elements in the subvector.

sum

public Complex sum(int begin,
                   int end)
Returns the sum of the elements in the subvector.

sumOfSquares

public Complex sumOfSquares()
Returns the sum of the squares of the elements in the vector.

sumOfSquares

public Complex sumOfSquares(int begin)
Returns the sum of the squares of the elements in the subvector.

sumOfSquares

public Complex sumOfSquares(int begin,
                            int end)
Returns the sum of the squares of the selected elements in the subvector.

sumOfSquaredDifferences

public Complex sumOfSquaredDifferences(ComplexI scaler)
Returns the sum the squared differences between 'scaler' and the elements in the vector.

sumOfSquaredDifferences

public Complex sumOfSquaredDifferences(int begin,
                                       ComplexI scaler)
Returns the sum the squared differences between 'scaler' and the elements in the subvector.

sumOfSquaredDifferences

public Complex sumOfSquaredDifferences(int begin,
                                       int end,
                                       ComplexI scaler)
Returns the sum the squared differences between 'scaler' and the selected elements in the subvector.

equals

public boolean equals(VectorI vector)
Returns true if the vectors are numerically equal. To be numerically equal the vectors must be the same size and all the elements must be equal to within this vector's 'epsilon'. All null elements have a value of zero for the compare.


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com