comparison liboctave/Range.cc @ 11586:12df7854fa7c

strip trailing whitespace from source files
author John W. Eaton <jwe@octave.org>
date Thu, 20 Jan 2011 17:24:59 -0500
parents fd0a3ac60b0e
children 731a0b589cab
comparison
equal deleted inserted replaced
11585:1473d0cf86d2 11586:12df7854fa7c
35 #include "lo-math.h" 35 #include "lo-math.h"
36 #include "lo-utils.h" 36 #include "lo-utils.h"
37 #include "Array-util.h" 37 #include "Array-util.h"
38 38
39 Range::Range (double b, double i, octave_idx_type n) 39 Range::Range (double b, double i, octave_idx_type n)
40 : rng_base (b), rng_limit (b + n * i), rng_inc (i), 40 : rng_base (b), rng_limit (b + n * i), rng_inc (i),
41 rng_nelem (n), cache () 41 rng_nelem (n), cache ()
42 { 42 {
43 if (! xfinite (b) || ! xfinite (i)) 43 if (! xfinite (b) || ! xfinite (i))
44 rng_nelem = -2; 44 rng_nelem = -2;
45 } 45 }
91 } 91 }
92 92
93 struct _rangeidx_helper 93 struct _rangeidx_helper
94 { 94 {
95 double *array, base, inc; 95 double *array, base, inc;
96 _rangeidx_helper (double *a, double b, double i) 96 _rangeidx_helper (double *a, double b, double i)
97 : array (a), base (b), inc (i) { } 97 : array (a), base (b), inc (i) { }
98 void operator () (octave_idx_type i) 98 void operator () (octave_idx_type i)
99 { *array++ = base + i * inc; } 99 { *array++ = base + i * inc; }
100 }; 100 };
101 101
102 Array<double> 102 Array<double>
103 Range::index (const idx_vector& i) const 103 Range::index (const idx_vector& i) const
104 { 104 {
105 Array<double> retval; 105 Array<double> retval;
106 106
107 octave_idx_type n = rng_nelem; 107 octave_idx_type n = rng_nelem;
233 for (octave_idx_type i = 0; i < nel; i++, tmp += stp) 233 for (octave_idx_type i = 0; i < nel; i++, tmp += stp)
234 psidx[i] = tmp; 234 psidx[i] = tmp;
235 235
236 } 236 }
237 237
238 Matrix 238 Matrix
239 Range::diag (octave_idx_type k) const 239 Range::diag (octave_idx_type k) const
240 { 240 {
241 return matrix_value ().diag (k); 241 return matrix_value ().diag (k);
242 } 242 }
243 243