MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: simple nest

  • To: mathgroup at smc.vnet.net
  • Subject: [mg106678] Re: [mg106661] simple nest
  • From: Leonid Shifrin <lshifr at gmail.com>
  • Date: Thu, 21 Jan 2010 04:50:26 -0500 (EST)
  • References: <201001201150.GAA09275@smc.vnet.net>

Francisco,

This is a follow-up to my previous post. To be logically correct, the
example I gave with a test function with named arguments had to be with the
order of arguments interchanged:

 Function[{prev, this}, UnsameQ[this[[2]], prev[[2]]]]

instead of

 Function[{this, prev}, UnsameQ[this[[2]], prev[[2]]]]

Sorry for the confusion.

Regards,
Leonid



On Wed, Jan 20, 2010 at 2:50 PM, Francisco Gutierrez <fgutiers2002 at yahoo.com
> wrote:

> Dear group:
> I have a function that gets five arguments, two of which are fixed, and
> three vary. Its output are three numbers. So it can be nested, for example
> over some initial values.
> Say:
> Nest[func[arg1,arg2,#[[1]],#[[2]],#[[3]]]&,{init1,init2,init3},k]
>
> Simple enough, works well.
> Now I want to nest the same function, while the second non fixed argument
> changes at each step. I thought the "natural" way of doing this was:
>
> NestWhile[func[arg1,arg2,#[[1]],#[[2]],#[[3]]]&,{init1,init2,init3},UnsameQ[#[[2]]&,2],
> but this evidently does not work.
>
> So: in a NestWhile how do I create tests over parts of the outputs of a
> function?
> Thanks!
> Fg
>
>



  • References:
    • simple nest
      • From: Francisco Gutierrez <fgutiers2002@yahoo.com>
  • Prev by Date: Re: Re: Replace list element based on a
  • Next by Date: Re: Pagination when transferring Mathematica docs to PDF
  • Previous by thread: simple nest
  • Next by thread: Re: simple nest