Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7199

Re: NMinimize problem: fct minimized uses FindRoot

From "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: NMinimize problem: fct minimized uses FindRoot
Date 2011-12-14 11:05 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jc9vum$a12$1@smc.vnet.net> (permalink)
References <201112121143.GAA12817@smc.vnet.net> <jc7asl$p1d$1@smc.vnet.net>

Show all headers | View raw


On Tue, 13 Dec 2011 10:54:13 -0000, Oliver Ruebenkoenig  
<ruebenko@wolfram.com> wrote:

>
> On Mon, 12 Dec 2011, Oleksandr Rasputinov wrote:
>
>> For example, the erroneous usage:
>>
>> Block[{a = 1, b = 2}, Return[a]; Return[b]]
>
> You can "fix" this by using
>
> Block[{a = 1, b = 2}, Return[a, Block]; Return[b]]
>
> but Throw/Catch is probably a better bet.
>
> Oliver
>

Interesting; this two-argument form of Return seems like it could be quite  
useful. However, as far as I can see, this possibility has never been  
listed on the main page for Return, nor on those for Break or Continue  
(with which a second argument can also be used), even though it has been  
allowed since version 4 at the latest. The only documentation that I could  
find suggesting that it exists at all is for the message (Return::nofunc)  
that one sees after using it incorrectly. Is this likely to change in  
future, or has it been left deliberately undocumented to discourage its  
use?

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: NMinimize problem: fct minimized uses FindRoot Oliver Ruebenkoenig <ruebenko@wolfram.com> - 2011-12-13 10:54 +0000
  Re: NMinimize problem: fct minimized uses FindRoot "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-12-14 11:05 +0000

csiph-web