|
SOLUTIONS
|
NestWhileList
NestWhileList[f, expr, test]
用来生成一个以 expr 开始,然后重复应用 f 直到 test 不再得到 True 为止的结果列表.
NestWhileList[f, expr, test, m]
将最近的 m 个结果作为每一步 test 的参数.
NestWhileList[f, expr, test, All]
将所有结果作为每一步 test 的参数.
NestWhileList[f, expr, test, m, max]
将 f 应用最多 max 次.
更多信息更多信息
- 由 NestWhileList[f, expr, test] 返回的列表中的最后一个元素通常是 test 不为 True 的表达式.
- NestWhileList[f, expr, test, m] 在每一步对
进行计算. 它不把结果
放在一个列表中.
以它们生成的顺序给出,最近的放在最后.- 直到生成至少有 m 个结果时,NestWhileList[f, expr, test, m] 才开始应用 test. »
- 直到生成至少有 mmin 个结果时,NestWhileList[f, expr, test, {mmin, m}] 才开始应用 test. 然后它在每一步为 test 提供不超过 m 的尽可能多的最近结果作为参数. »
- NestWhileList[f, expr, test, m] 等价于 NestWhileList[f, expr, test, {m, m}]. »
- NestWhileList[f, expr, UnsameQ, 2] 等价于 FixedPointList[f, expr]. »
- NestWhileList[f, expr, test, All] 等价于 NestWhileList[f, expr, test, {1, Infinity}]. »
- NestWhileList[f, expr, UnsameQ, All] 不断应用 f 直至相同结果首次出现不止一次.
- NestWhileList[f, expr, test, m, max, n] 把 f 额外应用 n 次,并把该结果添加到列表中. »
- NestWhileList[f, expr, test, m, max, -n] 从所生成的列表中丢掉最后 n 个元素. »
版本 4 的新功能
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
