| NMathFunctionsDot(DoubleSparseVector, DoubleVector) Method |
Calculates the dot product of a sparse vector and a dense vector.
Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntax public static double Dot(
DoubleSparseVector w,
DoubleVector v
)
Public Shared Function Dot (
w As DoubleSparseVector,
v As DoubleVector
) As Double
public:
static double Dot(
DoubleSparseVector^ w,
DoubleVector^ v
)
static member Dot :
w : DoubleSparseVector *
v : DoubleVector -> float
Parameters
- w DoubleSparseVector
- A sparse vector.
- v DoubleVector
- A dense vector. The length of this vector must accomodate the largest index of
the largest nonzero value in the sparse vector. Specifically v.Length must
be greater than max{indices of nonzero value in w} + 1.
Return Value
DoubleThe dot product.
Exceptions Exception | Condition |
---|
InvalidArgumentException | Thrown if v or w
has zero length, or the length of v is less than the maximum nonzero index
in w + 1. |
Remarks d = v[0]w[0] + v[1]w[1]...
See Also