Class ArrayFunctions
The free functions of QuantLib's array.hpp over a Vector: the dot product, the norm, and the
element-by-element mathematical functions, each returning a new vector.
public static class ArrayFunctions
- Inheritance
-
ArrayFunctions
- Inherited Members
Remarks
QuantLib's free swap and operator<< are Swap(Vector) and
ToString().
Methods
Abs(Vector)
The absolute value of each element.
public static Vector Abs(Vector v)
Parameters
vVectorThe vector.
Returns
- Vector
A new vector.
DotProduct(Vector, Vector)
The dot product, summed in order from zero.
public static double DotProduct(Vector v1, Vector v2)
Parameters
Returns
- double
The sum of the element-by-element products.
Exceptions
- ArgumentException
The sizes differ.
Exp(Vector)
The exponential of each element.
public static Vector Exp(Vector v)
Parameters
vVectorThe vector.
Returns
- Vector
A new vector.
Log(Vector)
The natural logarithm of each element.
public static Vector Log(Vector v)
Parameters
vVectorThe vector.
Returns
- Vector
A new vector.
Norm2(Vector)
The Euclidean norm, the square root of the vector's dot product with itself.
public static double Norm2(Vector v)
Parameters
vVectorThe vector.
Returns
- double
The norm.
Pow(Vector, double)
Each element raised to a power.
public static Vector Pow(Vector v, double alpha)
Parameters
Returns
- Vector
A new vector.
Sqrt(Vector)
The square root of each element.
public static Vector Sqrt(Vector v)
Parameters
vVectorThe vector.
Returns
- Vector
A new vector.