SequenceFold

SequenceFold[f,{x1,,xn},{a1,a2,}]

给出 SequenceFoldList[f,{x1,,xn},{a1,a2,}] 的最后一个元素.

SequenceFold[f,{x1,,xn},{a1,a2,},k]

在每一步中将 f 应用于 k 个自变量,其中前 n 个自变量来自 xi 或之前的结果,后 k-n 个来自 ai.

更多信息

  • SequenceFold[f,{x1,,xn},{a1,a2,}] 中,认为函数 fn+1 个自变量.
  • SequenceFold[f,{x},{a1,a2,}] 等价于 Fold[f,x,{a1,a2,}].
  • SequenceFold[f,{x1,,xn},{a1,a2,}] 等价于 SequenceFold[f,{x1,,xn},{a1,a2,},n+1].
  • SequenceFold[f,{x1,,xn},{a1,a2,},k] 中,整数 k 必须服从 kn.

范例

打开所有单元关闭所有单元

基本范例  (2)

范围  (2)

每次迭代时,从第三个自变量的列表中取出一个元素:

每次迭代时,从第三个自变量的列表中取出几个元素:

属性和关系  (5)

SequenceFold[f,xlist,alist] 返回 SequenceFoldList[f,xlist,alist] 的最后一个元素:

从一个长度为1的种子序列开始将使 SequenceFold 等价于 Fold

一个空种子序列使 SequenceFold 将函数应用于最后一个列表的最后一个元素:

如果 f 只有一个自变量,则 SequenceFold 等价于 Nest

函数的自变量数目不能小于种子序列的长度:

如果它们相等,则第三个自变量中的列表的实际元素不会被使用:

可能存在的问题  (1)

下面这种情况未被明确定义,因此未被计算:

Wolfram Research (2015),SequenceFold,Wolfram 语言函数,https://reference.wolfram.com/language/ref/SequenceFold.html.

文本

Wolfram Research (2015),SequenceFold,Wolfram 语言函数,https://reference.wolfram.com/language/ref/SequenceFold.html.

CMS

Wolfram 语言. 2015. "SequenceFold." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/SequenceFold.html.

APA

Wolfram 语言. (2015). SequenceFold. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/SequenceFold.html 年

BibTeX

@misc{reference.wolfram_2024_sequencefold, author="Wolfram Research", title="{SequenceFold}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/SequenceFold.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_sequencefold, organization={Wolfram Research}, title={SequenceFold}, year={2015}, url={https://reference.wolfram.com/language/ref/SequenceFold.html}, note=[Accessed: 22-November-2024 ]}