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