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

Interface Xqrm_spfct_unmqr_c #97

Open
amontoison opened this issue Apr 24, 2024 · 2 comments
Open

Interface Xqrm_spfct_unmqr_c #97

amontoison opened this issue Apr 24, 2024 · 2 comments
Assignees

Comments

@amontoison
Copy link
Member

amontoison commented Apr 24, 2024

Float32 + transp='n'

8×8 Matrix{Float32}:
  0.765399  -0.583735   0.0       0.0  -0.270955     0.0        0.0   0.0
 -0.142009   0.121727   0.0       0.0  -0.663393    -0.724517   0.0   0.0
 -0.243844  -0.316964  -0.738126  0.0  -0.00596202   0.0        0.0   0.543331
  0.0        0.0        0.0       1.0   0.0          0.0        0.0   0.0
  0.149274  -0.127955   0.0       0.0   0.697331    -0.689257   0.0   0.0
  0.0        0.0        0.0       0.0   0.0          0.0       -1.0   0.0
 -0.491001  -0.638233   0.0       0.0  -0.012005     0.0        0.0  -0.592817
  0.266782   0.346779  -0.674663  0.0   0.00652282   0.0        0.0  -0.59444

Float32 + transp='t'

8×8 Matrix{Float32}:
  0.765399  -0.142009  -0.243844    0.0   0.149274   0.0  -0.491001   0.266782
 -0.583735   0.121727  -0.316964    0.0  -0.127955   0.0  -0.638233   0.346779
  0.0        0.0       -0.738126    0.0   0.0        0.0   0.0       -0.674663
  0.0        0.0        0.0         1.0   0.0        0.0   0.0        0.0
 -0.270955  -0.663393  -0.00596202  0.0   0.697331   0.0  -0.012005   0.00652282
  0.0       -0.724517   0.0         0.0  -0.689257   0.0   0.0        0.0
  0.0        0.0        0.0         0.0   0.0       -1.0   0.0        0.0
  0.0        0.0        0.543331    0.0   0.0        0.0  -0.592817  -0.59444

Float32 + transp='c'

8×8 Matrix{Float32}:
  0.765399  -0.583735   0.0       0.0  -0.270955     0.0        0.0   0.0
 -0.142009   0.121727   0.0       0.0  -0.663393    -0.724517   0.0   0.0
 -0.243844  -0.316964  -0.738126  0.0  -0.00596202   0.0        0.0   0.543331
  0.0        0.0        0.0       1.0   0.0          0.0        0.0   0.0
  0.149274  -0.127955   0.0       0.0   0.697331    -0.689257   0.0   0.0
  0.0        0.0        0.0       0.0   0.0          0.0       -1.0   0.0
 -0.491001  -0.638233   0.0       0.0  -0.012005     0.0        0.0  -0.592817
  0.266782   0.346779  -0.674663  0.0   0.00652282   0.0        0.0  -0.59444

Float64 + transp='n'

8×8 Matrix{Float64}:
  0.00649547  -0.150752    0.0        0.28846    -0.387076   -0.136938   -0.770867   -0.362225
  0.310472    -0.588545    0.0        0.620165    0.328261    0.0854132   0.0607044   0.232124
  0.10971     -0.010901   -0.923031   0.0924533  -0.255888   -0.0135257   0.221378   -0.112437
 -0.646438    -0.363147   -0.152295  -0.0878052   0.448818   -0.307906    0.0264383  -0.349852
 -0.194154     0.660747    0.0        0.646752    0.257743    0.0390146   0.0633068  -0.18833
 -0.31589     -0.159652    0.0        0.0        -0.0979924   0.912631    0.0        -0.179521
 -0.00797196   0.18502    -0.3533    -0.203694    0.475062    0.168065   -0.589768    0.444563
 -0.579743    -0.0508492   0.0        0.23696    -0.416873   -0.127674    0.0231947   0.643849

Float64 + transp='t'

8×8 Matrix{Float64}:
  0.00649547   0.310472    0.10971    -0.646438   -0.194154   -0.31589    -0.00797196  -0.579743
 -0.150752    -0.588545   -0.010901   -0.363147    0.660747   -0.159652    0.18502     -0.0508492
  0.0          0.0        -0.923031   -0.152295    0.0         0.0        -0.3533       0.0
  0.28846      0.620165    0.0924533  -0.0878052   0.646752    0.0        -0.203694     0.23696
 -0.387076     0.328261   -0.255888    0.448818    0.257743   -0.0979924   0.475062    -0.416873
 -0.136938     0.0854132  -0.0135257  -0.307906    0.0390146   0.912631    0.168065    -0.127674
 -0.770867     0.0607044   0.221378    0.0264383   0.0633068   0.0        -0.589768     0.0231947
 -0.362225     0.232124   -0.112437   -0.349852   -0.18833    -0.179521    0.444563     0.643849

Float64 + transp='c'

8×8 Matrix{Float64}:
  0.00649547  -0.150752    0.0        0.28846    -0.387076   -0.136938   -0.770867   -0.362225
  0.310472    -0.588545    0.0        0.620165    0.328261    0.0854132   0.0607044   0.232124
  0.10971     -0.010901   -0.923031   0.0924533  -0.255888   -0.0135257   0.221378   -0.112437
 -0.646438    -0.363147   -0.152295  -0.0878052   0.448818   -0.307906    0.0264383  -0.349852
 -0.194154     0.660747    0.0        0.646752    0.257743    0.0390146   0.0633068  -0.18833
 -0.31589     -0.159652    0.0        0.0        -0.0979924   0.912631    0.0        -0.179521
 -0.00797196   0.18502    -0.3533    -0.203694    0.475062    0.168065   -0.589768    0.444563
 -0.579743    -0.0508492   0.0        0.23696    -0.416873   -0.127674    0.0231947   0.643849

ComplexF32 + transp='n'

8×8 Matrix{ComplexF32}:
 -0.813029-0.582223im         0.0+0.0im       0.0+0.0im        0.0+0.0im              0.0+0.0im             0.0+0.0im              0.0+0.0im                 0.0+0.0im
       0.0+0.0im        -0.510879-0.282436im  0.0+0.0im        0.0+0.0im       -0.0899323-0.103586im        0.0+0.0im          0.18427+0.257582im       0.220833+0.700959im
       0.0+0.0im              0.0+0.0im       1.0+0.0im        0.0+0.0im              0.0+0.0im             0.0+0.0im              0.0+0.0im                 0.0+0.0im
       0.0+0.0im              0.0+0.0im       0.0+0.0im  -0.148556-0.597834im         0.0+0.0im        0.124377+0.777854im         0.0+0.0im                 0.0+0.0im
       0.0+0.0im        -0.381157-0.504905im  0.0+0.0im        0.0+0.0im       -0.0433391-0.142205im        0.0+0.0im         0.068806+0.336253im      0.0770988-0.673755im
       0.0+0.0im              0.0+0.0im       0.0+0.0im  -0.539919-0.573597im         0.0+0.0im       -0.382615-0.482784im         0.0+0.0im                 0.0+0.0im
       0.0+0.0im        -0.314262-0.328527im  0.0+0.0im        0.0+0.0im       -0.0428204-0.097879im        0.0+0.0im        -0.276821-0.839801im      8.9407f-8-4.47035f-8im
       0.0+0.0im       -0.0906571-0.210032im  0.0+0.0im        0.0+0.0im        0.0551322+0.97192im         0.0+0.0im       4.47035f-8-7.45058f-9im  -2.38419f-7+0.0im

ComplexF32 + transp='t'

8×8 Matrix{ComplexF32}:
 -0.813029-0.582223im         0.0+0.0im       0.0+0.0im        0.0+0.0im              0.0+0.0im             0.0+0.0im              0.0+0.0im                 0.0+0.0im
       0.0+0.0im        -0.510879-0.282436im  0.0+0.0im        0.0+0.0im       -0.0899323-0.103586im        0.0+0.0im          0.18427+0.257582im       0.220833+0.700959im
       0.0+0.0im              0.0+0.0im       1.0+0.0im        0.0+0.0im              0.0+0.0im             0.0+0.0im              0.0+0.0im                 0.0+0.0im
       0.0+0.0im              0.0+0.0im       0.0+0.0im  -0.148556-0.597834im         0.0+0.0im        0.124377+0.777854im         0.0+0.0im                 0.0+0.0im
       0.0+0.0im        -0.381157-0.504905im  0.0+0.0im        0.0+0.0im       -0.0433391-0.142205im        0.0+0.0im         0.068806+0.336253im      0.0770988-0.673755im
       0.0+0.0im              0.0+0.0im       0.0+0.0im  -0.539919-0.573597im         0.0+0.0im       -0.382615-0.482784im         0.0+0.0im                 0.0+0.0im
       0.0+0.0im        -0.314262-0.328527im  0.0+0.0im        0.0+0.0im       -0.0428204-0.097879im        0.0+0.0im        -0.276821-0.839801im      8.9407f-8-4.47035f-8im
       0.0+0.0im       -0.0906571-0.210032im  0.0+0.0im        0.0+0.0im        0.0551322+0.97192im         0.0+0.0im       4.47035f-8-7.45058f-9im  -2.38419f-7+0.0im

ComplexF32 + transp='c'

8×8 Matrix{ComplexF32}:
 -0.813029+0.582223im         0.0+0.0im       0.0+0.0im        0.0+0.0im              0.0+0.0im             0.0+0.0im              0.0+0.0im                 0.0+0.0im
       0.0+0.0im        -0.510879+0.282436im  0.0+0.0im        0.0+0.0im        -0.381157+0.504905im        0.0+0.0im        -0.314262+0.328527im     -0.0906571+0.210032im
       0.0+0.0im              0.0+0.0im       1.0+0.0im        0.0+0.0im              0.0+0.0im             0.0+0.0im              0.0+0.0im                 0.0+0.0im
       0.0+0.0im              0.0+0.0im       0.0+0.0im  -0.148556+0.597834im         0.0+0.0im       -0.539919+0.573597im         0.0+0.0im                 0.0+0.0im
       0.0+0.0im       -0.0899323+0.103586im  0.0+0.0im        0.0+0.0im       -0.0433391+0.142205im        0.0+0.0im       -0.0428203+0.097879im      0.0551321-0.97192im
       0.0+0.0im              0.0+0.0im       0.0+0.0im   0.124377-0.777854im         0.0+0.0im       -0.382615+0.482784im         0.0+0.0im                 0.0+0.0im
       0.0+0.0im          0.18427-0.257582im  0.0+0.0im        0.0+0.0im         0.068806-0.336253im        0.0+0.0im        -0.276821+0.839801im     4.84288f-8+5.58794f-9im
       0.0+0.0im         0.220833-0.700959im  0.0+0.0im        0.0+0.0im        0.0770988+0.673755im        0.0+0.0im       8.19564f-8+2.98023f-8im  -2.38419f-7+2.98023f-8im

ComplexF64 + transp='n'

8×8 Matrix{ComplexF64}:
         0.0+4.72188e-19im        0.0+0.0im       0.0+0.0im  0.0+0.0im           0.0+0.0im            -0.445512-0.895276im     -5.55112e-17+1.11022e-16im        0.0+0.0im
 5.55112e-17+1.66533e-16im  -0.572767-0.400613im  0.0+0.0im  0.0+0.0im     -0.383545-0.180022im     2.77556e-17+0.0im             0.0391816-0.574801im           0.0+0.0im
         0.0+0.0im                0.0+0.0im       1.0+0.0im  0.0+0.0im           0.0+0.0im                  0.0+0.0im                   0.0+0.0im                0.0+0.0im
         0.0+0.0im                0.0+0.0im       0.0+0.0im  1.0+0.0im           0.0+0.0im                  0.0+0.0im                   0.0+0.0im                0.0+0.0im
         0.0+0.0im                0.0+0.0im       0.0+0.0im  0.0+0.0im      0.804078-0.0496436im            0.0+0.0im             -0.248288-0.53791im            0.0+0.0im
 5.45315e-17-1.69206e-16im  -0.128626-0.703493im  0.0+0.0im  0.0+0.0im      0.142908+0.38866im              0.0+1.11156e-17im     -0.422173+0.372617im           0.0+0.0im
   -0.998168-0.0605078im          0.0+0.0im       0.0+0.0im  0.0+0.0im  -4.16334e-17+2.08167e-17im          0.0+0.0im           1.11022e-16-6.93889e-17im        0.0+0.0im
         0.0+0.0im                0.0+0.0im       0.0+0.0im  0.0+0.0im           0.0+0.0im                  0.0+0.0im                   0.0+0.0im          -0.837483-0.546464im

ComplexF64 + transp='t'

8×8 Matrix{ComplexF64}:
         0.0+4.72188e-19im        0.0+0.0im       0.0+0.0im  0.0+0.0im           0.0+0.0im            -0.445512-0.895276im     -5.55112e-17+1.11022e-16im        0.0+0.0im
 5.55112e-17+1.66533e-16im  -0.572767-0.400613im  0.0+0.0im  0.0+0.0im     -0.383545-0.180022im     2.77556e-17+0.0im             0.0391816-0.574801im           0.0+0.0im
         0.0+0.0im                0.0+0.0im       1.0+0.0im  0.0+0.0im           0.0+0.0im                  0.0+0.0im                   0.0+0.0im                0.0+0.0im
         0.0+0.0im                0.0+0.0im       0.0+0.0im  1.0+0.0im           0.0+0.0im                  0.0+0.0im                   0.0+0.0im                0.0+0.0im
         0.0+0.0im                0.0+0.0im       0.0+0.0im  0.0+0.0im      0.804078-0.0496436im            0.0+0.0im             -0.248288-0.53791im            0.0+0.0im
 5.45315e-17-1.69206e-16im  -0.128626-0.703493im  0.0+0.0im  0.0+0.0im      0.142908+0.38866im              0.0+1.11156e-17im     -0.422173+0.372617im           0.0+0.0im
   -0.998168-0.0605078im          0.0+0.0im       0.0+0.0im  0.0+0.0im  -4.16334e-17+2.08167e-17im          0.0+0.0im           1.11022e-16-6.93889e-17im        0.0+0.0im
         0.0+0.0im                0.0+0.0im       0.0+0.0im  0.0+0.0im           0.0+0.0im                  0.0+0.0im                   0.0+0.0im          -0.837483-0.546464im

ComplexF64 + transp='c'

8×8 Matrix{ComplexF64}:
 1.11022e-16+0.0im          5.55112e-17-1.66533e-16im  0.0+0.0im  0.0+0.0im        0.0+0.0im        2.77556e-17+0.0im             -0.998168+0.0605078im          0.0+0.0im
         0.0+0.0im            -0.572767+0.400613im     0.0+0.0im  0.0+0.0im        0.0+0.0im          -0.128626+0.703493im              0.0+0.0im                0.0+0.0im
         0.0+0.0im                  0.0+0.0im          1.0+0.0im  0.0+0.0im        0.0+0.0im                0.0+0.0im                   0.0+0.0im                0.0+0.0im
         0.0+0.0im                  0.0+0.0im          0.0+0.0im  1.0+0.0im        0.0+0.0im                0.0+0.0im                   0.0+0.0im                0.0+0.0im
 2.94365e-17-2.38335e-17im    -0.383545+0.180022im     0.0+0.0im  0.0+0.0im   0.804078+0.0496436im     0.142908-0.38866im      -6.43664e-18+3.71928e-17im        0.0+0.0im
   -0.445512+0.895276im     2.77556e-17+0.0im          0.0+0.0im  0.0+0.0im        0.0+0.0im                0.0-2.77556e-17im           0.0+0.0im                0.0+0.0im
         0.0-1.11022e-16im    0.0391816+0.574801im     0.0+0.0im  0.0+0.0im  -0.248288+0.53791im      -0.422173-0.372617im      1.11022e-16+8.32667e-17im        0.0+0.0im
         0.0+0.0im                  0.0+0.0im          0.0+0.0im  0.0+0.0im        0.0+0.0im                0.0+0.0im                   0.0+0.0im          -0.837483+0.546464im
@amontoison amontoison self-assigned this Apr 24, 2024
@amontoison
Copy link
Member Author

amontoison commented Apr 25, 2024

@abuttari
I implemented qrm_spfct_unmqr in #99 and I have a comment for you.

In the real case, you could easily support transp='c' and dispatch to transp='t'.
In the complex case, if transp='t' is not supported, it should return an error.
The flag transp is just ignored when it's not supported and we have the result with transp='n'.
I can do that directly in the Julia interface but it could be relevant for other C or Fortran users.

A quick question, what the difference with qrm_apply?
In general we have another argument side for unmqr.

@abuttari
Copy link
Contributor

unmqr now return an error if called with transp=t.

apply is currently only an alias for unmqr for backward compatibility. In the latest version I have renamed a few routines because "apply" (renamed into unmqr) and "solve" (renamed into trsm) don't seem accurate enough.

Yes in LAPACK unmqr there is also a "side" argument but this feature is currently lacking in qrm. It will we added if the need arises.

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

No branches or pull requests

2 participants