kao.math.matvec.Vector Class Reference
A multi-threaded Vector class.
More...
List of all members.
Detailed Description
A multi-threaded Vector class.
- Author:
- David Kao
Constructor & Destructor Documentation
kao.math.matvec.Vector.Vector |
( |
int |
n |
) |
|
Create a 0 index based Vector with the specified number of elements.
- Parameters:
-
[in] | n | Number of elements |
kao.math.matvec.Vector.Vector |
( |
int |
firstElement, |
|
|
int |
n | |
|
) |
| | |
Create a Vector with the specified number of elements with a specified start index.
- Parameters:
-
[in] | firstElement | First element of Vector |
[in] | n | Number of elements |
Member Function Documentation
Vector kao.math.matvec.Vector.abs |
( |
|
) |
|
Return the absolute Vector of this one
- Returns:
- Absolute Vector
Vector kao.math.matvec.Vector.add |
( |
double |
s |
) |
|
Scalar addition
- Parameters:
-
[in] | s | Scalar to add to this |
- Returns:
- Scalar addition
Vector kao.math.matvec.Vector.copy |
( |
int |
startIdx, |
|
|
int |
n | |
|
) |
| | |
Copy a subset of this Vector
- Parameters:
-
| startIdx | Index of first element to copy |
| n | Number of elements to copy |
- Returns:
- Subset of Vector
Vector kao.math.matvec.Vector.copy |
( |
|
) |
|
static Vector kao.math.matvec.Vector.data |
( |
double[] |
x |
) |
[static] |
Create a zero indexed Vector from an array
- Parameters:
-
- Returns:
- Vector of array
static Vector kao.math.matvec.Vector.data |
( |
int |
firstElement, |
|
|
double[] |
x | |
|
) |
| | [static] |
Create a Vector from an array with a specified index for the first element
- Parameters:
-
[in] | firstElement | Index of first element |
[in] | x | Data array |
- Returns:
- Vector of array
Vector kao.math.matvec.Vector.div |
( |
double |
s |
) |
|
Scalar division
- Parameters:
-
[in] | s | Scalar to divide from this |
- Returns:
- Scalar division
Vector element division
- Parameters:
-
[in] | x | Vector to divide from this |
- Returns:
- Vector element division
static Vector kao.math.matvec.Vector.empty |
( |
Vector |
v |
) |
[static] |
Create an empty Vector with same index of the first element as v
- Parameters:
-
- Returns:
- Empty Vector
double kao.math.matvec.Vector.get |
( |
int |
i |
) |
|
Get v(i)
- Parameters:
-
- Returns:
- Value of element i
double [] kao.math.matvec.Vector.getData |
( |
|
) |
|
int kao.math.matvec.Vector.getFirstElement |
( |
|
) |
|
Get first element index of Vector
- Returns:
- Index of first element
int kao.math.matvec.Vector.getLastElement |
( |
|
) |
|
Get last element index of Vector
- Returns:
- Index of last element
int kao.math.matvec.Vector.getLength |
( |
|
) |
|
Get length of Vector
- Returns:
- Length of vector
void kao.math.matvec.Vector.init |
( |
|
) |
|
double kao.math.matvec.Vector.innerProd |
( |
Vector |
x |
) |
|
Vector inner product
- Parameters:
-
[in] | x | Vector to take inner product with this |
- Returns:
- Vector inner product
boolean kao.math.matvec.Vector.isEmpty |
( |
|
) |
|
Does the Vector have zero length
- Returns:
- true/false
boolean kao.math.matvec.Vector.isSameDimension |
( |
Vector |
v |
) |
|
Does this Vector have the same dimensions as v
- Parameters:
-
- Returns:
- true/false
double kao.math.matvec.Vector.l2Norm |
( |
|
) |
|
Calculate the L2-norm (Euclidean) of the vector
- Returns:
- L2-norm
double [] kao.math.matvec.Vector.max |
( |
|
) |
|
Find the maximum of this Vector
- Returns:
- Maximum of this Vector.
- Index 0 is the max value
- Index 1 is the element index of the max value
double [] kao.math.matvec.Vector.min |
( |
|
) |
|
Find the minimum of this Vector
- Returns:
- Minimum of this Vector.
- Index 0 is the min value
- Index 1 is the element index of the min value
Vector kao.math.matvec.Vector.mult |
( |
double |
s |
) |
|
Scalar multiplication
- Parameters:
-
[in] | s | Scalar to multiply to this |
- Returns:
- Scalar multiplication
Vector element multiplication
- Parameters:
-
[in] | x | Vector to multiply to this |
- Returns:
- Vector element multiplication
Matrix kao.math.matvec.Vector.outerProd |
( |
Vector |
x, |
|
|
boolean |
sparse | |
|
) |
| | |
Vector outer product
- Parameters:
-
[in] | x | Vector to take outer product with this |
[in] | sparse | Is the resulting Matrix sparse |
- Returns:
- Vector outer product
void kao.math.matvec.Vector.print |
( |
String |
s |
) |
|
Print the Vector prefixed with identifier s
- Parameters:
-
static Vector kao.math.matvec.Vector.random |
( |
int |
firstElement, |
|
|
int |
n, |
|
|
double |
min, |
|
|
double |
max | |
|
) |
| | [static] |
Create a randomly initialised vector
- Parameters:
-
[in] | firstElement | Start index of vector |
[in] | n | Number of elements in vector |
[in] | min | Minimum value of random number |
[in] | max | Maximum value of random number |
Vector kao.math.matvec.Vector.resize |
( |
int |
n, |
|
|
boolean |
preserve | |
|
) |
| | |
Resize Vector to the specified number of elements. There is a flag to determine whether the data is preserved.
- Parameters:
-
[in] | n | Number of elements |
[in] | preserve | Preserve the vector data |
- Returns:
- Resized Vector
void kao.math.matvec.Vector.set |
( |
Vector |
v |
) |
|
Set this Vector to v
- Parameters:
-
void kao.math.matvec.Vector.set |
( |
int |
i, |
|
|
double |
e | |
|
) |
| | |
Set element v(i) with the value of e.
- Parameters:
-
[in] | i | Element i |
[in] | e | Element value |
void kao.math.matvec.Vector.setFirstElement |
( |
int |
firstElement |
) |
|
Set the first element index
- Parameters:
-
[in] | firstElement | Index of start element |
Vector kao.math.matvec.Vector.sub |
( |
double |
s |
) |
|
Scalar subtraction
- Parameters:
-
[in] | s | Scalar to subtract from this |
- Returns:
- Matrix subtraction
Vector subtraction
- Parameters:
-
[in] | x | Vector to subtract from this |
- Returns:
- Vector subtraction
double kao.math.matvec.Vector.sum |
( |
|
) |
|
Calculate the sum of all elements
- Returns:
- Sum of all elements
static Vector kao.math.matvec.Vector.zeros |
( |
Vector |
v |
) |
[static] |
Create a Matrix of zeros with same dimensions as v
- Parameters:
-
- Returns:
- Zero Vector