Bug 16054 - qr.Q(z) for complex z gives error
Summary: qr.Q(z) for complex z gives error
Status: CLOSED FIXED
Alias: None
Product: R
Classification: Unclassified
Component: Accuracy (show other bugs)
Version: R 3.1.1
Hardware: Other Other
: P5 enhancement
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2014-10-31 22:50 UTC by Bill Dunlap
Modified: 2014-11-01 23:42 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Dunlap 2014-10-31 22:50:41 UTC
In R-3.1.1 on Linux and Windows I get:
   
   zQR <- qr(matrix(exp(1i*cos(1:4)), 2, 2))
   zQ <- qr.Q(zQR)
   #Error in .Internal(qr_qy_cmplx(qr, as.matrix(y), FALSE)) :
   #  there is no .Internal function 'qr_qy_cmplx'

We expect it to not throw an error and that
   crossprod(zQ, Conj(zQ)) - diag(nrow(zQ))
gives approximately the zero matrix.

It worked in R-2.15.2 but not in R-3.0.0.
Comment 1 Bill Dunlap 2014-11-01 18:17:20 UTC
Running strings over libR.so or R.dll in various versions of R makes it look like R-2.15.2's qr_qy_cmplx lost its 'x' in R-3.0.0.
Comment 2 Peter Dalgaard 2014-11-01 18:59:21 UTC
Looks like a consequence of 

$ svn log -c 60412 
------------------------------------------------------------------------
r60412 | ripley | 2012-08-25 12:40:02 +0200 (Sat, 25 Aug 2012) | 1 line

more migration to .Internal
------------------------------------------------------------------------

Specifically (spot the odd one out)

$ svn diff -c 60412 src/main/names.c  | grep _cmp
+{"La_rs_cmplx",do_lapack,     	2,	11,	2,	{PP_FUNCALL, PREC_FN,	0}},
+{"La_rg_cmplx",do_lapack,     	41,	11,	2,	{PP_FUNCALL, PREC_FN,	0}},
+{"La_rs_cmplx",	do_lapack,     	51,	11,	2,	{PP_FUNCALL, PREC_FN,	0}},
+{"qr_coef_cmplx",do_lapack,    	303,	11,	2,	{PP_FUNCALL, PREC_FN,	0}},
+{"qr_qy_cmpl",	do_lapack,     	304,	11,	3,	{PP_FUNCALL, PREC_FN,	0}},
+{"La_svd_cmplx",do_lapack,     	401,	11,	6,	{PP_FUNCALL, PREC_FN,	0}},

Just goes to show how much this stuff gets exercised....
Comment 3 Peter Dalgaard 2014-11-01 23:42:47 UTC
Obvious fix applied