|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dolben.iiid.Rn
public class Rn
These are collected functions on generic vectors and matrices.
A scalar is represented by a double. (gratuitous comment;-)
A vector is represented by a one dimensional array of doubles.
A matrix is represented by a two dimensional array of doubles where the row is indexed first.
None of these functions modify their arguments. A returned vector or matrix result is a new array.
Constructor Summary | |
---|---|
Rn()
|
Method Summary | |
---|---|
static double[] |
add(double[] u,
double[] v)
Adds two vectors |
static double |
angle(double[] u,
double[] v)
Computes the angle between two vectors |
static double |
dot(double[] u,
double[] v)
Computes the dot product of two vectors |
static double |
magnitude(double[] v)
Computes the magnitude of a vector |
static double[] |
multiply(double[][] a,
double[] v)
Multiplies a vector by a matrix |
static double[][] |
multiply(double[][] b,
double[][] a)
Multiplies two matrices |
static double[] |
multiply(double s,
double[] v)
Multiplies a vector by a scalar |
static double[] |
subtract(double[] u,
double[] v)
Subtracts one vector from another |
static double[][] |
transpose(double[][] a)
Transposes a matrix |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Rn()
Method Detail |
---|
public static double[] multiply(double s, double[] v)
s
- a scalarv
- a vector
public static double dot(double[] u, double[] v)
u
- one vectorv
- another vector
public static double magnitude(double[] v)
v
- a vector
public static double angle(double[] u, double[] v)
u
- one vectorv
- another vector
public static double[] add(double[] u, double[] v)
u
- one vectorv
- another vector
public static double[] subtract(double[] u, double[] v)
u
- another vectorv
- one vector
public static double[] multiply(double[][] a, double[] v)
a
- the matrixv
- the vector
public static double[][] multiply(double[][] b, double[][] a)
b
- one matrixa
- another matrix
public static double[][] transpose(double[][] a)
a
- a matrix
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |