comparison src/DLD-FUNCTIONS/colamd.cc @ 5297:234abf4c74dd

[project @ 2005-04-21 21:29:46 by jwe]
author jwe
date Thu, 21 Apr 2005 21:31:26 +0000
parents 57077d0ddc8e
children 4c8a2e4e0717
comparison
equal deleted inserted replaced
5296:4e753a157ed2 5297:234abf4c74dd
36 #include "pager.h" 36 #include "pager.h"
37 #include "ov-re-mat.h" 37 #include "ov-re-mat.h"
38 38
39 #include "ov-re-sparse.h" 39 #include "ov-re-sparse.h"
40 #include "ov-cx-sparse.h" 40 #include "ov-cx-sparse.h"
41
42 #if SIZEOF_INT == SIZEOF_OCTAVE_IDX_TYPE
41 43
42 // External COLAMD functions in C 44 // External COLAMD functions in C
43 extern "C" { 45 extern "C" {
44 #include "COLAMD/colamd.h" 46 #include "COLAMD/colamd.h"
45 } 47 }
185 root[cset] = col; 187 root[cset] = col;
186 } 188 }
187 } 189 }
188 } 190 }
189 } 191 }
192
193 #endif
190 194
191 DEFUN_DLD (colamd, args, nargout, 195 DEFUN_DLD (colamd, args, nargout,
192 "-*- texinfo -*-\n\ 196 "-*- texinfo -*-\n\
193 @deftypefn {Loadable Function} {@var{p} =} colamd (@var{s})\n\ 197 @deftypefn {Loadable Function} {@var{p} =} colamd (@var{s})\n\
194 @deftypefnx {Loadable Function} {@var{p} =} colamd (@var{s}, @var{knobs})\n\ 198 @deftypefnx {Loadable Function} {@var{p} =} colamd (@var{s}, @var{knobs})\n\
254 @url{http://www.cise.ufl.edu/research/sparse/colamd})\n\ 258 @url{http://www.cise.ufl.edu/research/sparse/colamd})\n\
255 @end deftypefn\n\ 259 @end deftypefn\n\
256 @seealso{colperm, symamd}") 260 @seealso{colperm, symamd}")
257 { 261 {
258 octave_value_list retval; 262 octave_value_list retval;
263
264 #if SIZEOF_INT == SIZEOF_OCTAVE_IDX_TYPE
265
259 int nargin = args.length (); 266 int nargin = args.length ();
260 int spumoni = 0; 267 int spumoni = 0;
261 268
262 if (nargout < 0 || nargout > 2 || nargin < 0 || nargin > 2) 269 if (nargout < 0 || nargout > 2 || nargin < 0 || nargin > 2)
263 usage ("colamd: incorrect number of input and/or output arguments"); 270 usage ("colamd: incorrect number of input and/or output arguments");
390 // occur if symamd returns FALSE 397 // occur if symamd returns FALSE
391 out_stats (COLAMD_INFO1) ++ ; 398 out_stats (COLAMD_INFO1) ++ ;
392 out_stats (COLAMD_INFO2) ++ ; 399 out_stats (COLAMD_INFO2) ++ ;
393 } 400 }
394 } 401 }
402
403 #else
404
405 error ("colamd: not available in this version of Octave");
406
407 #endif
395 408
396 return retval; 409 return retval;
397 } 410 }
398 411
399 DEFUN_DLD (symamd, args, nargout, 412 DEFUN_DLD (symamd, args, nargout,
459 @url{http://www.cise.ufl.edu/research/sparse/colamd})\n\ 472 @url{http://www.cise.ufl.edu/research/sparse/colamd})\n\
460 @end deftypefn\n\ 473 @end deftypefn\n\
461 @seealso{colperm, colamd}") 474 @seealso{colperm, colamd}")
462 { 475 {
463 octave_value_list retval; 476 octave_value_list retval;
477
478 #if SIZEOF_INT == SIZEOF_OCTAVE_IDX_TYPE
479
464 int nargin = args.length (); 480 int nargin = args.length ();
465 int spumoni = 0; 481 int spumoni = 0;
466 482
467 if (nargout < 0 || nargout > 2 || nargin < 0 || nargin > 2) 483 if (nargout < 0 || nargout > 2 || nargin < 0 || nargin > 2)
468 usage ("symamd: incorrect number of input and/or output arguments"); 484 usage ("symamd: incorrect number of input and/or output arguments");
578 out_stats (COLAMD_INFO1) ++ ; 594 out_stats (COLAMD_INFO1) ++ ;
579 out_stats (COLAMD_INFO2) ++ ; 595 out_stats (COLAMD_INFO2) ++ ;
580 } 596 }
581 } 597 }
582 598
599 #else
600
601 error ("symamd: not available in this version of Octave");
602
603 #endif
604
583 return retval; 605 return retval;
584 } 606 }
585 607
586 DEFUN_DLD (etree, args, nargout, 608 DEFUN_DLD (etree, args, nargout,
587 "-*- texinfo -*-\n\ 609 "-*- texinfo -*-\n\
598 Called with a second argument, @dfn{etree} also returns the postorder\n\ 620 Called with a second argument, @dfn{etree} also returns the postorder\n\
599 permutations on the tree.\n\ 621 permutations on the tree.\n\
600 @end deftypefn") 622 @end deftypefn")
601 { 623 {
602 octave_value_list retval; 624 octave_value_list retval;
625
626 #if SIZEOF_INT == SIZEOF_OCTAVE_IDX_TYPE
627
603 int nargin = args.length (); 628 int nargin = args.length ();
604 629
605 if (nargout < 0 || nargout > 2 || nargin < 0 || nargin > 2) 630 if (nargout < 0 || nargout > 2 || nargin < 0 || nargin > 2)
606 usage ("etree: incorrect number of input and/or output arguments"); 631 usage ("etree: incorrect number of input and/or output arguments");
607 else 632 else
703 728
704 retval (1) = postorder; 729 retval (1) = postorder;
705 } 730 }
706 } 731 }
707 732
733 #else
734
735 error ("etree: not available in this version of Octave");
736
737 #endif
738
708 return retval; 739 return retval;
709 } 740 }
710 741
711 DEFUN_DLD (symbfact, args, nargout, 742 DEFUN_DLD (symbfact, args, nargout,
712 "-*- texinfo -*-\n\ 743 "-*- texinfo -*-\n\