FindMinimum: foo[x_?NumericQ] vs. NumberQ
- To: mathgroup at smc.vnet.net
- Subject: [mg46674] FindMinimum: foo[x_?NumericQ] vs. NumberQ
- From: frankeye at cox.net (Frank Iannarilli)
- Date: Fri, 27 Feb 2004 19:32:02 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
In a November 2003 thread by Jiang Xiao, the group recommended a fix
for:
FindMinimum[foo[x],{x,x0,x1...}]
whereas FindMinimum was evidently attempting a symbolic gradient
evaluation of foo[], even though the invocation was indicating to use
numeric derivatives.
The recommended fix was to redefine foo[] as so:
foo[x_?NumericQ]
This evidently worked for all involved, but I tried it on what I
thought was a similar problem, and had no luck.
However, what did work was using NumberQ instead of NumericQ in the
pattern-match test. Go figure.
HTHs somebody.