Skip to content
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

Add COO format constructor #98

Merged
merged 6 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ task:
image_family: freebsd-13-2
env:
matrix:
- JULIA_VERSION: 1.6
- JULIA_VERSION: 1.10
- JULIA_VERSION: 1
- name: MacOS M1
macos_instance:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ['1.6', '1']
version: ['1.10', '1']
os: [ubuntu-latest, macOS-latest, windows-latest]
arch: [x64]
allow_failure: [false]
Expand Down
23 changes: 15 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,23 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
qr_mumps_jll = "e37b5aa0-c611-5f0f-83fb-aee446c0b77e"

[weakdeps]
SparseMatricesCOO = "fa32481b-f100-4b48-8dc8-c62f61b13870"

[extensions]
QRMumpsSparseMatricesCOOExt = "SparseMatricesCOO"

[compat]
Libdl = "1.6"
LinearAlgebra = "1.6"
Libdl = "1.10"
LinearAlgebra = "1.10"
OpenBLAS32_jll = "0.3.10"
Printf = "1.6"
Random = "1.6"
SparseArrays = "1.6"
Test = "1.6"
julia = "1.6"
qr_mumps_jll = "3.0.4"
Printf = "1.10"
Random = "1.10"
SparseArrays = "1.10"
SparseMatricesCOO = "1.10"
Test = "1.10"
julia = "1.10"
qr_mumps_jll = "3.1.0"

[extras]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
8 changes: 8 additions & 0 deletions ext/QRMumpsSparseMatricesCOOExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module QRMumpsSparseMatricesCOOExt

using SparseMatricesCOO
using QRMumps

include("SparseMatricesCOO/constructor.jl")

end
9 changes: 9 additions & 0 deletions ext/SparseMatricesCOO/constructor.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function QRMumps.qrm_spmat_init(A :: SparseMatrixCOO{T,I}; sym :: Bool=false) where {T, I <: Integer}
spmat = qrm_spmat{T}()
qrm_spmat_init!(spmat, A; sym = sym)
return spmat
end

function QRMumps.qrm_spmat_init!(spmat :: qrm_spmat{T}, A :: SparseMatrixCOO{T,I}; sym :: Bool=false) where {T, I <: Integer}
qrm_spmat_init!(spmat, A.m, A.n, A.rows, A.cols, A.vals; sym = sym)
end
2 changes: 1 addition & 1 deletion src/QRMumps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ This routine initializes a **qrm_spmat** type data structure from a **sparseMatr
In the first form,

* `spmat`: the **qrm_spmat** sparse matrix to be initialized.
* `A` : a Julia sparse matrix stored in **SparseMatrixCSC** format.
* `A` : a Julia sparse matrix stored in either **SparseMatrixCSC** or **SparseMatrixCOO** format (see SparseMatricesCOO.jl for the second case).
* `sym` : a boolean to specify if the matrix is symmetric / hermitian (true) or unsymmetric (false).

In the second form, the matrix `A` is specified using
Expand Down
2 changes: 1 addition & 1 deletion src/wrapper/qr_mumps_api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ for (fname, elty) in ((:sqrm_spmat_init_c, :Float32 ),
qrm_spmat_init!(spmat, m, n, irn, jcn, val; sym = sym)
return spmat
end

function qrm_spmat_init!(spmat :: qrm_spmat{$elty}, A :: SparseMatrixCSC{$elty,I}; sym :: Bool=false) where I <: Integer
qrm_spmat_init!(spmat, size(A)..., findnz(A)...; sym = sym)
end
Expand Down
Loading