Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6141 > unrolled thread
| Started by | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| First post | 2011-11-03 08:50 +0000 |
| Last post | 2011-11-03 08:50 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: iteration question DrMajorBob <btreat1@austin.rr.com> - 2011-11-03 08:50 +0000
| From | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| Date | 2011-11-03 08:50 +0000 |
| Subject | Re: iteration question |
| Message-ID | <j8tkle$f0c$1@smc.vnet.net> |
What could be simpler or more efficient than Length, if you want to know
how long a list is?
Bobby
On Wed, 02 Nov 2011 06:21:44 -0500, Francisco Gutierrez
<fgutiers2002@yahoo.com> wrote:
> Dear Group:
>
> I have a function, and I iterate it using fixedpoint. Something of this
> sort:
>
> FixedPointList[
> function[arg1,arg2,arg3, #] &, arg4,
> SameTest -> (Max[Abs[Flatten[#1] - Flatten[#2]]] < 0.01 &)]
>
>
> I would like to know how many steps it takes this function to converge.
> I have tried with EvaluationMonitor to no avail:
>
> Block[{veamos, c = 0},
> veamos = FixedPoint[
> function[arg1,arg2,arg3, #] &, arg4,
> SameTest -> (Max[Abs[Flatten[#1] - Flatten[#2]]]< 0.01 &)];
> EvaluationMonitor :> c++; {veamos, c}]
>
>
> The iterator c simply does not move, and the previous function works ok
> but returns the value of c as 0.
>
> I tried if this was true with Length[FixedPointList[...]] and the answer
> was 20 (which should be the value of c in the immediately previous
> function). In principle, this would solve my problem, but it seems
> rather inefficient, especially when the convergence criterion is severe
> (not 0.01, but say 10^-4).
>
> Is there an efficient and nice way to solve this?
>
> Thanks,
>
> Francisco
--
DrMajorBob@yahoo.com
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web