Class VisualNumerics.math.DoubleVector
All Packages Class Hierarchy This Package Previous Next Index
Class VisualNumerics.math.DoubleVector
java.lang.Object
|
+----VisualNumerics.math.DoubleVector
- public final class DoubleVector
- extends Object
Double precision vector manipulation functions.
This class cannot be instantiated.
-
add(double, double[])
- Add a scalar to each element of the vector.
-
add(double[], double[])
-
Calculate the sum of two vectors, v1 + v2.
-
infinityNorm(double[])
-
Calculate the infinity norm of a vector.
-
innerProduct(double[], double[])
-
Calculate the dot product of two vectors.
-
multiply(double, double[])
-
Multiply a vector by a scalar.
-
multiply(double[], double[])
-
Calculate the product of corresponding elements in the input vectors.
-
oneNorm(double[])
- Calculate the one norm of a vector.
-
product(double[])
-
Calculate the product of the array elements.
-
subtract(double[], double[])
- Calculate the difference between corresponding elements of two vectors, v1 - v2.
-
sum(double[])
- Calculate the sum of the array elements.
-
twoNorm(double[])
- Calculate the Euclidean or two norm of a vector.
DoubleVector
public DoubleVector()
sum
public static double sum(double a[])
- Calculate the sum of the array elements.
- Parameters:
- a - A vector with elements of type double.
- Returns:
- A double value equal to the sum of the array elements.
product
public static double product(double a[])
- Calculate the product of the array elements.
- Parameters:
- a - A vector with elements of type double.
- Returns:
- A double value equal to the product of the array elements.
innerProduct
public static double innerProduct(double a[],
double b[])
- Calculate the dot product of two vectors.
- Parameters:
- a - A vector with elements of type double.
- b - A vector with elements of type double.
- Returns:
- A double value equal to the dot product of the two vectors.
oneNorm
public static double oneNorm(double a[])
- Calculate the one norm of a vector.
- Parameters:
- a - A vector with elements of type double.
- Returns:
- A double value equal to the sum of the absolute values
of the elements.
twoNorm
public static double twoNorm(double a[])
- Calculate the Euclidean or two norm of a vector.
- Parameters:
- a - A vector with elements of type double.
- Returns:
- A double value equal to its Euclidean norm.
infinityNorm
public static double infinityNorm(double a[])
- Calculate the infinity norm of a vector.
- Parameters:
- a - A vector with elements of type double.
- Returns:
- A double value equal to the maximum of the absolute
values of the elements of the array.
add
public static double[] add(double a,
double v[])
- Add a scalar to each element of the vector.
- Parameters:
- a - An input double scalar value.
- v - A vector with elements of type double.
- Returns:
- A double vector whose elements contain the sum of a and each element of v.
add
public static double[] add(double v1[],
double v2[])
- Calculate the sum of two vectors, v1 + v2.
- Parameters:
- v1 - A vector with elements of type double.
- v2 - A vector with elements of type double.
- Returns:
- A double vector containing the elementwise sum of the input vectors.
- Throws: IllegalArgumentException
- This exception is thrown when the input
vectors do not have the same length.
subtract
public static double[] subtract(double v1[],
double v2[])
- Calculate the difference between corresponding elements of two vectors, v1 - v2.
- Parameters:
- v1 - A vector with elements of type double.
- v2 - A vector with elements of type double.
- Returns:
- A double vector whose elements are differences between corresponding elements of the input vectors.
- Throws: IllegalArgumentException
- This exception is thrown when the input vectors
do not have the same length.
multiply
public static double[] multiply(double da,
double v[])
- Multiply a vector by a scalar.
- Parameters:
- da - An input double value used for scaling the elements of the vector.
- v - An input vector with elements of type double.
- Returns:
- A double vector where each component is a product of da and the corresponding element of the input vector.
multiply
public static double[] multiply(double v1[],
double v2[])
- Calculate the product of corresponding elements in the input vectors.
- Parameters:
- v1 - A vector with elements of type double.
- v2 - A vector with elements of type double.
- Returns:
- A double vector whose components are elementwise products of the input vectors.
- Throws: IllegalArgumentException
- This exception is thrown when the input
vectors do not have the same length.
All Packages Class Hierarchy This Package Previous Next Index