vmm.pseudospherical
Class ComplexVector2D

java.lang.Object
  extended by vmm.pseudospherical.ComplexVector2D

public class ComplexVector2D
extends java.lang.Object

A 2D vector with components of type Complex named x, y.


Field Summary
 Complex x
          The first component of the vector.
 Complex y
          The second component of the vector.
 
Constructor Summary
ComplexVector2D()
          Construct a vector with all components initially equal to zero.
ComplexVector2D(Complex x, Complex y)
          Construct a vector that initially has coordinates (x,y).
ComplexVector2D(ComplexVector2D v)
          Construct a vector that is initially a copy of a specified vector.
 
Method Summary
 Complex dot(ComplexVector2D v)
          Returns the Hermitian inner-prodct of this vector and v.
 boolean equals(java.lang.Object obj)
          Returns true obj is a non-null object whose class in Vector2D and such that both coordinates of the vector obj are the same as the coordinates of this vector.
 ComplexVector2D minus(ComplexVector2D v)
          Returns the vector difference of this vector and v.
 void negate()
          Multiplies each component of this vector by -1.
 double norm2()
          Returns the norm square of the vector.
 ComplexVector2D plus(ComplexVector2D v)
          Returns the vector sum of this vector and v.
 ComplexVector2D times(Complex d)
          Returns the scalar product of this vector times d.
 java.lang.String toString()
          Returns a string representation of this vector of the form "(x,y)" where x, y are the numerical components of the vector.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public Complex x
The first component of the vector.


y

public Complex y
The second component of the vector.

Constructor Detail

ComplexVector2D

public ComplexVector2D()
Construct a vector with all components initially equal to zero.


ComplexVector2D

public ComplexVector2D(Complex x,
                       Complex y)
Construct a vector that initially has coordinates (x,y).


ComplexVector2D

public ComplexVector2D(ComplexVector2D v)
Construct a vector that is initially a copy of a specified vector.

Parameters:
v - the constructed vector is (v.x, v.y), or is (ZERO_C,ZERO_C) if v is null.
Method Detail

equals

public boolean equals(java.lang.Object obj)
Returns true obj is a non-null object whose class in Vector2D and such that both coordinates of the vector obj are the same as the coordinates of this vector.

Overrides:
equals in class java.lang.Object

negate

public void negate()
Multiplies each component of this vector by -1. This method modifies the vector.


plus

public ComplexVector2D plus(ComplexVector2D v)
Returns the vector sum of this vector and v. A new vector object is constructed to contain the result; neither input vector is modified.

Parameters:
v - a non-null vector

minus

public ComplexVector2D minus(ComplexVector2D v)
Returns the vector difference of this vector and v. A new vector object is constructed to contain the result; neither input vector is modified.

Parameters:
v - a non-null vector

dot

public Complex dot(ComplexVector2D v)
Returns the Hermitian inner-prodct of this vector and v.


times

public ComplexVector2D times(Complex d)
Returns the scalar product of this vector times d. A new vector object is constructed to contain the result; the vector is not modified.

Parameters:
d - the scalar that is to be multiplied times this vector

norm2

public double norm2()
Returns the norm square of the vector. The norm is calculated by sqrt(|x|^2+|y|^2)


toString

public java.lang.String toString()
Returns a string representation of this vector of the form "(x,y)" where x, y are the numerical components of the vector.

Overrides:
toString in class java.lang.Object