1
|
1 // pr-output.cc -*- C++ -*- |
|
2 /* |
|
3 |
1009
|
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
1
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
240
|
24 #ifdef HAVE_CONFIG_H |
1192
|
25 #include <config.h> |
1
|
26 #endif |
|
27 |
|
28 #include <iostream.h> |
|
29 #include <strstream.h> |
|
30 #include <string.h> |
|
31 #include <math.h> |
|
32 #include <float.h> |
|
33 #include <Complex.h> |
|
34 |
453
|
35 #include "dMatrix.h" |
|
36 #include "CMatrix.h" |
1
|
37 #include "Range.h" |
|
38 |
|
39 #include "tree-const.h" |
|
40 #include "variables.h" |
|
41 #include "user-prefs.h" |
|
42 #include "pr-output.h" |
|
43 #include "mappers.h" |
|
44 #include "pager.h" |
542
|
45 #include "help.h" |
1
|
46 #include "error.h" |
|
47 #include "utils.h" |
529
|
48 #include "defun.h" |
1
|
49 |
|
50 // Current format string for real numbers and the real part of complex |
|
51 // numbers. |
529
|
52 static char *curr_real_fmt = 0; |
1
|
53 |
|
54 // Current format string for the imaginary part of complex numbers. |
529
|
55 static char *curr_imag_fmt = 0; |
1
|
56 |
1186
|
57 // Nonzero means don't do any fancy formatting. |
1
|
58 static int free_format = 0; |
|
59 |
|
60 // Nonzero means print plus sign for nonzero, blank for zero. |
|
61 static int plus_format = 0; |
|
62 |
1186
|
63 // Nonzero means don't put newlines around the column number headers. |
|
64 static int compact_format = 0; |
|
65 |
1
|
66 // Nonzero means always print like dollars and cents. |
|
67 static int bank_format = 0; |
|
68 |
|
69 // Nonzero means use an e format. |
|
70 static int print_e = 0; |
|
71 |
|
72 // Nonzero means print E instead of e for exponent field. |
|
73 static int print_big_e = 0; |
|
74 |
|
75 static int |
|
76 any_element_is_negative (const Matrix& a) |
|
77 { |
|
78 int nr = a.rows (); |
|
79 int nc = a.columns (); |
|
80 for (int j = 0; j < nc; j++) |
|
81 for (int i = 0; i < nr; i++) |
|
82 if (a.elem (i, j) < 0.0) |
|
83 return 1; |
|
84 return 0; |
|
85 } |
|
86 |
|
87 static int |
|
88 any_element_is_inf_or_nan (const Matrix& a) |
|
89 { |
|
90 int nr = a.rows (); |
|
91 int nc = a.columns (); |
|
92 for (int j = 0; j < nc; j++) |
|
93 for (int i = 0; i < nr; i++) |
|
94 { |
|
95 double val = a.elem (i, j); |
|
96 if (xisinf (val) || xisnan (val)) |
|
97 return 1; |
|
98 } |
|
99 return 0; |
|
100 } |
|
101 |
|
102 static int |
|
103 any_element_is_inf_or_nan (const ComplexMatrix& a) |
|
104 { |
|
105 int nr = a.rows (); |
|
106 int nc = a.columns (); |
|
107 for (int j = 0; j < nc; j++) |
|
108 for (int i = 0; i < nr; i++) |
|
109 { |
|
110 Complex val = a.elem (i, j); |
|
111 if (xisinf (val) || xisnan (val)) |
|
112 return 1; |
|
113 } |
|
114 return 0; |
|
115 } |
|
116 |
|
117 static int |
|
118 all_elements_are_int_or_inf_or_nan (const Matrix& a) |
|
119 { |
|
120 int nr = a.rows (); |
|
121 int nc = a.columns (); |
|
122 for (int j = 0; j < nc; j++) |
|
123 for (int i = 0; i < nr; i++) |
|
124 { |
|
125 double val = a.elem (i, j); |
|
126 if (xisnan (val) || D_NINT (val) == val) |
|
127 continue; |
|
128 else |
|
129 return 0; |
|
130 } |
|
131 return 1; |
|
132 } |
|
133 |
|
134 static Matrix |
|
135 abs (const Matrix& a) |
|
136 { |
|
137 int nr = a.rows (); |
|
138 int nc = a.columns (); |
|
139 Matrix retval (nr, nc); |
|
140 for (int j = 0; j < nc; j++) |
|
141 for (int i = 0; i < nr; i++) |
|
142 retval.elem (i, j) = fabs (a.elem (i, j)); |
|
143 return retval; |
|
144 } |
|
145 |
|
146 static double |
164
|
147 pr_max_internal (const Matrix& m) |
1
|
148 { |
|
149 int nr = m.rows (); |
|
150 int nc = m.columns (); |
|
151 |
|
152 double result = DBL_MIN; |
|
153 |
|
154 for (int j = 0; j < nc; j++) |
|
155 for (int i = 0; i < nr; i++) |
|
156 { |
|
157 double val = m.elem (i, j); |
|
158 if (xisinf (val) || xisnan (val)) |
|
159 continue; |
|
160 |
|
161 if (val > result) |
|
162 result = val; |
|
163 } |
|
164 return result; |
|
165 } |
|
166 |
|
167 static double |
164
|
168 pr_min_internal (const Matrix& m) |
1
|
169 { |
|
170 int nr = m.rows (); |
|
171 int nc = m.columns (); |
|
172 |
|
173 double result = DBL_MAX; |
|
174 |
|
175 for (int j = 0; j < nc; j++) |
|
176 for (int i = 0; i < nr; i++) |
|
177 { |
|
178 double val = m.elem (i, j); |
|
179 if (xisinf (val) || xisnan (val)) |
|
180 continue; |
|
181 |
|
182 if (val < result) |
|
183 result = val; |
|
184 } |
|
185 return result; |
|
186 } |
|
187 |
|
188 static void |
|
189 set_format (double d, int& fw) |
|
190 { |
529
|
191 curr_real_fmt = 0; |
|
192 curr_imag_fmt = 0; |
1
|
193 |
|
194 if (free_format) |
|
195 return; |
|
196 |
278
|
197 static char fmt_buf[128]; |
1
|
198 |
|
199 int sign = (d < 0.0); |
|
200 |
|
201 int inf_or_nan = (xisinf (d) || xisnan (d)); |
|
202 |
|
203 double d_abs = d < 0.0 ? -d : d; |
|
204 |
575
|
205 int digits = (inf_or_nan || d_abs == 0.0) ? 0 |
|
206 : (int) floor (log10 (d_abs) + 1.0); |
1
|
207 |
|
208 int prec = user_pref.output_precision; |
|
209 |
|
210 int ld, rd; |
|
211 |
|
212 if (bank_format) |
|
213 { |
|
214 fw = digits < 0 ? 4 : digits + 3; |
|
215 if (inf_or_nan && fw < 3) |
|
216 fw = 3; |
|
217 fw += sign; |
|
218 rd = 2; |
|
219 } |
|
220 else if (xisnan (d) || D_NINT (d) == d) |
|
221 { |
|
222 fw = digits; |
|
223 if (inf_or_nan && fw < 3) |
|
224 fw = 3; |
|
225 fw += sign; |
|
226 rd = 0; |
|
227 } |
|
228 else |
|
229 { |
|
230 if (digits > 0) |
|
231 { |
|
232 ld = digits; |
|
233 rd = prec - digits; |
|
234 digits++; |
|
235 } |
|
236 else |
|
237 { |
|
238 ld = 1; |
|
239 rd = prec - digits; |
|
240 digits = -digits + 1; |
|
241 } |
|
242 |
|
243 fw = ld + 1 + rd; |
|
244 if (inf_or_nan && fw < 3) |
|
245 fw = 3; |
|
246 fw += sign; |
|
247 } |
|
248 |
|
249 if (! bank_format && (fw > user_pref.output_max_field_width || print_e)) |
|
250 { |
|
251 int exp_field = 4; |
|
252 if (digits > 100) |
|
253 exp_field++; |
|
254 |
|
255 fw = 2 + prec + exp_field; |
|
256 if (inf_or_nan && fw < 3) |
|
257 fw = 3; |
|
258 fw += sign; |
|
259 |
|
260 if (print_big_e) |
|
261 sprintf (fmt_buf, "%%%d.%dE", fw, prec - 1); |
|
262 else |
|
263 sprintf (fmt_buf, "%%%d.%de", fw, prec - 1); |
|
264 } |
|
265 else |
|
266 { |
|
267 sprintf (fmt_buf, "%%%d.%df", fw, rd); |
|
268 } |
|
269 |
|
270 curr_real_fmt = &fmt_buf[0]; |
|
271 } |
|
272 |
|
273 static inline void |
|
274 set_format (double d) |
|
275 { |
|
276 int fw; |
|
277 set_format (d, fw); |
|
278 } |
|
279 |
|
280 static void |
164
|
281 set_format (const Matrix& m, int& fw) |
1
|
282 { |
529
|
283 curr_real_fmt = 0; |
|
284 curr_imag_fmt = 0; |
1
|
285 |
|
286 if (free_format) |
|
287 return; |
|
288 |
278
|
289 static char fmt_buf[128]; |
1
|
290 |
|
291 int sign = any_element_is_negative (m); |
|
292 |
|
293 int inf_or_nan = any_element_is_inf_or_nan (m); |
|
294 |
|
295 Matrix m_abs = abs (m); |
|
296 double max_abs = pr_max_internal (m_abs); |
|
297 double min_abs = pr_min_internal (m_abs); |
|
298 |
|
299 int x_max = max_abs == 0.0 ? 0 : (int) floor (log10 (max_abs) + 1.0); |
|
300 int x_min = min_abs == 0.0 ? 0 : (int) floor (log10 (min_abs) + 1.0); |
|
301 |
|
302 int prec = user_pref.output_precision; |
|
303 |
|
304 int ld, rd; |
|
305 |
|
306 if (bank_format) |
|
307 { |
|
308 int digits = x_max > x_min ? x_max : x_min; |
|
309 fw = digits <= 0 ? 4 : digits + 3; |
|
310 if (inf_or_nan && fw < 3) |
|
311 fw = 3; |
|
312 fw += sign; |
|
313 rd = 2; |
|
314 } |
|
315 else if (all_elements_are_int_or_inf_or_nan (m)) |
|
316 { |
|
317 int digits = x_max > x_min ? x_max : x_min; |
|
318 fw = digits <= 0 ? 1 : digits; |
|
319 if (inf_or_nan && fw < 3) |
|
320 fw = 3; |
|
321 fw += sign; |
|
322 rd = 0; |
|
323 } |
|
324 else |
|
325 { |
|
326 int ld_max, rd_max; |
|
327 if (x_max > 0) |
|
328 { |
|
329 ld_max = x_max; |
|
330 rd_max = prec - x_max; |
|
331 x_max++; |
|
332 } |
|
333 else |
|
334 { |
|
335 ld_max = 1; |
|
336 rd_max = prec - x_max; |
|
337 x_max = -x_max + 1; |
|
338 } |
|
339 |
|
340 int ld_min, rd_min; |
|
341 if (x_min > 0) |
|
342 { |
|
343 ld_min = x_min; |
|
344 rd_min = prec - x_min; |
|
345 x_min++; |
|
346 } |
|
347 else |
|
348 { |
|
349 ld_min = 1; |
|
350 rd_min = prec - x_min; |
|
351 x_min = -x_min + 1; |
|
352 } |
|
353 |
|
354 ld = ld_max > ld_min ? ld_max : ld_min; |
|
355 rd = rd_max > rd_min ? rd_max : rd_min; |
|
356 |
|
357 fw = ld + 1 + rd; |
|
358 if (inf_or_nan && fw < 3) |
|
359 fw = 3; |
|
360 fw += sign; |
|
361 } |
|
362 |
|
363 if (! bank_format && (fw > user_pref.output_max_field_width || print_e)) |
|
364 { |
|
365 int exp_field = 4; |
|
366 if (x_max > 100 || x_min > 100) |
|
367 exp_field++; |
|
368 |
|
369 fw = 2 + prec + exp_field; |
|
370 if (inf_or_nan && fw < 3) |
|
371 fw = 3; |
|
372 fw += sign; |
|
373 |
|
374 if (print_big_e) |
|
375 sprintf (fmt_buf, "%%%d.%dE", fw, prec - 1); |
|
376 else |
|
377 sprintf (fmt_buf, "%%%d.%de", fw, prec - 1); |
|
378 } |
|
379 else |
|
380 { |
|
381 sprintf (fmt_buf, "%%%d.%df", fw, rd); |
|
382 } |
|
383 |
|
384 curr_real_fmt = &fmt_buf[0]; |
|
385 } |
|
386 |
|
387 static inline void |
164
|
388 set_format (const Matrix& m) |
1
|
389 { |
|
390 int fw; |
|
391 set_format (m, fw); |
|
392 } |
|
393 |
|
394 static void |
164
|
395 set_format (const Complex& c, int& r_fw, int& i_fw) |
1
|
396 { |
529
|
397 curr_real_fmt = 0; |
|
398 curr_imag_fmt = 0; |
1
|
399 |
|
400 if (free_format) |
|
401 return; |
|
402 |
278
|
403 static char r_fmt_buf[128]; |
|
404 static char i_fmt_buf[128]; |
1
|
405 |
|
406 double rp = c.real (); |
|
407 double ip = c.imag (); |
|
408 |
|
409 int sign = (rp < 0.0); |
|
410 |
|
411 int inf_or_nan = (xisinf (c) || xisnan (c)); |
|
412 |
|
413 double r_abs = rp < 0.0 ? -rp : rp; |
|
414 double i_abs = ip < 0.0 ? -ip : ip; |
|
415 |
|
416 int r_x = r_abs == 0.0 ? 0 : (int) floor (log10 (r_abs) + 1.0); |
|
417 int i_x = i_abs == 0.0 ? 0 : (int) floor (log10 (i_abs) + 1.0); |
|
418 |
|
419 int x_max, x_min; |
|
420 |
|
421 if (r_x > i_x) |
|
422 { |
|
423 x_max = r_x; |
|
424 x_min = i_x; |
|
425 } |
|
426 else |
|
427 { |
|
428 x_max = i_x; |
|
429 x_min = r_x; |
|
430 } |
|
431 |
|
432 int prec = user_pref.output_precision; |
|
433 |
|
434 int ld, rd; |
|
435 |
|
436 if (bank_format) |
|
437 { |
|
438 int digits = r_x; |
|
439 i_fw = 0; |
|
440 r_fw = digits <= 0 ? 4 : digits + 3; |
|
441 if (inf_or_nan && r_fw < 3) |
|
442 r_fw = 3; |
|
443 r_fw += sign; |
|
444 rd = 2; |
|
445 } |
|
446 else if (inf_or_nan || (D_NINT (rp) == rp && D_NINT (ip) == ip)) |
|
447 { |
|
448 int digits = x_max > x_min ? x_max : x_min; |
|
449 i_fw = r_fw = digits <= 0 ? 1 : digits; |
|
450 if (inf_or_nan && i_fw < 3) |
|
451 i_fw = r_fw = 3; |
|
452 r_fw += sign; |
|
453 rd = 0; |
|
454 } |
|
455 else |
|
456 { |
|
457 int ld_max, rd_max; |
|
458 if (x_max > 0) |
|
459 { |
|
460 ld_max = x_max; |
|
461 rd_max = prec - x_max; |
|
462 x_max++; |
|
463 } |
|
464 else |
|
465 { |
|
466 ld_max = 1; |
|
467 rd_max = prec - x_max; |
|
468 x_max = -x_max + 1; |
|
469 } |
|
470 |
|
471 int ld_min, rd_min; |
|
472 if (x_min > 0) |
|
473 { |
|
474 ld_min = x_min; |
|
475 rd_min = prec - x_min; |
|
476 x_min++; |
|
477 } |
|
478 else |
|
479 { |
|
480 ld_min = 1; |
|
481 rd_min = prec - x_min; |
|
482 x_min = -x_min + 1; |
|
483 } |
|
484 |
|
485 ld = ld_max > ld_min ? ld_max : ld_min; |
|
486 rd = rd_max > rd_min ? rd_max : rd_min; |
|
487 |
|
488 i_fw = r_fw = ld + 1 + rd; |
|
489 if (inf_or_nan && i_fw < 3) |
|
490 i_fw = r_fw = 3; |
|
491 r_fw += sign; |
|
492 } |
|
493 |
|
494 if (! bank_format && (r_fw > user_pref.output_max_field_width || print_e)) |
|
495 { |
|
496 int exp_field = 4; |
|
497 if (x_max > 100 || x_min > 100) |
|
498 exp_field++; |
|
499 |
|
500 i_fw = r_fw = 1 + prec + exp_field; |
|
501 if (inf_or_nan && i_fw < 3) |
|
502 i_fw = r_fw = 3; |
|
503 r_fw += sign; |
|
504 |
|
505 if (print_big_e) |
|
506 { |
|
507 sprintf (r_fmt_buf, "%%%d.%dE", r_fw, prec - 1); |
|
508 sprintf (i_fmt_buf, "%%%d.%dE", i_fw, prec - 1); |
|
509 } |
|
510 else |
|
511 { |
|
512 sprintf (r_fmt_buf, "%%%d.%de", r_fw, prec - 1); |
|
513 sprintf (i_fmt_buf, "%%%d.%de", i_fw, prec - 1); |
|
514 } |
|
515 } |
|
516 else |
|
517 { |
|
518 sprintf (r_fmt_buf, "%%%d.%df", r_fw, rd); |
|
519 sprintf (i_fmt_buf, "%%%d.%df", i_fw, rd); |
|
520 } |
|
521 |
|
522 curr_real_fmt = &r_fmt_buf[0]; |
|
523 curr_imag_fmt = &i_fmt_buf[0]; |
|
524 } |
|
525 |
|
526 static inline void |
164
|
527 set_format (const Complex& c) |
1
|
528 { |
|
529 int r_fw, i_fw; |
|
530 set_format (c, r_fw, i_fw); |
|
531 } |
|
532 |
|
533 static void |
164
|
534 set_format (const ComplexMatrix& cm, int& r_fw, int& i_fw) |
1
|
535 { |
529
|
536 curr_real_fmt = 0; |
|
537 curr_imag_fmt = 0; |
1
|
538 |
|
539 if (free_format) |
|
540 return; |
|
541 |
278
|
542 static char r_fmt_buf[128]; |
|
543 static char i_fmt_buf[128]; |
1
|
544 |
|
545 Matrix rp = real (cm); |
|
546 Matrix ip = imag (cm); |
|
547 |
|
548 int sign = any_element_is_negative (rp); |
|
549 |
|
550 int inf_or_nan = any_element_is_inf_or_nan (cm); |
|
551 |
|
552 Matrix r_m_abs = abs (rp); |
|
553 double r_max_abs = pr_max_internal (r_m_abs); |
|
554 double r_min_abs = pr_min_internal (r_m_abs); |
|
555 |
|
556 Matrix i_m_abs = abs (ip); |
|
557 double i_max_abs = pr_max_internal (i_m_abs); |
|
558 double i_min_abs = pr_min_internal (i_m_abs); |
|
559 |
|
560 int r_x_max = r_max_abs == 0.0 ? 0 : (int) floor (log10 (r_max_abs) + 1.0); |
|
561 int r_x_min = r_min_abs == 0.0 ? 0 : (int) floor (log10 (r_min_abs) + 1.0); |
|
562 |
|
563 int i_x_max = i_max_abs == 0.0 ? 0 : (int) floor (log10 (i_max_abs) + 1.0); |
|
564 int i_x_min = i_min_abs == 0.0 ? 0 : (int) floor (log10 (i_min_abs) + 1.0); |
|
565 |
|
566 int x_max = r_x_max > i_x_max ? r_x_max : i_x_max; |
|
567 int x_min = r_x_min > i_x_min ? r_x_min : i_x_min; |
|
568 |
|
569 int prec = user_pref.output_precision; |
|
570 |
|
571 int ld, rd; |
|
572 |
|
573 if (bank_format) |
|
574 { |
|
575 int digits = r_x_max > r_x_min ? r_x_max : r_x_min; |
|
576 i_fw = 0; |
|
577 r_fw = digits <= 0 ? 4 : digits + 3; |
|
578 if (inf_or_nan && i_fw < 3) |
|
579 i_fw = r_fw = 3; |
|
580 r_fw += sign; |
|
581 rd = 2; |
|
582 } |
|
583 else if (all_elements_are_int_or_inf_or_nan (rp) |
|
584 && all_elements_are_int_or_inf_or_nan (ip)) |
|
585 { |
|
586 int digits = x_max > x_min ? x_max : x_min; |
|
587 i_fw = r_fw = digits <= 0 ? 1 : digits; |
|
588 if (inf_or_nan && i_fw < 3) |
|
589 i_fw = r_fw = 3; |
|
590 r_fw += sign; |
|
591 rd = 0; |
|
592 } |
|
593 else |
|
594 { |
|
595 int ld_max, rd_max; |
|
596 if (x_max > 0) |
|
597 { |
|
598 ld_max = x_max; |
|
599 rd_max = prec - x_max; |
|
600 x_max++; |
|
601 } |
|
602 else |
|
603 { |
|
604 ld_max = 1; |
|
605 rd_max = prec - x_max; |
|
606 x_max = -x_max + 1; |
|
607 } |
|
608 |
|
609 int ld_min, rd_min; |
|
610 if (x_min > 0) |
|
611 { |
|
612 ld_min = x_min; |
|
613 rd_min = prec - x_min; |
|
614 x_min++; |
|
615 } |
|
616 else |
|
617 { |
|
618 ld_min = 1; |
|
619 rd_min = prec - x_min; |
|
620 x_min = -x_min + 1; |
|
621 } |
|
622 |
|
623 ld = ld_max > ld_min ? ld_max : ld_min; |
|
624 rd = rd_max > rd_min ? rd_max : rd_min; |
|
625 |
|
626 i_fw = r_fw = ld + 1 + rd; |
|
627 if (inf_or_nan && i_fw < 3) |
|
628 i_fw = r_fw = 3; |
|
629 r_fw += sign; |
|
630 } |
|
631 |
|
632 if (! bank_format && (r_fw > user_pref.output_max_field_width || print_e)) |
|
633 { |
|
634 int exp_field = 4; |
|
635 if (x_max > 100 || x_min > 100) |
|
636 exp_field++; |
|
637 |
|
638 i_fw = r_fw = 1 + prec + exp_field; |
|
639 if (inf_or_nan && i_fw < 3) |
|
640 i_fw = r_fw = 3; |
|
641 r_fw += sign; |
|
642 |
|
643 if (print_big_e) |
|
644 { |
|
645 sprintf (r_fmt_buf, "%%%d.%dE", r_fw, prec - 1); |
|
646 sprintf (i_fmt_buf, "%%%d.%dE", i_fw, prec - 1); |
|
647 } |
|
648 else |
|
649 { |
|
650 sprintf (r_fmt_buf, "%%%d.%de", r_fw, prec - 1); |
|
651 sprintf (i_fmt_buf, "%%%d.%de", i_fw, prec - 1); |
|
652 } |
|
653 } |
|
654 else |
|
655 { |
|
656 sprintf (r_fmt_buf, "%%%d.%df", r_fw, rd); |
|
657 sprintf (i_fmt_buf, "%%%d.%df", i_fw, rd); |
|
658 } |
|
659 |
|
660 curr_real_fmt = &r_fmt_buf[0]; |
|
661 curr_imag_fmt = &i_fmt_buf[0]; |
|
662 } |
|
663 |
|
664 static int |
164
|
665 all_elements_are_ints (const Range& r) |
1
|
666 { |
|
667 // If the base and increment are ints, the final value in the range |
|
668 // will also be an integer, even if the limit is not. |
|
669 |
|
670 double b = r.base (); |
|
671 double i = r.inc (); |
|
672 |
1086
|
673 return (! (xisnan (b) || xisnan (i)) |
|
674 && (double) NINT (b) == b && (double) NINT (i) == i); |
1
|
675 } |
|
676 |
|
677 static inline void |
164
|
678 set_format (const ComplexMatrix& cm) |
1
|
679 { |
|
680 int r_fw, i_fw; |
|
681 set_format (cm, r_fw, i_fw); |
|
682 } |
|
683 |
|
684 static void |
164
|
685 set_format (const Range& r, int& fw) |
1
|
686 { |
529
|
687 curr_real_fmt = 0; |
|
688 curr_imag_fmt = 0; |
1
|
689 |
|
690 if (free_format) |
|
691 return; |
|
692 |
278
|
693 static char fmt_buf[128]; |
1
|
694 |
|
695 double r_min = r.base (); |
|
696 double r_max = r.limit (); |
|
697 |
|
698 if (r_max < r_min) |
|
699 { |
|
700 double tmp = r_max; |
|
701 r_max = r_min; |
|
702 r_min = tmp; |
|
703 } |
|
704 |
|
705 int sign = (r_min < 0.0); |
|
706 |
|
707 double max_abs = r_max < 0.0 ? -r_max : r_max; |
|
708 double min_abs = r_min < 0.0 ? -r_min : r_min; |
|
709 |
|
710 int x_max = max_abs == 0.0 ? 0 : (int) floor (log10 (max_abs) + 1.0); |
|
711 int x_min = min_abs == 0.0 ? 0 : (int) floor (log10 (min_abs) + 1.0); |
|
712 |
|
713 int prec = user_pref.output_precision; |
|
714 |
|
715 int ld, rd; |
|
716 |
|
717 if (bank_format) |
|
718 { |
|
719 int digits = x_max > x_min ? x_max : x_min; |
|
720 fw = sign + digits < 0 ? 4 : digits + 3; |
|
721 rd = 2; |
|
722 } |
|
723 else if (all_elements_are_ints (r)) |
|
724 { |
|
725 int digits = x_max > x_min ? x_max : x_min; |
|
726 fw = sign + digits; |
|
727 rd = 0; |
|
728 } |
|
729 else |
|
730 { |
|
731 int ld_max, rd_max; |
|
732 if (x_max > 0) |
|
733 { |
|
734 ld_max = x_max; |
|
735 rd_max = prec - x_max; |
|
736 x_max++; |
|
737 } |
|
738 else |
|
739 { |
|
740 ld_max = 1; |
|
741 rd_max = prec - x_max; |
|
742 x_max = -x_max + 1; |
|
743 } |
|
744 |
|
745 int ld_min, rd_min; |
|
746 if (x_min > 0) |
|
747 { |
|
748 ld_min = x_min; |
|
749 rd_min = prec - x_min; |
|
750 x_min++; |
|
751 } |
|
752 else |
|
753 { |
|
754 ld_min = 1; |
|
755 rd_min = prec - x_min; |
|
756 x_min = -x_min + 1; |
|
757 } |
|
758 |
|
759 ld = ld_max > ld_min ? ld_max : ld_min; |
|
760 rd = rd_max > rd_min ? rd_max : rd_min; |
|
761 |
|
762 fw = sign + ld + 1 + rd; |
|
763 } |
|
764 |
|
765 if (! bank_format && (fw > user_pref.output_max_field_width || print_e)) |
|
766 { |
|
767 int exp_field = 4; |
|
768 if (x_max > 100 || x_min > 100) |
|
769 exp_field++; |
|
770 |
|
771 fw = sign + 2 + prec + exp_field; |
|
772 |
|
773 if (print_big_e) |
|
774 sprintf (fmt_buf, "%%%d.%dE", fw, prec - 1); |
|
775 else |
|
776 sprintf (fmt_buf, "%%%d.%de", fw, prec - 1); |
|
777 } |
|
778 else |
|
779 { |
|
780 sprintf (fmt_buf, "%%%d.%df", fw, rd); |
|
781 } |
|
782 |
|
783 curr_real_fmt = &fmt_buf[0]; |
|
784 } |
|
785 |
|
786 static inline void |
164
|
787 set_format (const Range& r) |
1
|
788 { |
|
789 int fw; |
|
790 set_format (r, fw); |
|
791 } |
|
792 |
|
793 static inline void |
626
|
794 pr_any_float (const char *fmt, ostream& os, double d, int fw = 0) |
1
|
795 { |
|
796 if (d == -0.0) |
|
797 d = 0.0; |
|
798 |
529
|
799 if (fmt) |
1
|
800 { |
|
801 if (xisinf (d)) |
|
802 { |
|
803 char *s; |
|
804 if (d < 0.0) |
|
805 s = "-Inf"; |
|
806 else |
|
807 s = "Inf"; |
|
808 |
|
809 if (fw > 0) |
|
810 os.form ("%*s", fw, s); |
|
811 else |
|
812 os << s; |
|
813 } |
|
814 else if (xisnan (d)) |
|
815 { |
|
816 if (fw > 0) |
|
817 os.form ("%*s", fw, "NaN"); |
|
818 else |
|
819 os << "NaN"; |
|
820 } |
|
821 else |
|
822 os.form (fmt, d); |
|
823 } |
529
|
824 else |
|
825 os << d; |
1
|
826 } |
|
827 |
|
828 static inline void |
626
|
829 pr_float (ostream& os, double d, int fw = 0) |
1
|
830 { |
|
831 pr_any_float (curr_real_fmt, os, d, fw); |
|
832 } |
|
833 |
|
834 static inline void |
626
|
835 pr_imag_float (ostream& os, double d, int fw = 0) |
1
|
836 { |
|
837 pr_any_float (curr_imag_fmt, os, d, fw); |
|
838 } |
|
839 |
|
840 static inline void |
626
|
841 pr_complex (ostream& os, const Complex& c, int r_fw = 0, int i_fw = 0) |
1
|
842 { |
|
843 double r = c.real (); |
|
844 pr_float (os, r, r_fw); |
|
845 if (! bank_format) |
|
846 { |
|
847 double i = c.imag (); |
|
848 if (i < 0) |
|
849 { |
|
850 os << " - "; |
|
851 i = -i; |
|
852 pr_imag_float (os, i, i_fw); |
|
853 } |
|
854 else |
|
855 { |
|
856 os << " + "; |
|
857 pr_imag_float (os, i, i_fw); |
|
858 } |
|
859 os << "i"; |
|
860 } |
|
861 } |
|
862 |
626
|
863 static void |
|
864 print_empty_matrix (ostream& os, int nr, int nc, int pr_as_read_syntax) |
|
865 { |
|
866 assert (nr == 0 || nc == 0); |
|
867 |
|
868 if (pr_as_read_syntax) |
|
869 { |
|
870 if (nr == 0 && nc == 0) |
|
871 os << "[]"; |
|
872 else |
|
873 os << "zeros (" << nr << ", " << nc << ")"; |
|
874 } |
|
875 else |
|
876 { |
|
877 os << "[]"; |
|
878 if (user_pref.print_empty_dimensions) |
|
879 os << "(" << nr << "x" << nc << ")"; |
|
880 os << "\n"; |
|
881 } |
|
882 } |
|
883 |
1186
|
884 static void |
|
885 pr_col_num_header (ostream& os, int total_width, int max_width, |
|
886 int lim, int col) |
|
887 { |
|
888 if (total_width > max_width && user_pref.split_long_rows) |
|
889 { |
|
890 if (col != 0 && ! compact_format) |
|
891 os << "\n"; |
|
892 |
|
893 int num_cols = lim - col; |
|
894 |
|
895 if (num_cols == 1) |
|
896 os << " Column " << col + 1 << ":\n"; |
|
897 else if (num_cols == 2) |
|
898 os << " Columns " << col + 1 << " and " << lim << ":\n"; |
|
899 else |
|
900 os << " Columns " << col + 1 << " through " << lim << ":\n"; |
|
901 |
|
902 if (! compact_format) |
|
903 os << "\n"; |
|
904 } |
|
905 } |
|
906 |
1
|
907 void |
719
|
908 octave_print_internal (ostream& os, double d, int pr_as_read_syntax) |
1
|
909 { |
|
910 if (plus_format) |
|
911 { |
|
912 if (d == 0.0) |
|
913 os << " "; |
|
914 else |
|
915 os << "+"; |
|
916 } |
|
917 else |
|
918 { |
|
919 set_format (d); |
|
920 if (free_format) |
|
921 os << d; |
|
922 else |
|
923 pr_float (os, d); |
|
924 } |
626
|
925 |
|
926 if (! pr_as_read_syntax) |
|
927 os << "\n"; |
1
|
928 } |
|
929 |
|
930 void |
719
|
931 octave_print_internal (ostream& os, const Matrix& m, int pr_as_read_syntax) |
1
|
932 { |
|
933 int nr = m.rows (); |
|
934 int nc = m.columns (); |
|
935 |
626
|
936 if (nr == 0 || nc == 0) |
|
937 print_empty_matrix (os, nr, nc, pr_as_read_syntax); |
|
938 else if (plus_format && ! pr_as_read_syntax) |
1
|
939 { |
|
940 for (int i = 0; i < nr; i++) |
|
941 { |
|
942 for (int j = 0; j < nc; j++) |
|
943 { |
|
944 if (j == 0) |
|
945 os << " "; |
|
946 |
|
947 if (m.elem (i, j) == 0.0) |
|
948 os << " "; |
|
949 else |
|
950 os << "+"; |
|
951 } |
|
952 os << "\n"; |
|
953 } |
|
954 } |
|
955 else |
|
956 { |
|
957 int fw; |
|
958 set_format (m, fw); |
|
959 int column_width = fw + 2; |
|
960 int total_width = nc * column_width; |
|
961 int max_width = terminal_columns (); |
|
962 |
626
|
963 if (pr_as_read_syntax) |
|
964 max_width -= 4; |
|
965 |
1
|
966 if (free_format) |
|
967 { |
626
|
968 if (pr_as_read_syntax) |
|
969 os << "[\n"; |
|
970 |
1
|
971 os << m; |
626
|
972 |
|
973 if (pr_as_read_syntax) |
|
974 os << "]"; |
|
975 |
1
|
976 return; |
|
977 } |
|
978 |
|
979 int inc = nc; |
|
980 if (total_width > max_width && user_pref.split_long_rows) |
|
981 { |
|
982 inc = max_width / column_width; |
|
983 if (inc == 0) |
|
984 inc++; |
|
985 } |
|
986 |
626
|
987 if (pr_as_read_syntax) |
1
|
988 { |
|
989 for (int i = 0; i < nr; i++) |
|
990 { |
626
|
991 int col = 0; |
|
992 while (col < nc) |
1
|
993 { |
626
|
994 int lim = col + inc < nc ? col + inc : nc; |
|
995 |
|
996 for (int j = col; j < lim; j++) |
|
997 { |
|
998 if (i == 0 && j == 0) |
|
999 os << "[ "; |
|
1000 else |
|
1001 { |
|
1002 if (j > col && j < lim) |
|
1003 os << ", "; |
|
1004 else |
|
1005 os << " "; |
|
1006 } |
|
1007 |
|
1008 pr_float (os, m.elem (i, j)); |
|
1009 } |
|
1010 |
|
1011 col += inc; |
|
1012 |
|
1013 if (col >= nc) |
|
1014 { |
|
1015 if (i == nr - 1) |
|
1016 os << " ]"; |
|
1017 else |
|
1018 os << ";\n"; |
|
1019 } |
|
1020 else |
|
1021 os << " ...\n"; |
1
|
1022 } |
|
1023 } |
626
|
1024 } |
|
1025 else |
|
1026 { |
|
1027 for (int col = 0; col < nc; col += inc) |
|
1028 { |
|
1029 int lim = col + inc < nc ? col + inc : nc; |
|
1030 |
1186
|
1031 pr_col_num_header (os, total_width, max_width, lim, col); |
626
|
1032 |
|
1033 for (int i = 0; i < nr; i++) |
|
1034 { |
|
1035 for (int j = col; j < lim; j++) |
|
1036 { |
|
1037 os << " "; |
|
1038 |
|
1039 pr_float (os, m.elem (i, j), fw); |
|
1040 } |
|
1041 |
|
1042 os << "\n"; |
|
1043 } |
|
1044 } |
1
|
1045 } |
|
1046 } |
|
1047 } |
|
1048 |
|
1049 void |
626
|
1050 octave_print_internal (ostream& os, const Complex& c, |
|
1051 int pr_as_read_syntax) |
1
|
1052 { |
|
1053 if (plus_format) |
|
1054 { |
|
1055 if (c == 0.0) |
|
1056 os << " "; |
|
1057 else |
|
1058 os << "+"; |
|
1059 } |
|
1060 else |
|
1061 { |
|
1062 set_format (c); |
|
1063 if (free_format) |
|
1064 os << c; |
|
1065 else |
|
1066 pr_complex (os, c); |
|
1067 } |
626
|
1068 |
|
1069 if (! pr_as_read_syntax) |
|
1070 os << "\n"; |
1
|
1071 } |
|
1072 |
|
1073 void |
626
|
1074 octave_print_internal (ostream& os, const ComplexMatrix& cm, |
|
1075 int pr_as_read_syntax) |
1
|
1076 { |
|
1077 int nr = cm.rows (); |
|
1078 int nc = cm.columns (); |
|
1079 |
626
|
1080 if (nr == 0 || nc == 0) |
|
1081 print_empty_matrix (os, nr, nc, pr_as_read_syntax); |
|
1082 else if (plus_format && ! pr_as_read_syntax) |
1
|
1083 { |
|
1084 for (int i = 0; i < nr; i++) |
|
1085 { |
|
1086 for (int j = 0; j < nc; j++) |
|
1087 { |
|
1088 if (j == 0) |
|
1089 os << " "; |
|
1090 |
|
1091 if (cm.elem (i, j) == 0.0) |
|
1092 os << " "; |
|
1093 else |
|
1094 os << "+"; |
|
1095 } |
|
1096 os << "\n"; |
|
1097 } |
|
1098 } |
|
1099 else |
|
1100 { |
|
1101 int r_fw, i_fw; |
|
1102 set_format (cm, r_fw, i_fw); |
|
1103 int column_width = i_fw + r_fw; |
|
1104 column_width += bank_format ? 2 : 7; |
|
1105 int total_width = nc * column_width; |
|
1106 int max_width = terminal_columns (); |
|
1107 |
626
|
1108 if (pr_as_read_syntax) |
|
1109 max_width -= 4; |
|
1110 |
1
|
1111 if (free_format) |
|
1112 { |
626
|
1113 if (pr_as_read_syntax) |
|
1114 os << "[\n"; |
|
1115 |
1
|
1116 os << cm; |
626
|
1117 |
|
1118 if (pr_as_read_syntax) |
|
1119 os << "]"; |
|
1120 |
1
|
1121 return; |
|
1122 } |
|
1123 |
|
1124 int inc = nc; |
|
1125 if (total_width > max_width && user_pref.split_long_rows) |
|
1126 { |
|
1127 inc = max_width / column_width; |
|
1128 if (inc == 0) |
|
1129 inc++; |
|
1130 } |
|
1131 |
626
|
1132 if (pr_as_read_syntax) |
1
|
1133 { |
|
1134 for (int i = 0; i < nr; i++) |
|
1135 { |
626
|
1136 int col = 0; |
|
1137 while (col < nc) |
1
|
1138 { |
626
|
1139 int lim = col + inc < nc ? col + inc : nc; |
|
1140 |
|
1141 for (int j = col; j < lim; j++) |
|
1142 { |
|
1143 if (i == 0 && j == 0) |
|
1144 os << "[ "; |
|
1145 else |
|
1146 { |
|
1147 if (j > col && j < lim) |
|
1148 os << ", "; |
|
1149 else |
|
1150 os << " "; |
|
1151 } |
|
1152 |
|
1153 pr_complex (os, cm.elem (i, j)); |
|
1154 } |
|
1155 |
|
1156 col += inc; |
|
1157 |
|
1158 if (col >= nc) |
|
1159 { |
|
1160 if (i == nr - 1) |
|
1161 os << " ]"; |
|
1162 else |
|
1163 os << ";\n"; |
|
1164 } |
1
|
1165 else |
626
|
1166 os << " ...\n"; |
1
|
1167 } |
|
1168 } |
626
|
1169 } |
|
1170 else |
|
1171 { |
|
1172 for (int col = 0; col < nc; col += inc) |
|
1173 { |
|
1174 int lim = col + inc < nc ? col + inc : nc; |
|
1175 |
1186
|
1176 pr_col_num_header (os, total_width, max_width, lim, col); |
626
|
1177 |
|
1178 for (int i = 0; i < nr; i++) |
|
1179 { |
|
1180 for (int j = col; j < lim; j++) |
|
1181 { |
|
1182 os << " "; |
|
1183 |
|
1184 pr_complex (os, cm.elem (i, j)); |
|
1185 } |
|
1186 os << "\n"; |
|
1187 } |
|
1188 } |
1
|
1189 } |
|
1190 } |
|
1191 } |
|
1192 |
|
1193 void |
626
|
1194 octave_print_internal (ostream& os, const Range& r, |
|
1195 int pr_as_read_syntax) |
1
|
1196 { |
626
|
1197 double base = r.base (); |
1
|
1198 double increment = r.inc (); |
626
|
1199 double limit = r.limit (); |
1
|
1200 int num_elem = r.nelem (); |
|
1201 |
626
|
1202 if (plus_format && ! pr_as_read_syntax) |
1
|
1203 { |
|
1204 os << " "; |
|
1205 for (int i = 0; i < num_elem; i++) |
|
1206 { |
626
|
1207 double val = base + i * increment; |
1
|
1208 if (val == 0.0) |
|
1209 os << " "; |
|
1210 else |
|
1211 os << "+"; |
|
1212 } |
|
1213 } |
|
1214 else |
|
1215 { |
|
1216 int fw; |
|
1217 set_format (r, fw); |
|
1218 |
626
|
1219 if (pr_as_read_syntax) |
1
|
1220 { |
626
|
1221 |
|
1222 if (free_format) |
|
1223 { |
|
1224 os << base << " : "; |
|
1225 if (increment != 1.0) |
|
1226 os << increment << " : "; |
|
1227 os << limit; |
|
1228 } |
|
1229 else |
|
1230 { |
|
1231 pr_float (os, base, fw); |
|
1232 os << " : "; |
|
1233 if (increment != 1.0) |
|
1234 { |
|
1235 pr_float (os, increment, fw); |
|
1236 os << " : "; |
|
1237 } |
|
1238 pr_float (os, limit, fw); |
|
1239 } |
1
|
1240 } |
626
|
1241 else |
|
1242 { |
|
1243 int column_width = fw + 2; |
|
1244 int total_width = num_elem * column_width; |
|
1245 int max_width = terminal_columns (); |
1
|
1246 |
626
|
1247 if (free_format) |
|
1248 { |
|
1249 os << r; |
|
1250 return; |
|
1251 } |
1
|
1252 |
626
|
1253 int inc = num_elem; |
1
|
1254 if (total_width > max_width && user_pref.split_long_rows) |
|
1255 { |
626
|
1256 inc = max_width / column_width; |
|
1257 if (inc == 0) |
|
1258 inc++; |
1
|
1259 } |
|
1260 |
626
|
1261 int col = 0; |
|
1262 while (col < num_elem) |
1
|
1263 { |
626
|
1264 int lim = col + inc < num_elem ? col + inc : num_elem; |
|
1265 |
1186
|
1266 pr_col_num_header (os, total_width, max_width, lim, col); |
626
|
1267 |
|
1268 for (int i = col; i < lim; i++) |
|
1269 { |
|
1270 double val = base + i * increment; |
|
1271 os << " "; |
|
1272 pr_float (os, val, fw); |
|
1273 } |
|
1274 |
|
1275 os << "\n"; |
|
1276 |
|
1277 col += inc; |
1
|
1278 } |
|
1279 } |
|
1280 } |
|
1281 } |
|
1282 |
712
|
1283 DEFUN ("disp", Fdisp, Sdisp, 1, 1, |
529
|
1284 "disp (X): display value without name tag") |
|
1285 { |
|
1286 Octave_object retval; |
|
1287 |
|
1288 int nargin = args.length (); |
|
1289 |
712
|
1290 if (nargin == 1) |
|
1291 args(0).eval (1); |
529
|
1292 else |
|
1293 print_usage ("disp"); |
|
1294 |
|
1295 return retval; |
|
1296 } |
|
1297 |
1
|
1298 static void |
|
1299 init_format_state (void) |
|
1300 { |
|
1301 free_format = 0; |
|
1302 plus_format = 0; |
|
1303 bank_format = 0; |
|
1304 print_e = 0; |
|
1305 print_big_e = 0; |
|
1306 } |
|
1307 |
|
1308 static void |
|
1309 set_output_prec_and_fw (int prec, int fw) |
|
1310 { |
529
|
1311 tree_constant *tmp = 0; |
1
|
1312 |
|
1313 tmp = new tree_constant ((double) prec); |
195
|
1314 bind_builtin_variable ("output_precision", tmp); |
1
|
1315 |
|
1316 tmp = new tree_constant ((double) fw); |
195
|
1317 bind_builtin_variable ("output_max_field_width", tmp); |
1
|
1318 } |
|
1319 |
|
1320 void |
|
1321 set_format_style (int argc, char **argv) |
|
1322 { |
|
1323 if (--argc > 0) |
|
1324 { |
|
1325 argv++; |
|
1326 if (*argv[0]) |
|
1327 { |
|
1328 if (strcmp (*argv, "short") == 0) |
|
1329 { |
|
1330 if (--argc > 0) |
|
1331 { |
|
1332 argv++; |
|
1333 if (strcmp (*argv, "e") == 0) |
|
1334 { |
|
1335 init_format_state (); |
|
1336 print_e = 1; |
|
1337 } |
|
1338 else if (strcmp (*argv, "E") == 0) |
|
1339 { |
|
1340 init_format_state (); |
|
1341 print_e = 1; |
|
1342 print_big_e = 1; |
|
1343 } |
|
1344 else |
|
1345 { |
217
|
1346 error ("format: unrecognized option `short %s'", *argv); |
1
|
1347 return; |
|
1348 } |
|
1349 } |
|
1350 else |
|
1351 init_format_state (); |
|
1352 |
|
1353 set_output_prec_and_fw (3, 8); |
|
1354 } |
|
1355 else if (strcmp (*argv, "long") == 0) |
|
1356 { |
|
1357 if (--argc > 0) |
|
1358 { |
|
1359 argv++; |
|
1360 if (strcmp (*argv, "e") == 0) |
|
1361 { |
|
1362 init_format_state (); |
|
1363 print_e = 1; |
|
1364 } |
|
1365 else if (strcmp (*argv, "E") == 0) |
|
1366 { |
|
1367 init_format_state (); |
|
1368 print_e = 1; |
|
1369 print_big_e = 1; |
|
1370 } |
|
1371 else |
|
1372 { |
217
|
1373 error ("format: unrecognized option `long %s'", *argv); |
1
|
1374 return; |
|
1375 } |
|
1376 } |
|
1377 else |
|
1378 init_format_state (); |
|
1379 |
|
1380 set_output_prec_and_fw (15, 24); |
|
1381 } |
|
1382 else if (strcmp (*argv, "hex") == 0) |
217
|
1383 error ("format: format state `hex' not implemented yet"); |
1
|
1384 else if (strcmp (*argv, "+") == 0) |
|
1385 { |
|
1386 init_format_state (); |
|
1387 plus_format = 1; |
|
1388 } |
|
1389 else if (strcmp (*argv, "bank") == 0) |
|
1390 { |
|
1391 init_format_state (); |
|
1392 bank_format = 1; |
|
1393 } |
|
1394 else if (strcmp (*argv, "free") == 0) |
|
1395 { |
|
1396 init_format_state (); |
|
1397 free_format = 1; |
|
1398 } |
|
1399 else if (strcmp (*argv, "none") == 0) |
|
1400 { |
|
1401 init_format_state (); |
|
1402 free_format = 1; |
|
1403 } |
|
1404 else if (strcmp (*argv, "compact") == 0) |
1186
|
1405 { |
|
1406 compact_format = 1; |
|
1407 } |
1
|
1408 else if (strcmp (*argv, "loose") == 0) |
1186
|
1409 { |
|
1410 compact_format = 0; |
|
1411 } |
1
|
1412 else |
217
|
1413 error ("format: unrecognized format state `%s'", *argv); |
1
|
1414 } |
|
1415 else |
|
1416 usage ("format [format_state]"); |
|
1417 } |
|
1418 else |
|
1419 { |
|
1420 init_format_state (); |
|
1421 set_output_prec_and_fw (5, 10); |
|
1422 } |
|
1423 } |
|
1424 |
529
|
1425 DEFUN_TEXT ("format", Fformat, Sformat, -1, 1, |
|
1426 "format [style]\n\ |
|
1427 \n\ |
|
1428 set output formatting style") |
|
1429 { |
|
1430 Octave_object retval; |
|
1431 |
|
1432 DEFINE_ARGV("format"); |
|
1433 |
|
1434 set_format_style (argc, argv); |
|
1435 |
|
1436 DELETE_ARGV; |
|
1437 |
|
1438 return retval; |
|
1439 } |
|
1440 |
1
|
1441 /* |
|
1442 ;;; Local Variables: *** |
|
1443 ;;; mode: C++ *** |
|
1444 ;;; page-delimiter: "^/\\*" *** |
|
1445 ;;; End: *** |
|
1446 */ |