comparison src/DLD-FUNCTIONS/colloc.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
53 return retval; 53 return retval;
54 } 54 }
55 55
56 if (! args(0).is_scalar_type ()) 56 if (! args(0).is_scalar_type ())
57 { 57 {
58 error ("colloc: first argument must be a scalar"); 58 error ("colloc: N must be a scalar");
59 return retval; 59 return retval;
60 } 60 }
61 61
62 double tmp = args(0).double_value (); 62 double tmp = args(0).double_value ();
63 63
64 if (error_state) 64 if (error_state)
65 return retval; 65 return retval;
66 66
67 if (xisnan (tmp)) 67 if (xisnan (tmp))
68 { 68 {
69 error ("colloc: NaN is invalid as NCOL"); 69 error ("colloc: N cannot be NaN");
70 return retval; 70 return retval;
71 } 71 }
72 72
73 octave_idx_type ncol = NINTbig (tmp); 73 octave_idx_type ncol = NINTbig (tmp);
74 if (ncol < 0) 74 if (ncol < 0)
75 { 75 {
76 error ("colloc: first argument must be non-negative"); 76 error ("colloc: N must be positive");
77 return retval; 77 return retval;
78 } 78 }
79 79
80 octave_idx_type ntot = ncol; 80 octave_idx_type ntot = ncol;
81 octave_idx_type left = 0; 81 octave_idx_type left = 0;
85 { 85 {
86 if (args(i).is_defined ()) 86 if (args(i).is_defined ())
87 { 87 {
88 if (! args(i).is_string ()) 88 if (! args(i).is_string ())
89 { 89 {
90 error ("colloc: expecting string argument"); 90 error ("colloc: expecting string argument \"left\" or \"right\"");
91 return retval; 91 return retval;
92 } 92 }
93 93
94 std::string s = args(i).string_value (); 94 std::string s = args(i).string_value ();
95 95