-
Notifications
You must be signed in to change notification settings - Fork 29
Are there sparse matrix algorithms in scirust? #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've explored the code and found out that there's no sparse matrices support. So I want to suggest a refactoring: pub trait Matrix<T: MagmaBase> {
/// Returns the capacity of the matrix i.e. the number of elements it can
/// hold
fn capacity(&self) -> usize;
/// Reshapes the matrix
fn reshape(&mut self, rows: usize, cols: usize) -> bool;
/// Returns an iterator over a specific row of the matrix
fn row_iter(&self, r: isize) -> RowIterator<T>;
/// Returns an iterator over a specific column of the matrix
fn col_iter(&self, c: isize) -> ColIterator<T>;
/// Returns an iterator over all cells of the matrix
fn cell_iter(&self) -> CellIterator<T>;
/// Provide the main diagonal elements
fn diagonal_iter(&self) -> DiagIterator<T>;
// ...more methods...
}
impl<T: MagmaBase> Matrix<T> for DenseMatrix<T> {
// ...
}
impl<T: MagmaBase> Matrix<T> for SparseMatrix<T> {
// ...
}
// ...more impl's... With these changes it will be possible to operate with matrices of different representation, e.g. add "regular" matrix with CSR matrix. P.S. Sorry if my English isn't very good. |
Yes, at the moment there is no sparse matrix support. I will be able to merge the changes if and when you are ready. We can chat if you need any explanation on any part. |
I need a library to work with large-scale sparse matrices. Does scirust support sparse algorithms?
The text was updated successfully, but these errors were encountered: