Function

# sparse_pack_vector_float

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

## 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.

### Sparse Utility Operations

`sparse_get_vector_nonzero_count_double`

Returns the number of nonzero values in the double-precision dense vector x.

`sparse_get_vector_nonzero_count_float`

Returns the number of nonzero values in the single-precision dense vector x.

`sparse_pack_vector_double`

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

`sparse_unpack_vector_double`

Extracts elements from the sparse vector x into the corresponding location in the dense vector y, with both vectors containing double-precision values.

`sparse_unpack_vector_float`

Extracts elements from the sparse vector x into the corresponding location in the dense vector y, with both vectors containing single-precision values.