Mercurial > octave-nkf
comparison src/xpow.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 | 4061106b1c4b |
comparison
equal
deleted
inserted
replaced
11585:1473d0cf86d2 | 11586:12df7854fa7c |
---|---|
692 } | 692 } |
693 | 693 |
694 return result; | 694 return result; |
695 } | 695 } |
696 | 696 |
697 static inline bool | 697 static inline bool |
698 same_sign (double a, double b) | 698 same_sign (double a, double b) |
699 { | 699 { |
700 return (a >= 0 && b >= 0) || (a <= 0 && b <= 0); | 700 return (a >= 0 && b >= 0) || (a <= 0 && b <= 0); |
701 } | 701 } |
702 | 702 |
729 for (octave_idx_type i = n-2; i >= 0; i--) | 729 for (octave_idx_type i = n-2; i >= 0; i--) |
730 result(i) = (limit *= inc); | 730 result(i) = (limit *= inc); |
731 } | 731 } |
732 | 732 |
733 retval = result; | 733 retval = result; |
734 } | 734 } |
735 else | 735 else |
736 retval = elem_xpow (a, r.matrix_value ()); | 736 retval = elem_xpow (a, r.matrix_value ()); |
737 | 737 |
738 return retval; | 738 return retval; |
739 } | 739 } |
752 ComplexMatrix result (nr, nc); | 752 ComplexMatrix result (nr, nc); |
753 | 753 |
754 for (octave_idx_type j = 0; j < nc; j++) | 754 for (octave_idx_type j = 0; j < nc; j++) |
755 for (octave_idx_type i = 0; i < nr; i++) | 755 for (octave_idx_type i = 0; i < nr; i++) |
756 { | 756 { |
757 octave_quit (); | 757 octave_quit (); |
758 | 758 |
759 Complex atmp (a (i, j)); | 759 Complex atmp (a (i, j)); |
760 | 760 |
761 result (i, j) = std::pow (atmp, b); | 761 result (i, j) = std::pow (atmp, b); |
762 } | 762 } |
763 | 763 |
965 for (octave_idx_type i = n-2; i >= 0; i--) | 965 for (octave_idx_type i = n-2; i >= 0; i--) |
966 result(i) = (limit *= inc); | 966 result(i) = (limit *= inc); |
967 } | 967 } |
968 | 968 |
969 retval = result; | 969 retval = result; |
970 } | 970 } |
971 else | 971 else |
972 retval = elem_xpow (a, r.matrix_value ()); | 972 retval = elem_xpow (a, r.matrix_value ()); |
973 | 973 |
974 | 974 |
975 return retval; | 975 return retval; |
2111 FloatComplexMatrix result (nr, nc); | 2111 FloatComplexMatrix result (nr, nc); |
2112 | 2112 |
2113 for (octave_idx_type j = 0; j < nc; j++) | 2113 for (octave_idx_type j = 0; j < nc; j++) |
2114 for (octave_idx_type i = 0; i < nr; i++) | 2114 for (octave_idx_type i = 0; i < nr; i++) |
2115 { | 2115 { |
2116 octave_quit (); | 2116 octave_quit (); |
2117 | 2117 |
2118 FloatComplex atmp (a (i, j)); | 2118 FloatComplex atmp (a (i, j)); |
2119 | 2119 |
2120 result (i, j) = std::pow (atmp, b); | 2120 result (i, j) = std::pow (atmp, b); |
2121 } | 2121 } |
2122 | 2122 |