|
1 | 1 | full_matrix(system::System) = full_matrix(system.matrix_entries, issymmetric(system), system.dims, system.dims) |
2 | 2 | # There probably exists a smarter way of getting the dense matrix from the spares one |
3 | | -function full_matrix(matrix_entries::SparseMatrixCSC, symmetric::Bool, dimensions_rows, dimensions_cols) |
| 3 | +function full_matrix(matrix::SparseMatrixCSC, symmetric::Bool, dimensions_rows, dimensions_cols) |
4 | 4 | range_dict_rows = ranges(dimensions_rows) |
5 | 5 | range_dict_cols = ranges(dimensions_cols) |
6 | 6 | A = zeros(sum(dimensions_rows), sum(dimensions_cols)) |
7 | 7 |
|
8 | | - for (i,row) in enumerate(matrix_entries.rowval) |
9 | | - col = findfirst(x -> i<x, matrix_entries.colptr)-1 |
10 | | - A[range_dict_rows[row],range_dict_cols[col]] = matrix_entries[row,col].value |
| 8 | + for (i,row) in enumerate(matrix.rowval) |
| 9 | + col = findfirst(x -> i<x, matrix.colptr)-1 |
| 10 | + A[range_dict_rows[row],range_dict_cols[col]] = matrix[row,col].value |
11 | 11 | if symmetric && col != row |
12 | | - A[range_dict_cols[col],range_dict_rows[row]] = matrix_entries[row,col].value' |
| 12 | + A[range_dict_cols[col],range_dict_rows[row]] = matrix[row,col].value' |
13 | 13 | end |
14 | 14 | end |
15 | 15 | return A |
|
0 commit comments