Package edu.cmu.tetrad.util
Class Vector
java.lang.Object
edu.cmu.tetrad.util.Vector
- All Implemented Interfaces:
TetradSerializable,Serializable
Vector wrapping matrix library.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassign(double value) assign.voidassign.copy()copy.diag()diag.doubledot.doubledotProduct(Vector v2) dotProduct.booleandoubleget(int i) get.like()like.minus.plus.scalarMult(double scalar) scalarMult.static VectorGenerates a simple exemplar of this class to test serialization.voidset(int j, double v) set.intsize()size.double[]toArray()toArray.toString()toString.viewSelection(int[] selection) viewSelection.
-
Constructor Details
-
Vector
public Vector(double[] data) Constructor for Vector.
- Parameters:
data- an array ofdoubleobjects
-
Vector
public Vector(int size) Constructor for Vector.
- Parameters:
size- a int
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
Vectorobject
-
assign
public void assign(double value) assign.
- Parameters:
value- a double
-
assign
assign.
- Parameters:
vector- aVectorobject
-
copy
copy.
- Returns:
- a
Vectorobject
-
diag
diag.
- Returns:
- a
Matrixobject
-
dotProduct
dotProduct.
- Parameters:
v2- aVectorobject- Returns:
- a double
-
get
public double get(int i) get.
- Parameters:
i- a int- Returns:
- a double
-
like
like.
- Returns:
- a
Vectorobject
-
minus
minus.
-
plus
plus.
-
scalarMult
scalarMult.
- Parameters:
scalar- a double- Returns:
- a
Vectorobject
-
set
public void set(int j, double v) set.
- Parameters:
j- a intv- a double
-
size
public int size()size.
- Returns:
- a int
-
toArray
public double[] toArray()toArray.
- Returns:
- an array of
doubleobjects
-
toString
toString.
-
viewSelection
viewSelection.
- Parameters:
selection- an array ofintobjects- Returns:
- a
Vectorobject
-
equals
-
dot
dot.
- Parameters:
v2- aVectorobject- Returns:
- a double
-