From 99eb8c1589e5d6fcbb48a9746e177511eb55c9d4 Mon Sep 17 00:00:00 2001 From: Fabian Loeschner Date: Tue, 9 Nov 2021 10:31:50 +0100 Subject: [PATCH] Revert "Rename nrows/ncols args for try_from_*_data functions for consistency" This reverts commit 2a3e657b565dadcd2af422750cd0fb5459be0f6f. --- nalgebra-sparse/src/csc.rs | 14 +++++++++----- nalgebra-sparse/src/csr.rs | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/nalgebra-sparse/src/csc.rs b/nalgebra-sparse/src/csc.rs index 9180ae12..a461658e 100644 --- a/nalgebra-sparse/src/csc.rs +++ b/nalgebra-sparse/src/csc.rs @@ -157,15 +157,19 @@ impl CscMatrix { /// An error is returned if the data given does not conform to the CSC storage format. /// See the documentation for [CscMatrix](struct.CscMatrix.html) for more information. pub fn try_from_csc_data( - nrows: usize, - ncols: usize, + num_rows: usize, + num_cols: usize, col_offsets: Vec, row_indices: Vec, values: Vec, ) -> Result { - let pattern = - SparsityPattern::try_from_offsets_and_indices(ncols, nrows, col_offsets, row_indices) - .map_err(pattern_format_error_to_csc_error)?; + let pattern = SparsityPattern::try_from_offsets_and_indices( + num_cols, + num_rows, + col_offsets, + row_indices, + ) + .map_err(pattern_format_error_to_csc_error)?; Self::try_from_pattern_and_values(pattern, values) } diff --git a/nalgebra-sparse/src/csr.rs b/nalgebra-sparse/src/csr.rs index 1f52a867..bd35bf6b 100644 --- a/nalgebra-sparse/src/csr.rs +++ b/nalgebra-sparse/src/csr.rs @@ -158,15 +158,19 @@ impl CsrMatrix { /// An error is returned if the data given does not conform to the CSR storage format. /// See the documentation for [CsrMatrix](struct.CsrMatrix.html) for more information. pub fn try_from_csr_data( - nrows: usize, - ncols: usize, + num_rows: usize, + num_cols: usize, row_offsets: Vec, col_indices: Vec, values: Vec, ) -> Result { - let pattern = - SparsityPattern::try_from_offsets_and_indices(nrows, ncols, row_offsets, col_indices) - .map_err(pattern_format_error_to_csr_error)?; + let pattern = SparsityPattern::try_from_offsets_and_indices( + num_rows, + num_cols, + row_offsets, + col_indices, + ) + .map_err(pattern_format_error_to_csr_error)?; Self::try_from_pattern_and_values(pattern, values) }