Contents

sparse_pack_vector_double(_:_:_:_:_:_:)

Packs nonzero values from a double-precision dense vector to a destination array.

Declaration

func sparse_pack_vector_double(_ N: sparse_dimension, _ nz: sparse_dimension, _ x: UnsafePointer<Double>!, _ incx: sparse_stride, _ y: UnsafeMutablePointer<Double>!, _ indy: UnsafeMutablePointer<sparse_index>!) -> Int

Parameters

  • N:

    The number of elements in the dense vector x.

  • nz:

    The number of nonzero values to collect. If less than nz nonzero elements are found in the N elements of x, then the last nz - actual_nonzero_count of y and indy are unused.

  • x:

    Pointer to the dense vector x.

  • incx:

    Increment between valid values in the dense vector x. Negative strides are supported.

  • y:

    The destination dense storage of nonzero values of x. Expected to be of size nz elements.

  • indy:

    The destination dense storage of nonzero indices of x. Expected to be of size nz elements.

Return Value

The number of nonzero values written. On success, y and indy are updated with up to the first nz nonzero indices.

Discussion

Pack the first nz nonzero values and indices from the dense vector x and place them in y and indy. If less than nz nonzero elements are found in the N elements of x, then the last nz - actual_nonzero_count elements of y and indy are unused. The number of indices written can range from 0 to nz values and the number written is returned.

See Also

Sparse Utility Operations