pub fn transpose_sparse_single_layer<T, U>(
sparse_data: &CompressedSparseData2<T, U>,
use_second_layer: bool,
) -> Result<CompressedSparseData2<T, U>, SparseErrors>where
T: BixverseNumeric,
U: BixverseNumeric,Expand description
Transpose a compressed sparse matrix (CSC→CSR or CSR→CSC), keeping only one of the two data layers.
Useful when the caller knows the other layer is dead weight (e.g. raw counts when only normalised counts are consumed downstream). Skips the scatter for the unused layer entirely.
§Params
sparse_data- The input compressed sparse matrix to be transposed.use_second_layer- Iftrue, onlydata_2is transposed and the output’sdatais empty. Iffalse, onlydatais transposed and the output’sdata_2isNone.
§Returns
The transposed compressed sparse matrix with only the requested layer populated.