comparison liboctave/CRowVector.cc @ 9550:3d6a9aea2aea

refactor binary & bool ops in liboctave
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 19 Aug 2009 22:55:15 +0200
parents dc07bc4157b8
children e087d7c77ff9
comparison
equal deleted inserted replaced
9549:ed34b1da0e26 9550:3d6a9aea2aea
65 ComplexRowVector::operator == (const ComplexRowVector& a) const 65 ComplexRowVector::operator == (const ComplexRowVector& a) const
66 { 66 {
67 octave_idx_type len = length (); 67 octave_idx_type len = length ();
68 if (len != a.length ()) 68 if (len != a.length ())
69 return 0; 69 return 0;
70 return mx_inline_equal (data (), a.data (), len); 70 return mx_inline_equal (len, data (), a.data ());
71 } 71 }
72 72
73 bool 73 bool
74 ComplexRowVector::operator != (const ComplexRowVector& a) const 74 ComplexRowVector::operator != (const ComplexRowVector& a) const
75 { 75 {
292 if (len == 0) 292 if (len == 0)
293 return *this; 293 return *this;
294 294
295 Complex *d = fortran_vec (); // Ensures only one reference to my privates! 295 Complex *d = fortran_vec (); // Ensures only one reference to my privates!
296 296
297 mx_inline_add2 (d, a.data (), len); 297 mx_inline_add2 (len, d, a.data ());
298 return *this; 298 return *this;
299 } 299 }
300 300
301 ComplexRowVector& 301 ComplexRowVector&
302 ComplexRowVector::operator -= (const RowVector& a) 302 ComplexRowVector::operator -= (const RowVector& a)
314 if (len == 0) 314 if (len == 0)
315 return *this; 315 return *this;
316 316
317 Complex *d = fortran_vec (); // Ensures only one reference to my privates! 317 Complex *d = fortran_vec (); // Ensures only one reference to my privates!
318 318
319 mx_inline_subtract2 (d, a.data (), len); 319 mx_inline_sub2 (len, d, a.data ());
320 return *this; 320 return *this;
321 } 321 }
322 322
323 // row vector by matrix -> row vector 323 // row vector by matrix -> row vector
324 324