Mercurial > hg > octave-jordi
comparison src/DLD-FUNCTIONS/find.cc @ 4153:6b96ce9f5743
[project @ 2002-11-06 20:38:49 by jwe]
author | jwe |
---|---|
date | Wed, 06 Nov 2002 20:38:50 +0000 |
parents | ca92c9d3f882 |
children | c0121a3b9cbe |
comparison
equal
deleted
inserted
replaced
4152:f14251d33b01 | 4153:6b96ce9f5743 |
---|---|
21 */ | 21 */ |
22 | 22 |
23 #ifdef HAVE_CONFIG_H | 23 #ifdef HAVE_CONFIG_H |
24 #include <config.h> | 24 #include <config.h> |
25 #endif | 25 #endif |
26 | |
27 #include "quit.h" | |
26 | 28 |
27 #include "defun-dld.h" | 29 #include "defun-dld.h" |
28 #include "error.h" | 30 #include "error.h" |
29 #include "gripes.h" | 31 #include "gripes.h" |
30 #include "oct-obj.h" | 32 #include "oct-obj.h" |
90 int m_nc = m.columns (); | 92 int m_nc = m.columns (); |
91 | 93 |
92 int i, j; | 94 int i, j; |
93 for (j = 0; j < m_nc; j++) | 95 for (j = 0; j < m_nc; j++) |
94 for (i = 0; i < m_nr; i++) | 96 for (i = 0; i < m_nr; i++) |
95 if (m (i, j) != 0.0) | 97 { |
96 count++; | 98 OCTAVE_QUIT; |
99 | |
100 if (m (i, j) != 0.0) | |
101 count++; | |
102 } | |
97 | 103 |
98 octave_value_list retval (((nargout == 0) ? 1 : nargout), Matrix ()); | 104 octave_value_list retval (((nargout == 0) ? 1 : nargout), Matrix ()); |
99 | 105 |
100 if (count == 0) | 106 if (count == 0) |
101 return retval; | 107 return retval; |
106 | 112 |
107 count = 0; | 113 count = 0; |
108 for (j = 0; j < m_nc; j++) | 114 for (j = 0; j < m_nc; j++) |
109 for (i = 0; i < m_nr; i++) | 115 for (i = 0; i < m_nr; i++) |
110 { | 116 { |
117 OCTAVE_QUIT; | |
118 | |
111 double d = m (i, j); | 119 double d = m (i, j); |
112 if (d != 0.0) | 120 if (d != 0.0) |
113 { | 121 { |
114 i_idx (count) = i + 1; | 122 i_idx (count) = i + 1; |
115 j_idx (count) = j + 1; | 123 j_idx (count) = j + 1; |
129 int m_nc = m.columns (); | 137 int m_nc = m.columns (); |
130 | 138 |
131 int i, j; | 139 int i, j; |
132 for (j = 0; j < m_nc; j++) | 140 for (j = 0; j < m_nc; j++) |
133 for (i = 0; i < m_nr; i++) | 141 for (i = 0; i < m_nr; i++) |
134 if (m (i, j) != 0.0) | 142 { |
135 count++; | 143 OCTAVE_QUIT; |
144 | |
145 if (m (i, j) != 0.0) | |
146 count++; | |
147 } | |
136 | 148 |
137 octave_value_list retval (((nargout == 0) ? 1 : nargout), Matrix ()); | 149 octave_value_list retval (((nargout == 0) ? 1 : nargout), Matrix ()); |
138 | 150 |
139 if (count == 0) | 151 if (count == 0) |
140 return retval; | 152 return retval; |
145 | 157 |
146 count = 0; | 158 count = 0; |
147 for (j = 0; j < m_nc; j++) | 159 for (j = 0; j < m_nc; j++) |
148 for (i = 0; i < m_nr; i++) | 160 for (i = 0; i < m_nr; i++) |
149 { | 161 { |
162 OCTAVE_QUIT; | |
163 | |
150 Complex c = m (i, j); | 164 Complex c = m (i, j); |
151 if (c != 0.0) | 165 if (c != 0.0) |
152 { | 166 { |
153 i_idx (count) = i + 1; | 167 i_idx (count) = i + 1; |
154 j_idx (count) = j + 1; | 168 j_idx (count) = j + 1; |