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 TypeMethodDescriptionvoid
assign
(double value) assign.void
assign.copy()
copy.diag()
diag.double
dot.double
dotProduct
(Vector v2) dotProduct.boolean
double
get
(int i) get.like()
like.minus.plus.scalarMult
(double scalar) scalarMult.static Vector
Generates a simple exemplar of this class to test serialization.void
set
(int j, double v) set.int
size()
size.double[]
toArray()
toArray.toString()
toString.viewSelection
(int[] selection) viewSelection.
-
Constructor Details
-
Vector
public Vector(double[] data) Constructor for Vector.
- Parameters:
data
- an array ofdouble
objects
-
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
Vector
object
-
assign
public void assign(double value) assign.
- Parameters:
value
- a double
-
assign
assign.
- Parameters:
vector
- aVector
object
-
copy
copy.
- Returns:
- a
Vector
object
-
diag
diag.
- Returns:
- a
Matrix
object
-
dotProduct
dotProduct.
- Parameters:
v2
- aVector
object- Returns:
- a double
-
get
public double get(int i) get.
- Parameters:
i
- a int- Returns:
- a double
-
like
like.
- Returns:
- a
Vector
object
-
minus
minus.
-
plus
plus.
-
scalarMult
scalarMult.
- Parameters:
scalar
- a double- Returns:
- a
Vector
object
-
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
double
objects
-
toString
toString.
-
viewSelection
viewSelection.
- Parameters:
selection
- an array ofint
objects- Returns:
- a
Vector
object
-
equals
-
dot
dot.
- Parameters:
v2
- aVector
object- Returns:
- a double
-