#include "CmplxSVD.h"
#include "dbleSVD.h"
#include "fCmplxSVD.h"
#include "floatSVD.h"
#include "defun-dld.h"
#include "error.h"
#include "gripes.h"
#include "oct-obj.h"
#include "pr-output.h"
#include "utils.h"
#include "variables.h"
Go to the source code of this file.
Functions | |
DEFUN_DLD (svd, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{s} =} svd (@var{A})\n\ @deftypefnx {Loadable Function} {[@var{U}, @var{S}, @var{V}] =} svd (@var{A})\n\ @deftypefnx {Loadable Function} {[@var{U}, @var{S}, @var{V}] =} svd (@var{A}, @var{econ})\n\ @cindex singular value decomposition\n\ Compute the singular value decomposition of @var{A}\n\ @tex\n\ $$\n\ A = U S V^{\\dagger}\n\ $$\n\ @end tex\n\ @ifnottex\n\ \n\ @example\n\ A = U*S*V'\n\ @end example\n\ \n\ @end ifnottex\n\ \n\ The function @code{svd} normally returns only the vector of singular values.\n\ When called with three return values, it computes\n\ @tex\n\ $U$, $S$, and $V$.\n\ @end tex\n\ @ifnottex\n\ @var{U}, @var{S}, and @var{V}.\n\ @end ifnottex\n\ For example,\n\ \n\ @example\n\ svd (hilb (3))\n\ @end example\n\ \n\ @noindent\n\ returns\n\ \n\ @example\n\ @group\n\ ans =\n\ \n\ 1.4083189\n\ 0.1223271\n\ 0.0026873\n\ @end group\n\ @end example\n\ \n\ @noindent\n\ and\n\ \n\ @example\n\ [u, s, v] = svd (hilb (3))\n\ @end example\n\ \n\ @noindent\n\ returns\n\ \n\ @example\n\ @group\n\ u =\n\ \n\ -0.82704 0.54745 0.12766\n\ -0.45986 -0.52829 -0.71375\n\ -0.32330 -0.64901 0.68867\n\ \n\ s =\n\ \n\ 1.40832 0.00000 0.00000\n\ 0.00000 0.12233 0.00000\n\ 0.00000 0.00000 0.00269\n\ \n\ v =\n\ \n\ -0.82704 0.54745 0.12766\n\ -0.45986 -0.52829 -0.71375\n\ -0.32330 -0.64901 0.68867\n\ @end group\n\ @end example\n\ \n\ If given a second argument, @code{svd} returns an economy-sized\n\ decomposition, eliminating the unnecessary rows or columns of @var{U} or\n\ @var{V}.\n\ @seealso{svd_driver, svds, eig}\n\ @end deftypefn") | |
DEFUN_DLD (svd_driver, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{val} =} svd_driver ()\n\ @deftypefnx {Loadable Function} {@var{old_val} =} svd_driver (@var{new_val})\n\ @deftypefnx {Loadable Function} {} svd_driver (@var{new_val}, \"local\")\n\ Query or set the underlying @sc{lapack} driver used by @code{svd}.\n\ Currently recognized values are \"gesvd\" and \"gesdd\". The default\n\ is \"gesvd\".\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @seealso{svd}\n\ @end deftypefn") | |
Variables | |
static int | Vsvd_driver = SVD::GESVD |
DEFUN_DLD | ( | svd | , | |
args | , | |||
nargout | ||||
) |
Definition at line 42 of file svd.cc.
References ComplexMatrix::any_element_is_inf_or_nan(), Matrix::any_element_is_inf_or_nan(), FloatComplexMatrix::any_element_is_inf_or_nan(), FloatMatrix::any_element_is_inf_or_nan(), arg(), octave_value::columns(), octave_value::complex_matrix_value(), DiagMatrix::diag(), FloatDiagMatrix::diag(), SVD::economy, error(), error_state, f, octave_value::float_complex_matrix_value(), octave_value::float_matrix_value(), gripe_wrong_type_arg(), octave_value::is_complex_type(), octave_value::is_real_type(), octave_value::is_single_type(), ComplexSVD::left_singular_matrix(), SVD::left_singular_matrix(), FloatComplexSVD::left_singular_matrix(), FloatSVD::left_singular_matrix(), octave_value::matrix_value(), octave_value::ndims(), print_usage(), ComplexSVD::right_singular_matrix(), SVD::right_singular_matrix(), FloatComplexSVD::right_singular_matrix(), FloatSVD::right_singular_matrix(), octave_value::rows(), SVD::sigma_only, ComplexSVD::singular_values(), SVD::singular_values(), FloatComplexSVD::singular_values(), FloatSVD::singular_values(), and SVD::std.
DEFUN_DLD | ( | svd_driver | , | |
args | , | |||
nargout | ||||
) |
Definition at line 407 of file svd.cc.
References SET_INTERNAL_VARIABLE_CHOICES.
int Vsvd_driver = SVD::GESVD [static] |