edu.harvard.syrah.pyxida.nc.lib
Class Vec

java.lang.Object
  extended by edu.harvard.syrah.pyxida.nc.lib.Vec

public class Vec
extends java.lang.Object


Field Summary
protected static int CLASS_HASH
           
protected  double[] direction
           
protected  int num_dims
           
 
Constructor Summary
Vec(double[] init_dir, boolean make_copy)
           
Vec(int _num_dims)
           
Vec(Vec v)
           
 
Method Summary
 void add(Vec v)
           
 Coordinate asCoordinateFromZero(boolean make_copy)
           
 boolean equals(java.lang.Object obj)
           
 double[] getComponents()
           
 double getLength()
           
 int getNumDimensions()
           
 int hashCode()
           
 boolean isUnit()
           
static Vec makeRandom(int num_dims, double axisLength)
           
 void makeUnit()
           
 void scale(double k)
           
static Vec scale(Vec lhs, double k)
           
 void subtract(Vec v)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_HASH

protected static final int CLASS_HASH

direction

protected final double[] direction

num_dims

protected final int num_dims
Constructor Detail

Vec

public Vec(int _num_dims)

Vec

public Vec(Vec v)

Vec

public Vec(double[] init_dir,
           boolean make_copy)
Method Detail

scale

public static Vec scale(Vec lhs,
                        double k)

makeRandom

public static Vec makeRandom(int num_dims,
                             double axisLength)

getNumDimensions

public int getNumDimensions()

getComponents

public double[] getComponents()

add

public void add(Vec v)

subtract

public void subtract(Vec v)

scale

public void scale(double k)

isUnit

public boolean isUnit()

getLength

public double getLength()

makeUnit

public void makeUnit()

asCoordinateFromZero

public Coordinate asCoordinateFromZero(boolean make_copy)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object