public final class PVector extends Object
| Modifier and Type | Field and Description |
|---|---|
double[] |
array |
| Constructor and Description |
|---|
PVector(int dim)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
PVector |
clone()
Creates and returns a copy of the instance.
|
double |
dot(PVector v2) |
static boolean |
equals(PVector v1,
PVector v2)
Verifies if two vectors are similar.
|
int |
getDimension()
Returns vector's dimension.
|
PVector |
minus(PVector v2) |
double |
norm2()
Computes the Euclidean norm of the current vector \f$ v \f$.
|
PVector |
plus(PVector v2) |
static PVector |
sampleRandomDistribution(int dim)
Generates of a random vector \f$ v = (x_1, x_2, \cdots )\f$ where each component is drawn
uniformly in \f$ \mathcal{U}(0,1)\f$.
|
static PVector |
sampleRandomVector(int dim)
Generates of a random vector \f$ v = (x_1, x_2, \cdots )\f$ where each component is drawn
uniformly in \f$ \mathcal{U}(0,1)\f$.
|
PVector |
times(double lambda) |
String |
toString() |
public PVector(int dim)
dim - dimension of the vectorpublic PVector times(double lambda)
public double dot(PVector v2)
public static PVector sampleRandomVector(int dim)
dim - dimension of the vectorpublic static PVector sampleRandomDistribution(int dim)
dim - dimension of the vectorpublic static boolean equals(PVector v1, PVector v2)
v1 - vector \f$ v_1 \f$v2 - vector \f$ v_2 \f$public double norm2()
public PVector clone()
public int getDimension()
Copyright © 2015. All rights reserved.