26 #if defined (HAVE_CONFIG_H)
46 if (nargout == 0 || nargout == 1)
50 else if (! args(1).is_real_scalar ())
54 if (
A.rows () >
A.columns ())
71 classes:
double single
172 int nargin = args.length ();
174 if (nargin < 1 || nargin > 2 || nargout > 3)
179 if (arg.
ndims () != 2)
180 error (
"svd: A must be a 2-D matrix");
193 error (
"svd: cannot take SVD of matrix containing Inf or NaN values");
197 svd_type<FloatMatrix> (nargin, nargout, args, tmp),
198 svd_driver<FloatMatrix> ());
202 if (nargout == 0 || nargout == 1)
204 else if (nargout == 2)
217 error (
"svd: cannot take SVD of matrix containing Inf or NaN values");
221 svd_type<FloatComplexMatrix> (nargin, nargout, args, ctmp),
222 svd_driver<FloatComplexMatrix> ());
226 if (nargout == 0 || nargout == 1)
228 else if (nargout == 2)
244 error (
"svd: cannot take SVD of matrix containing Inf or NaN values");
248 svd_type<Matrix> (nargin, nargout, args, tmp),
249 svd_driver<Matrix> ());
253 if (nargout == 0 || nargout == 1)
255 else if (nargout == 2)
268 error (
"svd: cannot take SVD of matrix containing Inf or NaN values");
272 svd_type<ComplexMatrix> (nargin, nargout, args, ctmp),
273 svd_driver<ComplexMatrix> ());
277 if (nargout == 0 || nargout == 1)
279 else if (nargout == 2)
418 static const char *driver_names[] = {
"gesvd",
"gesdd",
nullptr };
bool any_element_is_inf_or_nan(void) const
ColumnVector extract_diag(octave_idx_type k=0) const
bool any_element_is_inf_or_nan(void) const
FloatColumnVector extract_diag(octave_idx_type k=0) const
bool any_element_is_inf_or_nan(void) const
bool any_element_is_inf_or_nan(void) const
DM_T singular_values(void) const
T right_singular_matrix(void) const
T left_singular_matrix(void) const
ComplexMatrix complex_matrix_value(bool frc_str_conv=false) const
FloatMatrix float_matrix_value(bool frc_str_conv=false) const
bool is_single_type(void) const
Matrix matrix_value(bool frc_str_conv=false) const
FloatComplexMatrix float_complex_matrix_value(bool frc_str_conv=false) const
bool iscomplex(void) const
OCTINTERP_API void print_usage(void)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void error(const char *fmt,...)
void err_wrong_type_arg(const char *name, const char *s)
static std::string Vsvd_driver
static octave::math::svd< T >::Driver svd_driver(void)
static octave::math::svd< T >::Type svd_type(int nargin, int nargout, const octave_value_list &args, const T &A)
F77_RET_T const F77_INT F77_CMPLX * A
octave_value::octave_value(const Array< char > &chm, char type) return retval
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
#define SET_INTERNAL_VARIABLE_CHOICES(NM, CHOICES)