项目作者: tpfto

项目描述 :
cycle detection methods in Mathematica
高级语言: Mathematica
项目地址: git://github.com/tpfto/CycleDetect.git
创建时间: 2018-09-25T17:14:28Z
项目社区:https://github.com/tpfto/CycleDetect

开源协议:

下载


Cycle Detection

CycleFixedPoint.m implements the function CycleFixedPoint, which can be used to detect cycling in an iterative process.

The function implements both the algorithms of Floyd and Brent to detect cycles.

Some examples:

  1. CycleFixedPoint[Mod[7 # + 3, 11] &, 2, Method -> "Brent"]
  2. {4, 9, 0, 3, 2, 6, 1, 10, 7, 8}
  3. CycleFixedPoint[Mod[7 # + 3, 11] &, 2, Method -> "Floyd"]
  4. {2, 6, 1, 10, 7, 8, 4, 9, 0, 3}
  5. CycleFixedPoint[3.5 # (1 - #) &, 0.2, Method -> "Brent"]
  6. {0.826941, 0.500884, 0.874997, 0.38282}
  7. CycleFixedPoint[3.5 # (1 - #) &, 0.2, Method -> "Floyd"]
  8. {0.826941, 0.500884, 0.874997, 0.38282}

See the package for more details.