error with complex solve (PR#2068)
john.peters@csiro.au
john.peters@csiro.au
Thu, 26 Sep 2002 06:23:11 +0200 (MET DST)
Full_Name: John Peters
Version: 1.5.1
OS: Windows 2000
Submission from: (NULL) (130.155.2.3)
solve(a,b) with two arguments gives an error if a is complex and b is a vector:
> a_matrix(c(1,2+3i,3,2),ncol=2)
> a
[,1] [,2]
[1,] 1+0i 3+0i
[2,] 2+3i 2+0i
> b_c(2,2+1i)
> solve(a,b)
Error in solve.default(a, b) : A must be a complex matrix
> is.complex(a)
[1] TRUE
> is.matrix(a)
[1] TRUE
> solve(a,diag(b))
[,1] [,2]
[1,] -0.1649485+0.3711340i 0.5257732-0.4329897i
[2,] 0.7216495-0.1237113i -0.1752577+0.1443299i
>
> solve(a) %*% b
[,1]
[1,] 0.3608247-0.06185567i
[2,] 0.5463918+0.02061856i
>
Running R1.5.1 under Windows 2000.
Many thanks.
-----------------------------------------------------------------
John Peters
CSIRO National Measurement Laboratory
PO Box 218 Phone: +61 2 9413 7503
Lindfield NSW 2070 Fax: +61 2 9413 7202
Australia Email: John.Peters@csiro.au
-----------------------------------------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._