Mercurial > hg > octave-nkf
comparison liboctave/array/CMatrix.cc @ 17663:7975d75f933c
Use std::swap in liboctave instead of temporary variable.
* liboctave/array/CColVector.cc, liboctave/array/CDiagMatrix.cc,
liboctave/array/CMatrix.cc, liboctave/array/CRowVector.cc,
liboctave/array/chMatrix.cc, liboctave/array/dColVector.cc,
liboctave/array/dDiagMatrix.cc, liboctave/array/dMatrix.cc,
liboctave/array/dRowVector.cc, liboctave/array/fCColVector.cc,
liboctave/array/fCDiagMatrix.cc, liboctave/array/fCMatrix.cc,
liboctave/array/fCRowVector.cc, liboctave/array/fColVector.cc,
liboctave/array/fDiagMatrix.cc, liboctave/array/fMatrix.cc,
liboctave/array/fRowVector.cc, liboctave/numeric/sparse-dmsolve.cc:
Use std::swap in liboctave instead of temporary variable.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 15 Oct 2013 14:59:09 -0700 |
parents | 23c5f90f92cd |
children | d63878346099 |
comparison
equal
deleted
inserted
replaced
17662:0b7f5c56f853 | 17663:7975d75f933c |
---|---|
577 { | 577 { |
578 (*current_liboctave_error_handler) ("range error for fill"); | 578 (*current_liboctave_error_handler) ("range error for fill"); |
579 return *this; | 579 return *this; |
580 } | 580 } |
581 | 581 |
582 if (r1 > r2) { octave_idx_type tmp = r1; r1 = r2; r2 = tmp; } | 582 if (r1 > r2) { std::swap (r1, r2); } |
583 if (c1 > c2) { octave_idx_type tmp = c1; c1 = c2; c2 = tmp; } | 583 if (c1 > c2) { std::swap (c1, c2); } |
584 | 584 |
585 if (r2 >= r1 && c2 >= c1) | 585 if (r2 >= r1 && c2 >= c1) |
586 { | 586 { |
587 make_unique (); | 587 make_unique (); |
588 | 588 |
605 { | 605 { |
606 (*current_liboctave_error_handler) ("range error for fill"); | 606 (*current_liboctave_error_handler) ("range error for fill"); |
607 return *this; | 607 return *this; |
608 } | 608 } |
609 | 609 |
610 if (r1 > r2) { octave_idx_type tmp = r1; r1 = r2; r2 = tmp; } | 610 if (r1 > r2) { std::swap (r1, r2); } |
611 if (c1 > c2) { octave_idx_type tmp = c1; c1 = c2; c2 = tmp; } | 611 if (c1 > c2) { std::swap (c1, c2); } |
612 | 612 |
613 if (r2 >= r1 && c2 >=c1) | 613 if (r2 >= r1 && c2 >=c1) |
614 { | 614 { |
615 make_unique (); | 615 make_unique (); |
616 | 616 |
927 // resize is the destructive equivalent for this one | 927 // resize is the destructive equivalent for this one |
928 | 928 |
929 ComplexMatrix | 929 ComplexMatrix |
930 ComplexMatrix::extract (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const | 930 ComplexMatrix::extract (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const |
931 { | 931 { |
932 if (r1 > r2) { octave_idx_type tmp = r1; r1 = r2; r2 = tmp; } | 932 if (r1 > r2) { std::swap (r1, r2); } |
933 if (c1 > c2) { octave_idx_type tmp = c1; c1 = c2; c2 = tmp; } | 933 if (c1 > c2) { std::swap (c1, c2); } |
934 | 934 |
935 return index (idx_vector (r1, r2+1), idx_vector (c1, c2+1)); | 935 return index (idx_vector (r1, r2+1), idx_vector (c1, c2+1)); |
936 } | 936 } |
937 | 937 |
938 ComplexMatrix | 938 ComplexMatrix |