154 |
|
|
155 |
# where positive: |
# where positive: |
156 |
ref=checkResult("where positive("+ex1+")", \ |
ref=checkResult("where positive("+ex1+")", \ |
157 |
(arg1-3).wherePositive(), \ |
(arg1-3)._wherePositive(), \ |
158 |
numarray.greater(arrays1[0],3.), \ |
numarray.greater(arrays1[0],3.), \ |
159 |
numarray.greater(arrays1[1],3.), \ |
numarray.greater(arrays1[1],3.), \ |
160 |
numarray.greater(arrays1[2],3.), \ |
numarray.greater(arrays1[2],3.), \ |
162 |
|
|
163 |
# where negative: |
# where negative: |
164 |
ref=checkResult("where negative("+ex1+")", \ |
ref=checkResult("where negative("+ex1+")", \ |
165 |
(arg1-3).whereNegative(), \ |
(arg1-3)._whereNegative(), \ |
166 |
numarray.greater(3.,arrays1[0]), \ |
numarray.greater(3.,arrays1[0]), \ |
167 |
numarray.greater(3.,arrays1[1]), \ |
numarray.greater(3.,arrays1[1]), \ |
168 |
numarray.greater(3.,arrays1[2]), \ |
numarray.greater(3.,arrays1[2]), \ |
170 |
|
|
171 |
# where non-negative: |
# where non-negative: |
172 |
ref=checkResult("where nonnegative("+ex1+")", \ |
ref=checkResult("where nonnegative("+ex1+")", \ |
173 |
(arg1-3).whereNonNegative(), \ |
(arg1-3)._whereNonNegative(), \ |
174 |
numarray.greater_equal(arrays1[0],3.), \ |
numarray.greater_equal(arrays1[0],3.), \ |
175 |
numarray.greater_equal(arrays1[1],3.), \ |
numarray.greater_equal(arrays1[1],3.), \ |
176 |
numarray.greater_equal(arrays1[2],3.), \ |
numarray.greater_equal(arrays1[2],3.), \ |
178 |
|
|
179 |
# where non-positive: |
# where non-positive: |
180 |
ref=checkResult("where nonpositive("+ex1+")", \ |
ref=checkResult("where nonpositive("+ex1+")", \ |
181 |
(arg1-3).whereNonPositive(), \ |
(arg1-3)._whereNonPositive(), \ |
182 |
numarray.greater_equal(3.,arrays1[0]), \ |
numarray.greater_equal(3.,arrays1[0]), \ |
183 |
numarray.greater_equal(3.,arrays1[1]), \ |
numarray.greater_equal(3.,arrays1[1]), \ |
184 |
numarray.greater_equal(3.,arrays1[2]), \ |
numarray.greater_equal(3.,arrays1[2]), \ |
186 |
|
|
187 |
# where zero: |
# where zero: |
188 |
ref=checkResult("where zero("+ex1+")", \ |
ref=checkResult("where zero("+ex1+")", \ |
189 |
(arg1-3).whereZero(), \ |
(arg1-3)._whereZero(), \ |
190 |
numarray.less_equal(numarray.abs(arrays1[0]-3.),0.0), \ |
numarray.less_equal(numarray.abs(arrays1[0]-3.),0.0), \ |
191 |
numarray.less_equal(numarray.abs(arrays1[1]-3.),0.0), \ |
numarray.less_equal(numarray.abs(arrays1[1]-3.),0.0), \ |
192 |
numarray.less_equal(numarray.abs(arrays1[2]-3.),0.0), \ |
numarray.less_equal(numarray.abs(arrays1[2]-3.),0.0), \ |
194 |
|
|
195 |
# where non-zero: |
# where non-zero: |
196 |
ref=checkResult("where nonzero("+ex1+")", \ |
ref=checkResult("where nonzero("+ex1+")", \ |
197 |
(arg1-3).whereNonZero(), \ |
(arg1-3)._whereNonZero(), \ |
198 |
numarray.greater(numarray.abs(arrays1[0]-3.),0.0), \ |
numarray.greater(numarray.abs(arrays1[0]-3.),0.0), \ |
199 |
numarray.greater(numarray.abs(arrays1[1]-3.),0.0), \ |
numarray.greater(numarray.abs(arrays1[1]-3.),0.0), \ |
200 |
numarray.greater(numarray.abs(arrays1[2]-3.),0.0), \ |
numarray.greater(numarray.abs(arrays1[2]-3.),0.0), \ |
202 |
|
|
203 |
# exponential function: |
# exponential function: |
204 |
ref=checkResult("exp("+ex1+")", \ |
ref=checkResult("exp("+ex1+")", \ |
205 |
arg1.exp(), \ |
arg1._exp(), \ |
206 |
numarray.exp(arrays1[0]), \ |
numarray.exp(arrays1[0]), \ |
207 |
numarray.exp(arrays1[1]), \ |
numarray.exp(arrays1[1]), \ |
208 |
numarray.exp(arrays1[2]), \ |
numarray.exp(arrays1[2]), \ |
209 |
wh) |
wh) |
210 |
|
|
211 |
# sqrt |
# sqrt |
212 |
ref=checkResult("sqrt("+ex1+")", \ |
#ref=checkResult("sqrt("+ex1+")", \ |
213 |
arg1.abs().sqrt(), \ |
# arg1._abs()._sqrt(), \ |
214 |
numarray.sqrt(numarray.abs(arrays1[0])), \ |
# numarray.sqrt(numarray.abs(arrays1[0])), \ |
215 |
numarray.sqrt(numarray.abs(arrays1[1])), \ |
# numarray.sqrt(numarray.abs(arrays1[1])), \ |
216 |
numarray.sqrt(numarray.abs(arrays1[2])), \ |
# numarray.sqrt(numarray.abs(arrays1[2])), \ |
217 |
wh) |
# wh) |
218 |
|
|
219 |
# sin: |
# sin: |
220 |
ref=checkResult("sin("+ex1+")", \ |
ref=checkResult("sin("+ex1+")", \ |
221 |
arg1.sin(), \ |
arg1._sin(), \ |
222 |
numarray.sin(arrays1[0]), \ |
numarray.sin(arrays1[0]), \ |
223 |
numarray.sin(arrays1[1]), \ |
numarray.sin(arrays1[1]), \ |
224 |
numarray.sin(arrays1[2]), \ |
numarray.sin(arrays1[2]), \ |
226 |
|
|
227 |
# cos: |
# cos: |
228 |
ref=checkResult("cos("+ex1+")", \ |
ref=checkResult("cos("+ex1+")", \ |
229 |
arg1.cos(), \ |
arg1._cos(), \ |
230 |
numarray.cos(arrays1[0]), \ |
numarray.cos(arrays1[0]), \ |
231 |
numarray.cos(arrays1[1]), \ |
numarray.cos(arrays1[1]), \ |
232 |
numarray.cos(arrays1[2]), \ |
numarray.cos(arrays1[2]), \ |
234 |
|
|
235 |
# tan: |
# tan: |
236 |
ref=checkResult("tan("+ex1+")", \ |
ref=checkResult("tan("+ex1+")", \ |
237 |
arg1.tan(), \ |
arg1._tan(), \ |
238 |
numarray.tan(arrays1[0]), \ |
numarray.tan(arrays1[0]), \ |
239 |
numarray.tan(arrays1[1]), \ |
numarray.tan(arrays1[1]), \ |
240 |
numarray.tan(arrays1[2]), \ |
numarray.tan(arrays1[2]), \ |
266 |
|
|
267 |
# sinh: |
# sinh: |
268 |
ref=checkResult("sinh("+ex1+")", \ |
ref=checkResult("sinh("+ex1+")", \ |
269 |
arg1.sinh(), \ |
arg1._sinh(), \ |
270 |
numarray.sinh(arrays1[0]), \ |
numarray.sinh(arrays1[0]), \ |
271 |
numarray.sinh(arrays1[1]), \ |
numarray.sinh(arrays1[1]), \ |
272 |
numarray.sinh(arrays1[2]), \ |
numarray.sinh(arrays1[2]), \ |
274 |
|
|
275 |
# cosh: |
# cosh: |
276 |
ref=checkResult("cosh("+ex1+")", \ |
ref=checkResult("cosh("+ex1+")", \ |
277 |
arg1.cosh(), \ |
arg1._cosh(), \ |
278 |
numarray.cosh(arrays1[0]), \ |
numarray.cosh(arrays1[0]), \ |
279 |
numarray.cosh(arrays1[1]), \ |
numarray.cosh(arrays1[1]), \ |
280 |
numarray.cosh(arrays1[2]), \ |
numarray.cosh(arrays1[2]), \ |
282 |
|
|
283 |
# tanh: |
# tanh: |
284 |
ref=checkResult("tanh("+ex1+")", \ |
ref=checkResult("tanh("+ex1+")", \ |
285 |
arg1.tanh(), \ |
arg1._tanh(), \ |
286 |
numarray.tanh(arrays1[0]), \ |
numarray.tanh(arrays1[0]), \ |
287 |
numarray.tanh(arrays1[1]), \ |
numarray.tanh(arrays1[1]), \ |
288 |
numarray.tanh(arrays1[2]), \ |
numarray.tanh(arrays1[2]), \ |
355 |
|
|
356 |
# get the signs of the values: |
# get the signs of the values: |
357 |
ref=checkResult("sign("+ex1+")", \ |
ref=checkResult("sign("+ex1+")", \ |
358 |
arg1.sign(), \ |
arg1._sign(), \ |
359 |
numarray.greater(arrays1[0],numarray.zeros(arrays1[0].shape)) \ |
numarray.greater(arrays1[0],numarray.zeros(arrays1[0].shape)) \ |
360 |
-numarray.less(arrays1[0],numarray.zeros(arrays1[0].shape)),\ |
-numarray.less(arrays1[0],numarray.zeros(arrays1[0].shape)),\ |
361 |
numarray.greater(arrays1[1],numarray.zeros(arrays1[1].shape)) \ |
numarray.greater(arrays1[1],numarray.zeros(arrays1[1].shape)) \ |