10360
|
1 ## Helpful macros for debugging Octave. |
|
2 |
|
3 ## Display a dim-vector object. |
|
4 |
|
5 define display-dims |
|
6 echo ndims: \ |
|
7 output $arg0.rep[-1] |
|
8 echo \ndims: \ |
|
9 output *$arg0.rep@$arg0.rep[-1] |
|
10 echo \n |
|
11 dont-repeat |
|
12 end |
|
13 |
|
14 ## Display a dense array object. |
|
15 |
|
16 define display-dense-array |
|
17 echo array object: \ |
|
18 output $arg0 |
|
19 echo \ndimensions:\n |
|
20 display-dims $arg0.dimensions |
|
21 echo \nrep = \ |
|
22 output *$arg0.rep |
|
23 echo \nrep.data = \ |
|
24 output *$arg0.rep.data@$arg0.rep.len |
|
25 echo \n |
|
26 dont-repeat |
|
27 end |
|
28 |
|
29 ## Display a sparse array object. |
|
30 |
|
31 define display-sparse-array |
|
32 echo sparse object: \ |
|
33 output $arg0 |
|
34 echo \ndimensions.rep[0] = \ |
|
35 display-dims $arg0.dimensions |
|
36 echo \ndimensions.rep[1] = \ |
|
37 output $arg0.dimensions.rep[1] |
|
38 echo \nrep = \ |
|
39 output *$arg0.rep |
|
40 echo \nrep.d = \ |
|
41 output *$arg0.rep.d@$arg0.rep.nzmx |
|
42 echo \nrep.r = \ |
|
43 output *$arg0.rep.r@$arg0.rep.nzmx |
|
44 echo \nrep.c = \ |
|
45 output *$arg0.rep.c@($arg0.rep.ncols+1) |
|
46 echo \n |
|
47 dont-repeat |
|
48 end |