23 #if defined (HAVE_CONFIG_H)
124 if (nargin == 0 || nargin > 4)
127 bool autocomp =
true;
128 if (nargin == 2 &&
args(1).is_string ()
129 &&
args(1).string_value () ==
"nocompute")
137 if (
args(0).is_scalar_type ())
144 else if (
args(0).is_sparse_type ())
150 if (
args(0).is_complex_type ())
152 mattyp =
args(0).matrix_type ();
157 args(0).sparse_complex_matrix_value ();
160 args(0).matrix_type (mattyp);
165 mattyp =
args(0).matrix_type ();
172 args(0).matrix_type (mattyp);
176 int typ = mattyp.
type ();
197 retval =
octave_value (
"Tridiagonal Positive Definite");
202 if (
args(0).rows () ==
args(0).columns ())
215 std::string str_typ =
args(1).xstring_value (
"matrix_type: TYPE must be a string");
225 str_typ.begin (), tolower);
227 if (str_typ ==
"diagonal")
229 if (str_typ ==
"permuted diagonal")
231 else if (str_typ ==
"upper")
233 else if (str_typ ==
"lower")
235 else if (str_typ ==
"banded"
236 || str_typ ==
"banded positive definite")
239 error (
"matrix_type: banded matrix type requires 4 arguments");
241 nl =
args(2).xnint_value (
"matrix_type: band size NL, NU must be integers");
242 nu =
args(3).xnint_value (
"matrix_type: band size NL, NU must be integers");
244 if (nl == 1 && nu == 1)
249 if (str_typ ==
"banded positive definite")
252 else if (str_typ ==
"positive definite")
257 else if (str_typ ==
"singular")
259 else if (str_typ ==
"full")
261 else if (str_typ ==
"unknown")
264 error (
"matrix_type: Unknown matrix type %s", str_typ.c_str ());
267 && (str_typ ==
"upper" || str_typ ==
"lower"))
269 const ColumnVector perm =
args(2).vector_value (
"matrix_type: Invalid permutation vector PERM");
275 error (
"matrix_type: Invalid permutation vector PERM");
280 p[
i] = static_cast<octave_idx_type> (perm (
i)) - 1;
285 && str_typ !=
"banded positive definite"
286 && str_typ !=
"banded")
287 error (
"matrix_type: Invalid number of arguments");
290 if (
args(0).is_complex_type ())
304 if (
args(0).is_complex_type ())
306 mattyp =
args(0).matrix_type ();
310 if (
args(0).is_single_type ())
313 m =
args(0).float_complex_matrix_value ();
316 args(0).matrix_type (mattyp);
323 args(0).matrix_type (mattyp);
329 mattyp =
args(0).matrix_type ();
333 if (
args(0).is_single_type ())
338 args(0).matrix_type (mattyp);
345 args(0).matrix_type (mattyp);
350 int typ = mattyp.
type ();
364 if (
args(0).rows () ==
args(0).columns ())
377 std::string str_typ =
args(1).xstring_value (
"matrix_type: TYPE must be a string");
384 str_typ.begin (), tolower);
386 if (str_typ ==
"upper")
388 else if (str_typ ==
"lower")
390 else if (str_typ ==
"positive definite")
395 else if (str_typ ==
"singular")
397 else if (str_typ ==
"full")
399 else if (str_typ ==
"unknown")
402 error (
"matrix_type: Unknown matrix type %s", str_typ.c_str ());
404 if (nargin == 3 && (str_typ ==
"upper" || str_typ ==
"lower"))
406 const ColumnVector perm =
args(2).vector_value (
"matrix_type: Invalid permutation vector PERM");
412 error (
"matrix_type: Invalid permutation vector PERM");
417 p[
i] = static_cast<octave_idx_type> (perm (
i)) - 1;
421 else if (nargin != 2)
422 error (
"matrix_type: Invalid number of arguments");
425 if (
args(0).is_single_type ())
427 if (
args(0).is_complex_type ())
436 if (
args(0).is_complex_type ())
void mark_as_lower_triangular(void)
void mark_as_diagonal(void)
bool is_unknown(void) const
OCTINTERP_API void print_usage(void)
octave_idx_type numel(void) const
Number of elements in the array.
void mark_as_symmetric(void)
#define DEFUN(name, args_name, nargout_name, doc)
void mark_as_permuted_diagonal(void)
void error(const char *fmt,...)
int type(bool quiet=true)
nd deftypefn *octave_map m
void mark_as_permuted(const octave_idx_type np, const octave_idx_type *p)
void mark_as_upper_triangular(void)
void mark_as_rectangular(void)
void invalidate_type(void)
=val(i)}if ode{val(i)}occurs in table i
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
ColumnVector transform(const Matrix &m, double x, double y, double z)
Vector representing the dimensions (size) of an Array.
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
void mark_as_tridiagonal(void)
void mark_as_banded(const octave_idx_type ku, const octave_idx_type kl)
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))