public class Vector
extends Object
implements scala.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Vector.Multiplier |
static class |
Vector.VectorAccumParam$ |
Constructor and Description |
---|
Vector(double[] elements) |
Modifier and Type | Method and Description |
---|---|
Vector |
add(Vector other) |
Vector |
addInPlace(Vector other) |
double |
apply(int index) |
double |
dist(Vector other) |
Vector |
divide(double d) |
double |
dot(Vector other) |
static Vector.Multiplier |
doubleToMultiplier(double num) |
double[] |
elements() |
int |
length() |
Vector |
multiply(double d) |
static Vector |
ones(int length) |
double |
plusDot(Vector plus,
Vector other)
return (this + plus) dot other, but without creating any intermediate storage
|
static Vector |
random(int length,
scala.util.Random random)
Creates this
Vector of given length containing random numbers
between 0.0 and 1.0. |
double |
squaredDist(Vector other) |
Vector |
subtract(Vector other) |
double |
sum() |
String |
toString() |
static Vector |
zeros(int length) |
public static Vector zeros(int length)
public static Vector ones(int length)
public static Vector random(int length, scala.util.Random random)
Vector
of given length containing random numbers
between 0.0 and 1.0. Optional scala.util.Random number generator can be provided.public static Vector.Multiplier doubleToMultiplier(double num)
public double[] elements()
public int length()
public double apply(int index)
public double dot(Vector other)
public double plusDot(Vector plus, Vector other)
plus
- other
- public Vector multiply(double d)
public Vector divide(double d)
public double sum()
public double squaredDist(Vector other)
public double dist(Vector other)
public String toString()
toString
in class Object