GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
matrix_type.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2005-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include <algorithm>
31 
32 #include "ov.h"
33 #include "defun.h"
34 #include "error.h"
35 #include "ov-re-mat.h"
36 #include "ov-cx-mat.h"
37 #include "ov-re-sparse.h"
38 #include "ov-cx-sparse.h"
39 #include "MatrixType.h"
40 #include "oct-locbuf.h"
41 
42 DEFUN (matrix_type, args, ,
43  doc: /* -*- texinfo -*-
44 @deftypefn {} {@var{type} =} matrix_type (@var{A})
45 @deftypefnx {} {@var{type} =} matrix_type (@var{A}, "nocompute")
46 @deftypefnx {} {@var{A} =} matrix_type (@var{A}, @var{type})
47 @deftypefnx {} {@var{A} =} matrix_type (@var{A}, "upper", @var{perm})
48 @deftypefnx {} {@var{A} =} matrix_type (@var{A}, "lower", @var{perm})
49 @deftypefnx {} {@var{A} =} matrix_type (@var{A}, "banded", @var{nl}, @var{nu})
50 Identify the matrix type or mark a matrix as a particular type.
51 
52 This allows more rapid solutions of linear equations involving @var{A} to be
53 performed.
54 
55 Called with a single argument, @code{matrix_type} returns the type of the
56 matrix and caches it for future use.
57 
58 Called with more than one argument, @code{matrix_type} allows the type of
59 the matrix to be defined.
60 
61 If the option @qcode{"nocompute"} is given, the function will not attempt
62 to guess the type if it is still unknown. This is useful for debugging
63 purposes.
64 
65 The possible matrix types depend on whether the matrix is full or sparse,
66 and can be one of the following
67 
68 @table @asis
69 @item @qcode{"unknown"}
70 Remove any previously cached matrix type, and mark type as unknown.
71 
72 @item @qcode{"full"}
73 Mark the matrix as full.
74 
75 @item @qcode{"positive definite"}
76 Probable full positive definite matrix.
77 
78 @item @qcode{"diagonal"}
79 Diagonal matrix. (Sparse matrices only)
80 
81 @item @qcode{"permuted diagonal"}
82 Permuted Diagonal matrix. The permutation does not need to be specifically
83 indicated, as the structure of the matrix explicitly gives this. (Sparse
84 matrices only)
85 
86 @item @qcode{"upper"}
87 Upper triangular. If the optional third argument @var{perm} is given, the
88 matrix is assumed to be a permuted upper triangular with the permutations
89 defined by the vector @var{perm}.
90 
91 @item @qcode{"lower"}
92 Lower triangular. If the optional third argument @var{perm} is given, the
93 matrix is assumed to be a permuted lower triangular with the permutations
94 defined by the vector @var{perm}.
95 
96 @item @qcode{"banded"}
97 @itemx @qcode{"banded positive definite"}
98 Banded matrix with the band size of @var{nl} below the diagonal and @var{nu}
99 above it. If @var{nl} and @var{nu} are 1, then the matrix is tridiagonal
100 and treated with specialized code. In addition the matrix can be marked as
101 probably a positive definite. (Sparse matrices only)
102 
103 @item @qcode{"singular"}
104 The matrix is assumed to be singular and will be treated with a minimum norm
105 solution.
106 
107 @end table
108 
109 Note that the matrix type will be discovered automatically on the first
110 attempt to solve a linear equation involving @var{A}. Therefore
111 @code{matrix_type} is only useful to give Octave hints of the matrix type.
112 Incorrectly defining the matrix type will result in incorrect results from
113 solutions of linear equations; it is entirely @strong{the responsibility of
114 the user} to correctly identify the matrix type.
115 
116 Also, the test for positive definiteness is a low-cost test for a Hermitian
117 matrix with a real positive diagonal. This does not guarantee that the
118 matrix is positive definite, but only that it is a probable candidate. When
119 such a matrix is factorized, a Cholesky@tie{}factorization is first
120 attempted, and if that fails the matrix is then treated with an
121 LU@tie{}factorization. Once the matrix has been factorized,
122 @code{matrix_type} will return the correct classification of the matrix.
123 @end deftypefn */)
124 {
125  int nargin = args.length ();
126 
127  if (nargin == 0 || nargin > 4)
128  print_usage ();
129 
130  bool autocomp = true;
131  if (nargin == 2 && args(1).is_string ()
132  && args(1).string_value () == "nocompute")
133  {
134  nargin = 1;
135  autocomp = false;
136  }
137 
139 
140  if (args(0).is_scalar_type ())
141  {
142  if (nargin == 1)
143  retval = octave_value ("Diagonal");
144  else
145  retval = args(0);
146  }
147  else if (args(0).issparse ())
148  {
149  if (nargin == 1)
150  {
151  MatrixType mattyp;
152 
153  if (args(0).iscomplex ())
154  {
155  mattyp = args(0).matrix_type ();
156 
157  if (mattyp.is_unknown () && autocomp)
158  {
160  = args(0).sparse_complex_matrix_value ();
161 
162  mattyp = MatrixType (m);
163  args(0).matrix_type (mattyp);
164  }
165  }
166  else
167  {
168  mattyp = args(0).matrix_type ();
169 
170  if (mattyp.is_unknown () && autocomp)
171  {
172  SparseMatrix m = args(0).sparse_matrix_value ();
173 
174  mattyp = MatrixType (m);
175  args(0).matrix_type (mattyp);
176  }
177  }
178 
179  int typ = mattyp.type ();
180 
181  if (typ == MatrixType::Diagonal)
182  retval = octave_value ("Diagonal");
183  else if (typ == MatrixType::Permuted_Diagonal)
184  retval = octave_value ("Permuted Diagonal");
185  else if (typ == MatrixType::Upper)
186  retval = octave_value ("Upper");
187  else if (typ == MatrixType::Permuted_Upper)
188  retval = octave_value ("Permuted Upper");
189  else if (typ == MatrixType::Lower)
190  retval = octave_value ("Lower");
191  else if (typ == MatrixType::Permuted_Lower)
192  retval = octave_value ("Permuted Lower");
193  else if (typ == MatrixType::Banded)
194  retval = octave_value ("Banded");
195  else if (typ == MatrixType::Banded_Hermitian)
196  retval = octave_value ("Banded Positive Definite");
197  else if (typ == MatrixType::Tridiagonal)
198  retval = octave_value ("Tridiagonal");
199  else if (typ == MatrixType::Tridiagonal_Hermitian)
200  retval = octave_value ("Tridiagonal Positive Definite");
201  else if (typ == MatrixType::Hermitian)
202  retval = octave_value ("Positive Definite");
203  else if (typ == MatrixType::Rectangular)
204  {
205  if (args(0).rows () == args(0).columns ())
206  retval = octave_value ("Singular");
207  else
208  retval = octave_value ("Rectangular");
209  }
210  else if (typ == MatrixType::Full)
211  retval = octave_value ("Full");
212  else
213  retval = octave_value ("Unknown");
214  }
215  else
216  {
217  // Ok, we're changing the matrix type
218  std::string str_typ = args(1).xstring_value ("matrix_type: TYPE must be a string");
219 
220  // FIXME: why do I have to explicitly call the constructor?
221  MatrixType mattyp = MatrixType ();
222 
223  octave_idx_type nl = 0;
224  octave_idx_type nu = 0;
225 
226  // Use STL function to convert to lower case
227  std::transform (str_typ.begin (), str_typ.end (),
228  str_typ.begin (), tolower);
229 
230  if (str_typ == "diagonal")
231  mattyp.mark_as_diagonal ();
232  if (str_typ == "permuted diagonal")
233  mattyp.mark_as_permuted_diagonal ();
234  else if (str_typ == "upper")
235  mattyp.mark_as_upper_triangular ();
236  else if (str_typ == "lower")
237  mattyp.mark_as_lower_triangular ();
238  else if (str_typ == "banded"
239  || str_typ == "banded positive definite")
240  {
241  if (nargin != 4)
242  error ("matrix_type: banded matrix type requires 4 arguments");
243 
244  nl = args(2).xnint_value ("matrix_type: band size NL, NU must be integers");
245  nu = args(3).xnint_value ("matrix_type: band size NL, NU must be integers");
246 
247  if (nl == 1 && nu == 1)
248  mattyp.mark_as_tridiagonal ();
249  else
250  mattyp.mark_as_banded (nu, nl);
251 
252  if (str_typ == "banded positive definite")
253  mattyp.mark_as_symmetric ();
254  }
255  else if (str_typ == "positive definite")
256  {
257  mattyp.mark_as_full ();
258  mattyp.mark_as_symmetric ();
259  }
260  else if (str_typ == "singular")
261  mattyp.mark_as_rectangular ();
262  else if (str_typ == "full")
263  mattyp.mark_as_full ();
264  else if (str_typ == "unknown")
265  mattyp.invalidate_type ();
266  else
267  error ("matrix_type: Unknown matrix type %s", str_typ.c_str ());
268 
269  if (nargin == 3
270  && (str_typ == "upper" || str_typ == "lower"))
271  {
272  const ColumnVector perm = args(2).xvector_value ("matrix_type: Invalid permutation vector PERM");
273 
274  octave_idx_type len = perm.numel ();
275  dim_vector dv = args(0).dims ();
276 
277  if (len != dv(0))
278  error ("matrix_type: Invalid permutation vector PERM");
279 
281 
282  for (octave_idx_type i = 0; i < len; i++)
283  p[i] = static_cast<octave_idx_type> (perm (i)) - 1;
284 
285  mattyp.mark_as_permuted (len, p);
286  }
287  else if (nargin != 2
288  && str_typ != "banded positive definite"
289  && str_typ != "banded")
290  error ("matrix_type: Invalid number of arguments");
291 
292  // Set the matrix type
293  if (args(0).iscomplex ())
294  retval = octave_value (args(0).sparse_complex_matrix_value (),
295  mattyp);
296  else
297  retval = octave_value (args(0).sparse_matrix_value (),
298  mattyp);
299  }
300  }
301  else
302  {
303  if (nargin == 1)
304  {
305  MatrixType mattyp;
306 
307  if (args(0).iscomplex ())
308  {
309  mattyp = args(0).matrix_type ();
310 
311  if (mattyp.is_unknown () && autocomp)
312  {
313  if (args(0).is_single_type ())
314  {
316  m = args(0).float_complex_matrix_value ();
317 
318  mattyp = MatrixType (m);
319  args(0).matrix_type (mattyp);
320  }
321  else
322  {
323  ComplexMatrix m = args(0).complex_matrix_value ();
324 
325  mattyp = MatrixType (m);
326  args(0).matrix_type (mattyp);
327  }
328  }
329  }
330  else
331  {
332  mattyp = args(0).matrix_type ();
333 
334  if (mattyp.is_unknown () && autocomp)
335  {
336  if (args(0).is_single_type ())
337  {
338  FloatMatrix m = args(0).float_matrix_value ();
339 
340  mattyp = MatrixType (m);
341  args(0).matrix_type (mattyp);
342  }
343  else
344  {
345  Matrix m = args(0).matrix_value ();
346 
347  mattyp = MatrixType (m);
348  args(0).matrix_type (mattyp);
349  }
350  }
351  }
352 
353  int typ = mattyp.type ();
354 
355  if (typ == MatrixType::Upper)
356  retval = octave_value ("Upper");
357  else if (typ == MatrixType::Permuted_Upper)
358  retval = octave_value ("Permuted Upper");
359  else if (typ == MatrixType::Lower)
360  retval = octave_value ("Lower");
361  else if (typ == MatrixType::Permuted_Lower)
362  retval = octave_value ("Permuted Lower");
363  else if (typ == MatrixType::Hermitian)
364  retval = octave_value ("Positive Definite");
365  else if (typ == MatrixType::Rectangular)
366  {
367  if (args(0).rows () == args(0).columns ())
368  retval = octave_value ("Singular");
369  else
370  retval = octave_value ("Rectangular");
371  }
372  else if (typ == MatrixType::Full)
373  retval = octave_value ("Full");
374  else
375  retval = octave_value ("Unknown");
376  }
377  else
378  {
379  // Ok, we're changing the matrix type
380  std::string str_typ = args(1).xstring_value ("matrix_type: TYPE must be a string");
381 
382  // FIXME: why do I have to explicitly call the constructor?
383  MatrixType mattyp = MatrixType (MatrixType::Unknown, true);
384 
385  // Use STL function to convert to lower case
386  std::transform (str_typ.begin (), str_typ.end (),
387  str_typ.begin (), tolower);
388 
389  if (str_typ == "upper")
390  mattyp.mark_as_upper_triangular ();
391  else if (str_typ == "lower")
392  mattyp.mark_as_lower_triangular ();
393  else if (str_typ == "positive definite")
394  {
395  mattyp.mark_as_full ();
396  mattyp.mark_as_symmetric ();
397  }
398  else if (str_typ == "singular")
399  mattyp.mark_as_rectangular ();
400  else if (str_typ == "full")
401  mattyp.mark_as_full ();
402  else if (str_typ == "unknown")
403  mattyp.invalidate_type ();
404  else
405  error ("matrix_type: Unknown matrix type %s", str_typ.c_str ());
406 
407  if (nargin == 3 && (str_typ == "upper" || str_typ == "lower"))
408  {
409  const ColumnVector perm = args(2).xvector_value ("matrix_type: Invalid permutation vector PERM");
410 
411  octave_idx_type len = perm.numel ();
412  dim_vector dv = args(0).dims ();
413 
414  if (len != dv(0))
415  error ("matrix_type: Invalid permutation vector PERM");
416 
418 
419  for (octave_idx_type i = 0; i < len; i++)
420  p[i] = static_cast<octave_idx_type> (perm (i)) - 1;
421 
422  mattyp.mark_as_permuted (len, p);
423  }
424  else if (nargin != 2)
425  error ("matrix_type: Invalid number of arguments");
426 
427  // Set the matrix type
428  if (args(0).is_single_type ())
429  {
430  if (args(0).iscomplex ())
431  retval = octave_value (args(0).float_complex_matrix_value (),
432  mattyp);
433  else
434  retval = octave_value (args(0).float_matrix_value (),
435  mattyp);
436  }
437  else
438  {
439  if (args(0).iscomplex ())
440  retval = octave_value (args(0).complex_matrix_value (),
441  mattyp);
442  else
443  retval = octave_value (args(0).matrix_value (), mattyp);
444  }
445  }
446  }
447 
448  return retval;
449 }
450 
451 /*
452 ## FIXME:
453 ## Disable tests for lower under-determined and upper over-determined
454 ## matrices as this detection is disabled in MatrixType due to issues
455 ## of non minimum norm solution being found.
456 
457 %!assert (matrix_type (speye (10,10)), "Diagonal")
458 %!assert (matrix_type (speye (10,10)([2:10,1],:)), "Permuted Diagonal")
459 %!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1;sparse(9,1);1]]), "Upper")
460 %!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1;sparse(9,1);1]](:,[2,1,3:11])), "Permuted Upper")
461 %!assert (matrix_type ([speye(10,10),sparse(10,1);1,sparse(1,9),1]), "Lower")
462 %!assert (matrix_type ([speye(10,10),sparse(10,1);1,sparse(1,9),1]([2,1,3:11],:)), "Permuted Lower")
463 
464 %!test
465 %! bnd = spparms ("bandden");
466 %! spparms ("bandden", 0.5);
467 %! a = spdiags (rand (10,3)-0.5,[-1,0,1],10,10);
468 %! assert (matrix_type (a), "Tridiagonal");
469 %! assert (matrix_type (a'+a+2*speye (10)), "Tridiagonal Positive Definite");
470 %! spparms ("bandden", bnd);
471 %!test
472 %! bnd=spparms ("bandden");
473 %! spparms ("bandden", 0.5);
474 %! a = spdiags (randn (10,4),[-2:1],10,10);
475 %! assert (matrix_type (a), "Banded");
476 %! assert (matrix_type (a'*a), "Banded Positive Definite");
477 %! spparms ("bandden", bnd);
478 %!test
479 %! a = [speye(10,10),[sparse(9,1);1];-1,sparse(1,9),1];
480 %! assert (matrix_type (a), "Full");
481 %! assert (matrix_type (a'*a), "Positive Definite");
482 
483 %!assert (matrix_type (speye (10,11)), "Diagonal")
484 %!assert (matrix_type (speye (10,11)([2:10,1],:)), "Permuted Diagonal")
485 %!assert (matrix_type (speye (11,10)), "Diagonal")
486 %!assert (matrix_type (speye (11,10)([2:11,1],:)), "Permuted Diagonal")
487 %#!assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]]), "Upper")
488 %#!assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]](:,[2,1,3:12])), "Permuted Upper")
489 %!assert (matrix_type ([speye(11,9),[1;sparse(8,1);1;0]]), "Upper")
490 %!assert (matrix_type ([speye(11,9),[1;sparse(8,1);1;0]](:,[2,1,3:10])), "Permuted Upper")
491 %#!assert (matrix_type ([speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]), "Lower")
492 %#!assert (matrix_type ([speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]([2,1,3:12],:)), "Permuted Lower")
493 %!assert (matrix_type ([speye(9,11);[1,sparse(1,8),1,0]]), "Lower")
494 %!assert (matrix_type ([speye(9,11);[1,sparse(1,8),1,0]]([2,1,3:10],:)), "Permuted Lower")
495 %!assert (matrix_type (spdiags (randn (10,4),[-2:1],10,9)), "Rectangular")
496 
497 %!assert (matrix_type (1i*speye (10,10)), "Diagonal")
498 %!assert (matrix_type (1i*speye (10,10)([2:10,1],:)), "Permuted Diagonal")
499 %!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1i;sparse(9,1);1]]), "Upper")
500 %!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1i;sparse(9,1);1]](:,[2,1,3:11])), "Permuted Upper")
501 %!assert (matrix_type ([speye(10,10),sparse(10,1);1i,sparse(1,9),1]), "Lower")
502 %!assert (matrix_type ([speye(10,10),sparse(10,1);1i,sparse(1,9),1]([2,1,3:11],:)), "Permuted Lower")
503 
504 %!test
505 %! bnd = spparms ("bandden");
506 %! spparms ("bandden", 0.5);
507 %! assert (matrix_type (spdiags (1i*randn (10,3),[-1,0,1],10,10)), "Tridiagonal");
508 %! a = 1i*(rand (9,1)-0.5);
509 %! a = [[a;0],ones(10,1),[0;-a]];
510 %! assert (matrix_type (spdiags (a,[-1,0,1],10,10)), "Tridiagonal Positive Definite");
511 %! spparms ("bandden", bnd);
512 %!test
513 %! bnd = spparms ("bandden");
514 %! spparms ("bandden", 0.5);
515 %! assert (matrix_type (spdiags (1i*randn (10,4),[-2:1],10,10)), "Banded");
516 %! a = 1i*(rand (9,2)-0.5);
517 %! a = [[a;[0,0]],ones(10,1),[[0;-a(:,2)],[0;0;-a(1:8,1)]]];
518 %! assert (matrix_type (spdiags (a,[-2:2],10,10)), "Banded Positive Definite");
519 %! spparms ("bandden", bnd);
520 %!test
521 %! a = [speye(10,10),[sparse(9,1);1i];-1,sparse(1,9),1];
522 %! assert (matrix_type (a), "Full");
523 %! assert (matrix_type (a'*a), "Positive Definite");
524 
525 %!assert (matrix_type (1i*speye (10,11)), "Diagonal")
526 %!assert (matrix_type (1i*speye (10,11)([2:10,1],:)), "Permuted Diagonal")
527 %!assert (matrix_type (1i*speye (11,10)), "Diagonal")
528 %!assert (matrix_type (1i*speye (11,10)([2:11,1],:)), "Permuted Diagonal")
529 %#!assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1i,1i];sparse(9,2);[1i,1i]]]), "Upper")
530 %#!assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1i,1i];sparse(9,2);[1i,1i]]](:,[2,1,3:12])), "Permuted Upper")
531 %!assert (matrix_type ([speye(11,9),[1i;sparse(8,1);1i;0]]), "Upper")
532 %!assert (matrix_type ([speye(11,9),[1i;sparse(8,1);1i;0]](:,[2,1,3:10])), "Permuted Upper")
533 %#!assert (matrix_type ([speye(10,10),sparse(10,1);[1i;1i],sparse(2,9),[1i;1i]]), "Lower")
534 %#!assert (matrix_type ([speye(10,10),sparse(10,1);[1i;1i],sparse(2,9),[1i;1i]]([2,1,3:12],:)), "Permuted Lower")
535 %!assert (matrix_type ([speye(9,11);[1i,sparse(1,8),1i,0]]), "Lower")
536 %!assert (matrix_type ([speye(9,11);[1i,sparse(1,8),1i,0]]([2,1,3:10],:)), "Permuted Lower")
537 %!assert (matrix_type (1i*spdiags(randn(10,4),[-2:1],10,9)), "Rectangular")
538 
539 %!test
540 %! a = matrix_type (spdiags (randn (10,3),[-1,0,1],10,10), "Singular");
541 %! assert (matrix_type (a), "Singular");
542 
543 %!assert (matrix_type (triu (ones(10,10))), "Upper")
544 %!assert (matrix_type (triu (ones(10,10),-1)), "Full")
545 %!assert (matrix_type (tril (ones(10,10))), "Lower")
546 %!assert (matrix_type (tril (ones(10,10),1)), "Full")
547 %!assert (matrix_type (10*eye (10,10) + ones (10,10)), "Positive Definite")
548 %!assert (matrix_type (ones (11,10)), "Rectangular")
549 %!test
550 %! a = matrix_type (ones (10,10), "Singular");
551 %! assert (matrix_type (a), "Singular");
552 
553 %!assert (matrix_type (triu (1i*ones (10,10))), "Upper")
554 %!assert (matrix_type (triu (1i*ones (10,10),-1)), "Full")
555 %!assert (matrix_type (tril (1i*ones (10,10))), "Lower")
556 %!assert (matrix_type (tril (1i*ones (10,10),1)), "Full")
557 %!assert (matrix_type (10*eye (10,10) + 1i*triu (ones (10,10),1) -1i*tril (ones (10,10),-1)), "Positive Definite")
558 %!assert (matrix_type (ones (11,10)), "Rectangular")
559 %!test
560 %! a = matrix_type (ones (10,10), "Singular");
561 %! assert (matrix_type (a), "Singular");
562 */
octave_idx_type numel(void) const
Number of elements in the array.
Definition: Array.h:377
void mark_as_full(void)
Definition: MatrixType.h:158
void invalidate_type(void)
Definition: MatrixType.h:143
void mark_as_permuted_diagonal(void)
Definition: MatrixType.h:147
void mark_as_rectangular(void)
Definition: MatrixType.h:160
@ Tridiagonal_Hermitian
Definition: MatrixType.h:59
@ Permuted_Lower
Definition: MatrixType.h:54
@ Banded_Hermitian
Definition: MatrixType.h:57
@ Permuted_Diagonal
Definition: MatrixType.h:50
@ Permuted_Upper
Definition: MatrixType.h:53
void mark_as_permuted(const octave_idx_type np, const octave_idx_type *p)
Definition: MatrixType.cc:929
bool is_unknown(void) const
Definition: MatrixType.h:137
void mark_as_upper_triangular(void)
Definition: MatrixType.h:149
void mark_as_banded(const octave_idx_type ku, const octave_idx_type kl)
Definition: MatrixType.h:155
void mark_as_lower_triangular(void)
Definition: MatrixType.h:151
void mark_as_tridiagonal(void)
Definition: MatrixType.h:153
int type(bool quiet=true)
Definition: MatrixType.cc:653
void mark_as_diagonal(void)
Definition: MatrixType.h:145
void mark_as_symmetric(void)
Definition: MatrixType.cc:900
Definition: dMatrix.h:42
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:95
OCTINTERP_API void print_usage(void)
Definition: defun.cc:53
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
Definition: defun.h:56
void error(const char *fmt,...)
Definition: error.cc:968
ColumnVector transform(const Matrix &m, double x, double y, double z)
Definition: graphics.cc:5814
T octave_idx_type m
Definition: mx-inlines.cc:773
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
Definition: oct-locbuf.h:44
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
octave_value::octave_value(const Array< char > &chm, char type) return retval
Definition: ov.cc:811
F77_RET_T len
Definition: xerbla.cc:61