Skip to content

Commit

Permalink
Emit error when qr() called with permutation output and CXSparse libr…
Browse files Browse the repository at this point in the history
…ary is used (bug #66511)

* qr.cc (Fqr): Change BIST test of 'p' vector orientation to only run if SPQR
library is used.

* sparse-qr.cc (E): Use "#elif defined (HAVE_CXSPARSE)" compiler conditional
to detect use of CXSParse library and emit an error.
  • Loading branch information
Rik committed Dec 4, 2024
1 parent 7fdb568 commit 5d78448
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libinterp/corefcn/qr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ orthogonal basis of @code{span (A)}.
%! [q, r, p] = qr (eye (3), 0);
%! assert (size (p), [1, 3]);
%!testif ; (__have_feature__ ("SPQR") && __have_feature__ ("CHOLMOD")) || __have_feature__ ("CXSPARSE") <*66488>
%!testif ; (__have_feature__ ("SPQR") && __have_feature__ ("CHOLMOD")) <*66488>
%! ## Orientation of 'p' output for sparse matrices
%! [q, r, p] = qr (speye (3));
%! assert (size (p), [3, 3]);
Expand Down
6 changes: 6 additions & 0 deletions liboctave/numeric/sparse-qr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ sparse_qr<SPARSE_T>::sparse_qr_rep::E () const
ret(i) = i + 1;

return ret;
#elif defined (HAVE_CXSPARSE)

(*current_liboctave_error_handler)
("sparse-qr: permutation output is not supported by CXSparse");

return ColumnVector (); // needed to suppress compiler warning

#else

Expand Down

0 comments on commit 5d78448

Please sign in to comment.