sparse_inner_product_dense_double(_:_:_:_:_:)
Computes the inner product of sparse vector x with double-precision y, with both vectors containing double-precision values.
Declaration
func sparse_inner_product_dense_double(_ nz: sparse_dimension, _ x: UnsafePointer<Double>!, _ indx: UnsafePointer<sparse_index>!, _ y: UnsafePointer<Double>!, _ incy: sparse_stride) -> DoubleParameters
- nz:
The number of nonzero entries in the sparse vector x.
- x:
Pointer to the dense storage for the values of the sparse vector x. The corresponding entry in
indxholds the index of the value. Containsnzvalues. - indx:
Pointer to the dense storage for the index values of the sparse vector x. The corresponding entry in x holds the values of the vector. Contains
nzvalues. - y:
Pointer to the dense vector y. Accessed as
y[indx[0..nz-1]*incy], so dimension must be compatible with largest index value inindx. The behavior of this function is undefined if this is not met. Negative strides are supported. Note, unlike dense BLAS routines, the pointer points to the last element when stride is negative. - incy:
Increment between valid values in the dense vector y. Negative strides are supported.
Return Value
The inner product of sparse vector x with dense vector y. Returns zero if nz is less than or equal to zero.
Discussion
Indices in indx are always assumed to be stored in ascending order. Additionally, indices are assumed to be unique. The behavior of this function is undefined if either of these assumptions are not met.
All indices are 0 based (the first element of a pointer is ptr[0]).
See Also
Vector-Vector Operations
sparse_inner_product_dense_float(_:_:_:_:_:)sparse_inner_product_sparse_double(_:_:_:_:_:_:)sparse_inner_product_sparse_float(_:_:_:_:_:_:)sparse_vector_add_with_scale_dense_double(_:_:_:_:_:_:)sparse_vector_add_with_scale_dense_float(_:_:_:_:_:_:)sparse_vector_norm_double(_:_:_:_:)sparse_vector_norm_float(_:_:_:_:)