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

SPQR documentation (issue #536) #584

Merged
merged 1 commit into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified SPQR/Doc/spqr_user_guide.pdf
Binary file not shown.
13 changes: 8 additions & 5 deletions SPQR/Doc/spqr_user_guide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,14 @@ \subsection{C++ Syntax}

\item \verb'SuiteSparseQR_qmult': provides the same function as
\verb'spqr_qmult' in the MATLAB interface, computing
\verb"Q'*x", \verb"Q*x", \verb"x*Q'", or \verb"x*Q".
It uses either a QR factorization
in MATLAB-style sparse matrix format, or the QR factorization object
returned by \newline \verb'SuiteSparseQR_factorize' or
\verb'SuiteSparseQR_numeric'.
\verb"y=Q'*x", \verb"y=Q*x", \verb"y=x*Q'", or \verb"y=x*Q".
It uses the efficient Householder reprensentation of \verb'Q', which
represents a square orthonormal matrix computed by
\verb'SuiteSparseQR_factorize' or \verb'SuiteSparseQR_numeric'. The
Householder representation always represents a square orthonormal matrix,
regardless of whether \verb'Q' is a full or economy factor.
\verb'SuiteSparseQR_qmult' applies this square matrix to compute its result
\verb'y'.

\item \verb'SuiteSparseQR_min2norm': finds the minimum 2-norm solution to
an underdetermined linear system.
Expand Down
4 changes: 3 additions & 1 deletion SPQR/MATLAB/spqr.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@
% [Q,R,P]=spqr(A) where spqr finds P and Q is discarded instead). 'matrix'
% returns Q as a sparse matrix where A=Q*R or A*P=Q*R. 'Householder' returns
% Q as a struct containing the Householder reflections applied to A to obtain
% R, resulting in a far sparser Q than the 'matrix' option.
% R, resulting in a far sparser Q than the 'matrix' option. When returned as
% a struct, Q always represents a square orthonormal matrix, regardless of
% opts.econ.
%
% opts.permutation: a string describing how P is to be returned. The default
% is 'matrix', so that A*P=Q*R. 'vector' gives A(:,P)=Q*R instead.
Expand Down
5 changes: 5 additions & 0 deletions SPQR/MATLAB/spqr_qmult.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
% method = 2: Y = X*Q'
% method = 3: Y = X*Q
%
% where Q is the struct from [Q,R,E] = spqr (A,opts) with
% opts.Q = 'Householder'. The struct Q always represents a square
% orthonormal matrix, regardless of opts.econ. spqr_qmult applies this
% square matrix to compute Y.
%
% Example:
% These two examples both compute the min-norm solution to an
% under determined system, but the latter is much more efficient:
Expand Down