comparison src/ov.cc @ 4478:7afd4bf05aa8

[project @ 2003-07-30 19:15:31 by jwe]
author jwe
date Wed, 30 Jul 2003 19:15:31 +0000
parents af308ca1a354
children e944fbe3fff2
comparison
equal deleted inserted replaced
4477:87c2e107f811 4478:7afd4bf05aa8
97 int Vwarn_str_to_num; 97 int Vwarn_str_to_num;
98 98
99 // If TRUE, print the name along with the value. 99 // If TRUE, print the name along with the value.
100 bool Vprint_answer_id_name; 100 bool Vprint_answer_id_name;
101 101
102 // Should operations on empty matrices return empty matrices or an
103 // error? A positive value means yes. A negative value means yes,
104 // but print a warning message. Zero means it should be considered an
105 // error.
106 int Vpropagate_empty_matrices;
107
108 // How many levels of structure elements should we print? 102 // How many levels of structure elements should we print?
109 int Vstruct_levels_to_print; 103 int Vstruct_levels_to_print;
110 104
111 // Allow divide by zero errors to be suppressed. 105 // Allow divide by zero errors to be suppressed.
112 bool Vwarn_divide_by_zero; 106 bool Vwarn_divide_by_zero;
411 { 405 {
412 rep->count = 1; 406 rep->count = 1;
413 maybe_mutate (); 407 maybe_mutate ();
414 } 408 }
415 409
410 octave_value::octave_value (const ArrayN<double>& a)
411 : rep (new octave_double_nd_array (a))
412 {
413 rep->count = 1;
414 maybe_mutate ();
415 }
416
416 octave_value::octave_value (const DiagMatrix& d) 417 octave_value::octave_value (const DiagMatrix& d)
417 : rep (new octave_matrix (d)) 418 : rep (new octave_matrix (d))
418 { 419 {
419 rep->count = 1; 420 rep->count = 1;
420 maybe_mutate (); 421 maybe_mutate ();
445 : rep (new octave_complex_matrix (m)) 446 : rep (new octave_complex_matrix (m))
446 { 447 {
447 rep->count = 1; 448 rep->count = 1;
448 maybe_mutate (); 449 maybe_mutate ();
449 } 450 }
451
452 #if 0
453 octave_value::octave_value (const ArrayN<Complex>& a)
454 : rep (new octave_complex_nd_array (a))
455 {
456 rep->count = 1;
457 maybe_mutate ();
458 }
459 #endif
450 460
451 octave_value::octave_value (const ComplexDiagMatrix& d) 461 octave_value::octave_value (const ComplexDiagMatrix& d)
452 : rep (new octave_complex_matrix (d)) 462 : rep (new octave_complex_matrix (d))
453 { 463 {
454 rep->count = 1; 464 rep->count = 1;
1794 1804
1795 return 0; 1805 return 0;
1796 } 1806 }
1797 1807
1798 static int 1808 static int
1799 propagate_empty_matrices (void)
1800 {
1801 Vpropagate_empty_matrices = check_preference ("propagate_empty_matrices");
1802
1803 return 0;
1804 }
1805
1806 static int
1807 warn_resize_on_range_error (void) 1809 warn_resize_on_range_error (void)
1808 { 1810 {
1809 Vwarn_resize_on_range_error 1811 Vwarn_resize_on_range_error
1810 = check_preference ("warn_resize_on_range_error"); 1812 = check_preference ("warn_resize_on_range_error");
1811 1813
1855 "-*- texinfo -*-\n\ 1857 "-*- texinfo -*-\n\
1856 @defvr {Built-in Variable} print_answer_id_name\n\ 1858 @defvr {Built-in Variable} print_answer_id_name\n\
1857 If the value of @code{print_answer_id_name} is nonzero, variable\n\ 1859 If the value of @code{print_answer_id_name} is nonzero, variable\n\
1858 names are printed along with the result. Otherwise, only the result\n\ 1860 names are printed along with the result. Otherwise, only the result\n\
1859 values are printed. The default value is 1.\n\ 1861 values are printed. The default value is 1.\n\
1860 @end defvr");
1861
1862 DEFVAR (propagate_empty_matrices, true, propagate_empty_matrices,
1863 "-*- texinfo -*-\n\
1864 @defvr {Built-in Variable} propagate_empty_matrices\n\
1865 If the value of @code{propagate_empty_matrices} is nonzero,\n\
1866 functions like @code{inverse} and @code{svd} will return an empty matrix\n\
1867 if they are given one as an argument. The default value is 1.\n\
1868 @end defvr"); 1862 @end defvr");
1869 1863
1870 DEFVAR (silent_functions, false, silent_functions, 1864 DEFVAR (silent_functions, false, silent_functions,
1871 "-*- texinfo -*-\n\ 1865 "-*- texinfo -*-\n\
1872 @defvr {Built-in Variable} silent_functions\n\ 1866 @defvr {Built-in Variable} silent_functions\n\