comparison src/DLD-FUNCTIONS/symbfact.cc @ 11553:01f703952eff

Improve docstrings for functions in DLD-FUNCTIONS directory. Use same variable names in error() strings and in documentation.
author Rik <octave@nomad.inbox5.com>
date Sun, 16 Jan 2011 22:13:23 -0800
parents fd0a3ac60b0e
children 12df7854fa7c
comparison
equal deleted inserted replaced
11552:6b6e9051ecb8 11553:01f703952eff
39 #include "oct-obj.h" 39 #include "oct-obj.h"
40 #include "utils.h" 40 #include "utils.h"
41 41
42 DEFUN_DLD (symbfact, args, nargout, 42 DEFUN_DLD (symbfact, args, nargout,
43 "-*- texinfo -*-\n\ 43 "-*- texinfo -*-\n\
44 @deftypefn {Loadable Function} {[@var{count}, @var{h}, @var{parent}, @var{post}, @var{r}] =} symbfact (@var{s}, @var{typ}, @var{mode})\n\ 44 @deftypefn {Loadable Function} {[@var{count}, @var{h}, @var{parent}, @var{post}, @var{r}] =} symbfact (@var{S})\n\
45 \n\ 45 @deftypefnx {Loadable Function} {[@dots{}] =} symbfact (@var{S}, @var{typ})\n\
46 Performs a symbolic factorization analysis on the sparse matrix @var{s}.\n\ 46 @deftypefnx {Loadable Function} {[@dots{}] =} symbfact (@var{S}, @var{typ}, @var{mode})\n\
47 \n\
48 Perform a symbolic factorization analysis on the sparse matrix @var{S}.\n\
47 Where\n\ 49 Where\n\
48 \n\ 50 \n\
49 @table @asis\n\ 51 @table @var\n\
50 @item @var{s}\n\ 52 @item S\n\
51 @var{s} is a complex or real sparse matrix.\n\ 53 @var{S} is a complex or real sparse matrix.\n\
52 \n\ 54 \n\
53 @item @var{typ}\n\ 55 @item typ\n\
54 Is the type of the factorization and can be one of\n\ 56 Is the type of the factorization and can be one of\n\
55 \n\ 57 \n\
56 @table @code\n\ 58 @table @samp\n\
57 @item sym\n\ 59 @item sym\n\
58 Factorize @var{s}. This is the default.\n\ 60 Factorize @var{S}. This is the default.\n\
59 \n\ 61 \n\
60 @item col\n\ 62 @item col\n\
61 Factorize @code{@var{s}' * @var{s}}.\n\ 63 Factorize @code{@var{S}' * @var{S}}.\n\
62 \n\ 64 \n\
63 @item row\n\ 65 @item row\n\
64 Factorize @code{@var{s} * @var{s}'}.\n\ 66 Factorize @code{@var{S} * @var{S}'}.\n\
65 \n\ 67 \n\
66 @item lo\n\ 68 @item lo\n\
67 Factorize @code{@var{s}'}\n\ 69 Factorize @code{@var{S}'}\n\
68 @end table\n\ 70 @end table\n\
69 \n\ 71 \n\
70 @item @var{mode}\n\ 72 @item mode\n\
71 The default is to return the Cholesky factorization for @var{r}, and if\n\ 73 The default is to return the Cholesky@tie{}factorization for @var{r}, and if\n\
72 @var{mode} is 'L', the conjugate transpose of the Cholesky factorization\n\ 74 @var{mode} is 'L', the conjugate transpose of the Cholesky@tie{}factorization\n\
73 is returned. The conjugate transpose version is faster and uses less\n\ 75 is returned. The conjugate transpose version is faster and uses less\n\
74 memory, but returns the same values for @var{count}, @var{h}, @var{parent}\n\ 76 memory, but returns the same values for @var{count}, @var{h}, @var{parent}\n\
75 and @var{post} outputs.\n\ 77 and @var{post} outputs.\n\
76 @end table\n\ 78 @end table\n\
77 \n\ 79 \n\
78 The output variables are\n\ 80 The output variables are\n\
79 \n\ 81 \n\
80 @table @asis\n\ 82 @table @var\n\
81 @item @var{count}\n\ 83 @item count\n\
82 The row counts of the Cholesky factorization as determined by @var{typ}.\n\ 84 The row counts of the Cholesky@tie{}factorization as determined by @var{typ}.\n\
83 \n\ 85 \n\
84 @item @var{h}\n\ 86 @item h\n\
85 The height of the elimination tree.\n\ 87 The height of the elimination tree.\n\
86 \n\ 88 \n\
87 @item @var{parent}\n\ 89 @item parent\n\
88 The elimination tree itself.\n\ 90 The elimination tree itself.\n\
89 \n\ 91 \n\
90 @item @var{post}\n\ 92 @item post\n\
91 A sparse boolean matrix whose structure is that of the Cholesky\n\ 93 A sparse boolean matrix whose structure is that of the Cholesky\n\
92 factorization as determined by @var{typ}.\n\ 94 factorization as determined by @var{typ}.\n\
93 @end table\n\ 95 @end table\n\
94 @end deftypefn") 96 @end deftypefn")
95 { 97 {
187 else if (ch == 's') 189 else if (ch == 's')
188 A->stype = 1; 190 A->stype = 1;
189 else if (ch == 's') 191 else if (ch == 's')
190 A->stype = -1; 192 A->stype = -1;
191 else 193 else
192 error ("Unrecognized typ in symbolic factorization"); 194 error ("symbfact: unrecognized TYP in symbolic factorization");
193 } 195 }
194 196
195 if (A->stype && A->nrow != A->ncol) 197 if (A->stype && A->nrow != A->ncol)
196 error ("Matrix must be square"); 198 error ("symbfact: S must be a square matrix");
197 199
198 if (!error_state) 200 if (!error_state)
199 { 201 {
200 OCTAVE_LOCAL_BUFFER (octave_idx_type, Parent, n); 202 OCTAVE_LOCAL_BUFFER (octave_idx_type, Parent, n);
201 OCTAVE_LOCAL_BUFFER (octave_idx_type, Post, n); 203 OCTAVE_LOCAL_BUFFER (octave_idx_type, Post, n);