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

Solve with nrhs>1 #23

Open
cauachagas opened this issue Jul 22, 2020 · 0 comments
Open

Solve with nrhs>1 #23

cauachagas opened this issue Jul 22, 2020 · 0 comments

Comments

@cauachagas
Copy link

Example

using GridapPardiso
using Test
using SparseArrays

# Define linear system

mtype = GridapPardiso.MTYPE_REAL_NON_SYMMETRIC

A = sparse(Float32[
  0. -2  3 0
  -2  4 -4 1
  -3  5  1 1
  1 -3 0 2 ])

n = A.n

b = Float32[[1, 3, 2, 5] [1, 3, 2, 5]]

x = similar(b)

# Create the pardiso internal handler

pt = new_pardiso_handle()

# pardisoinit!

iparm = Vector{Int32}(new_iparm())

pardisoinit!(pt,mtype,iparm)
iparm[28] = 1 # Float32

# pardiso! (solving the transpose of the system above)

maxfct = 1
mnum = 1
phase = GridapPardiso.PHASE_ANALYSIS_NUMERICAL_FACTORIZATION_SOLVE_ITERATIVE_REFINEMENT
a = A.nzval
ia = Vector{Int32}(A.colptr)
ja = Vector{Int32}(A.rowval)
perm = zeros(Int32,n)
nrhs = 2
msglvl = 0

err = pardiso!(
  pt,maxfct,mnum,mtype,phase,n,a,ia,ja,perm,nrhs,iparm,msglvl,b,x) 

ERROR: MethodError: no method matching pardiso!(::Array{Int64,1}, ::Int64, ::Int64, ::Int64, ::Int64, ::Int64, ::Array{Float32,1}, ::Array{Int32,1}, ::Array{Int32,1}, ::Array{Int32,1}, ::Int64, ::Array{Int32,1}, ::Int64, ::Array{Float32,2}, ::Array{Float32,2})
Closest candidates are:
  pardiso!(::Array{Int64,1}, ::Integer, ::Integer, ::Integer, ::Integer, ::Integer, ::Array{T,1}, ::Array{Int32,1}, ::Array{Int32,1}, ::Array{Int32,1}, ::Integer, ::Array{Int32,1}, ::Integer, ::Array{T,Int32}, ::Array{T,Int32}) where T

Solution

Change the type Vector to Array at L43-L44 and L106-L107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant