2024-08-30 13:46:30 +08:00
<!DOCTYPE html>
< html lang = "zh-Hans" dir = "ltr" >
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width,initial-scale=1" >
2024-08-31 06:08:36 +08:00
< title > mbcp.mp_math.function | MBCP 文档< / title >
< meta name = "description" content = "MBCP 粒子计算和生成库文档" >
2024-08-30 13:46:30 +08:00
< meta name = "generator" content = "VitePress v1.3.4" >
2024-09-04 19:00:02 +08:00
< link rel = "preload stylesheet" href = "/assets/style.OKdX1nxj.css" as = "style" >
2024-08-30 13:46:30 +08:00
2024-09-04 19:00:02 +08:00
< script type = "module" src = "/assets/app.DB1cC_Qh.js" > < / script >
< link rel = "modulepreload" href = "/assets/chunks/theme.D-Utut8Q.js" >
2024-08-31 07:55:26 +08:00
< link rel = "modulepreload" href = "/assets/chunks/framework.DpC1ZpOZ.js" >
2024-09-03 22:49:39 +08:00
< link rel = "modulepreload" href = "/assets/api_mp_math_function.md.C0P_-kol.lean.js" >
2024-08-31 06:08:36 +08:00
< link rel = "icon" type = "image/svg+xml" href = "/mbcp-logo.svg" >
2024-08-31 07:31:49 +08:00
< link rel = "stylesheet" href = "https://fonts.font.im/css?family=Cousine:400,400i,700,700i|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" >
2024-08-30 13:46:30 +08:00
< script id = "check-dark-mode" > ( ( ) => { const e = localStorage . getItem ( "vitepress-theme-appearance" ) || "auto" , a = window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches ; ( ! e || e === "auto" ? a : e === "dark" ) && document . documentElement . classList . add ( "dark" ) } ) ( ) ; < / script >
< script id = "check-mac-os" > document . documentElement . classList . toggle ( "mac" , /Mac|iPhone|iPod|iPad/i . test ( navigator . platform ) ) ; < / script >
< / head >
< body >
2024-09-03 22:49:39 +08:00
< div id = "app" > < div class = "Layout" data-v-3b4648ff > <!-- [ --> <!-- ] --> <!-- [ --> < span tabindex = "-1" data-v-e813112c > < / span > < a href = "#VPContent" class = "VPSkipLink visually-hidden" data-v-e813112c > Skip to content < / a > <!-- ] --> <!-- --> < header class = "VPNav" data-v-3b4648ff data-v-e823d444 > < div class = "VPNavBar has-sidebar top" data-v-e823d444 data-v-da0688be > < div class = "wrapper" data-v-da0688be > < div class = "container" data-v-da0688be > < div class = "title" data-v-da0688be > < div class = "VPNavBarTitle has-sidebar" data-v-da0688be data-v-606a7e0f > < a class = "title" href = "/" data-v-606a7e0f > <!-- [ --> <!-- ] --> <!-- [ --> < img class = "VPImage logo" src = "/mbcp-logo.svg" alt data-v-cc63e071 > <!-- ] --> < span data-v-606a7e0f > MBCP 文档< / span > <!-- [ --> <!-- ] --> < / a > < / div > < / div > < div class = "content" data-v-da0688be > < div class = "content-body" data-v-da0688be > <!-- [ --> <!-- ] --> < div class = "VPNavBarSearch search" data-v-da0688be > <!-- [ --> <!-- --> < div id = "local-search" > < button type = "button" class = "DocSearch DocSearch-Button" aria-label = "打开搜索框" > < span class = "DocSearch-Button-Container" > < span class = "vp-icon DocSearch-Search-Icon" > < / span > < span class = "DocSearch-Button-Placeholder" > 搜索文档< / span > < / span > < span class = "DocSearch-Button-Keys" > < kbd class = "DocSearch-Button-Key" > < / kbd > < kbd class = "DocSearch-Button-Key" > K< / kbd > < / span > < / button > < / div > <!-- ] --> < / div > < nav aria-labelledby = "main-nav-aria-label" class = "VPNavBarMenu menu" data-v-da0688be data-v-bf53b681 > < span id = "main-nav-aria-label" class = "visually-hidden" data-v-bf53b681 > Main Navigation < / span > <!-- [ --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/guide/" tabindex = "0" data-v-bf53b681 data-v-9a0da802 > <!-- [ --> < span data-v-9a0da802 > 快速开始< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/refer.html" tabindex = "0" data-v-bf53b681 data-v-9a0da802 > <!-- [ --> < span data-v-9a0da802 > 参考< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/api/" tabindex = "0" data-v-bf53b681 data-v-9a0da802 > <!-- [ --> < span data-v-9a0da802 > API引用< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/demo/" tabindex = "0" data-v-bf53b681 data-v-9a0da802 > <!-- [ --> < span data-v-9a0da802 > 实例< / span > <!-- ] --> < / a > <!-- ] --> <!-- ] --> < / nav > < div class = "VPFlyout VPNavBarTranslations translations" data-v-da0688be data-v-912817b1 data-v-00660109 > < button type = "button" class = "button" aria-haspopup = "true" aria-expanded = "false" aria-label = "Change language" data-v-00660109 > < span class = "text" data-v-00660109 > < span class = "vpi-languages option-icon" data-v-00660109 > < / span > <!-- --> < span class = "vpi-chevron-down text-icon" data-v-00660109 > < / span > < / span > < / button > < div class = "menu" data-v-00660109 > < div class = "VPMenu" data-v-00660109 data-v-809b8af7 > <!-- --> <!-- [ --> <!-- [ --> < div class = "items" data-v-912817b1 > < p class = "title" data-v-912817b1 > 简体中文< / p > <!-- [ --> < div class = "VPMenuLink" data-v-912817b1 data-v-25a54821 > < a class = "VPLink link" href = "/en/api/mp_math/function.html" data-v-25a54821 > <!-- [ --> English<!-- ] --> < / a > < / div > < div class = "VPMenuLink" data-v-912817b1 data-v-25a54821 > < a class = "VPLink link" href = "/ja/api/mp_math/function.html" data-v-25a54821 > <!-- [ --> 日本語<!-- ] --> < / a > < / div > < div class = "VPMenuLink" data-v-912817b1 data-v-25a54821 > < a class = "VPLink link" href = "/zht/api/mp_math/function.html" data-v-25a54821 > <!-- [ --> 繁體中文<!-- ] --> < / a > < / div > <!-- ] --> < / div > <!-- ] --> <!-- ] --> < / div > < / div > < / div > < div class = "VPNavBarAppearance appearance" data-v-da0688be data-v-864d2abc > < button class = "VPSwitch VPSwitchAppearance" type = "button" role = "switch" title = "Switch to dark theme" aria-checked = "false" data-v-864d2abc data-v-3125216b data-v-846fe538 > < span class = "check" data-v-846fe538 > < span class = "icon" data-v-846fe538 > <!-- [ --> < span class = "vpi-sun sun" data-v-3125216b > < / span > < span class = "vpi-moon moon" data-v-3125216b > < / span > <!-- ] --> < / span > < / span > < / button > < / div > < div class = "VPSocialLinks VPNavBarSocialLinks social-links" data-v-da0688be data-v-2c606308 data-v-100434c4 > <!-- [ --> < a class = "VPSocialLink no-icon" href = "https://github.com/snowykami/mbcp" aria-label = "github" target = "_blank"
2024-08-30 13:46:30 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 计算三元函数在某点的梯度向量。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > > [!tip]< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > > 已知一个函数$f(x, y, z)$,则其在点$(x_0, y_0, z_0)$处的梯度向量为:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > $< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > \\< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > nabla f(x_0, y_0, z_0) = < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > \\< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > left(< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > \\< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > frac{< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > \\< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > partial f}{< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > \\< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > partial x}, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > \\< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > frac{< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > \\< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > partial f}{< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > \\< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > partial y}, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > \\< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > frac{< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > \\< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > partial f}{< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > \\< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > partial z}< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > \\< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > right)$< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
2024-08-31 09:34:37 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > func ([`ThreeSingleVarsFunc`](./mp_math_typing#var-threesinglevarsfunc)): 三元函数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > p ([`Point3`](./point#class-point3)): 点< / span > < / span >
2024-08-30 13:46:30 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > epsilon: 偏移量< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 梯度< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > dx < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (func(p.x < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > +< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > epsilon, p.y, p.z) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > func(p.x < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > epsilon, p.y, p.z)) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > /< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 2< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > epsilon)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > dy < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (func(p.x, p.y < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > +< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > epsilon, p.z) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > func(p.x, p.y < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > epsilon, p.z)) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > /< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 2< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > epsilon)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > dz < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (func(p.x, p.y, p.z < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > +< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > epsilon) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > func(p.x, p.y, p.z < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > epsilon)) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > /< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 2< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > epsilon)< / span > < / span >
2024-09-01 00:02:40 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > Vector3(dx, dy, dz)< / span > < / span > < / code > < / pre > < / div > < / details > < h3 id = "func-curry-func-multivarsfunc-args-var-onevarfunc" tabindex = "-1" > < em > < strong > func< / strong > < / em > < code > curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc< / code > < a class = "header-anchor" href = "#func-curry-func-multivarsfunc-args-var-onevarfunc" aria-label = "Permalink to "***func*** `curry(func: MultiVarsFunc, *args: Var) -> OneVarFunc`"" > < / a > < / h3 > < p > < strong > 说明< / strong > : 对多参数函数进行柯里化。< / p > < div class = "tip custom-block github-alert" > < p class = "custom-block-title" > TIP< / p > < p > 有关函数柯里化,可参考< a href = "https://zhuanlan.zhihu.com/p/355859667" target = "_blank" rel = "noreferrer" > 函数式编程--柯理化( Currying) < / a > < / p > < / div > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > func (< a href = "./mp_math_typing.html#var-multivarsfunc" > < code > MultiVarsFunc< / code > < / a > ): 函数< / li > < li > *args (< a href = "./mp_math_typing.html#var-var" > < code > Var< / code > < / a > ): 参数< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 柯里化后的函数< / p > < p > < strong > 示例< / strong > :< / p > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > add< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (a: < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > int< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > , b: < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > int< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > , c: < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > int< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) -> < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > int< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-08-31 06:08:36 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > a < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > +< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > b < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > +< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > c< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > add_curried < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > curry(add, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 1< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > , < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 2< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > )< / span > < / span >
2024-08-31 06:57:34 +08:00
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > add_curried(< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 3< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) < / span > < span style = "--shiki-light:#6A737D;--shiki-dark:#6A737D;" > # 6< / span > < / span > < / code > < / pre > < / div > < details > < summary > < b > 源代码< / b > 或 < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/function.py#L30" target = "_blank" > 在GitHub上查看< / a > < / summary > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > curry< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (func: MultiVarsFunc, < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args: Var) -> OneVarFunc:< / span > < / span >
2024-08-31 06:08:36 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 对多参数函数进行柯里化。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > > [!tip]< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > > 有关函数柯里化,可参考[函数式编程--柯理化( Currying) ](https://zhuanlan.zhihu.com/p/355859667)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
2024-08-31 09:34:37 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > func ([`MultiVarsFunc`](./mp_math_typing#var-multivarsfunc)): 函数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > *args ([`Var`](./mp_math_typing#var-var)): 参数< / span > < / span >
2024-08-31 06:08:36 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 柯里化后的函数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Examples:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ```python< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > def add(a: int, b: int, c: int) -> int:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > return a + b + c< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > add_curried = curry(add, 1, 2)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > add_curried(3) # 6< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ```< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > curried_func< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args2: Var) -> Var:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " @litedoc-hide" " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > func(< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args, < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args2)< / span > < / span >
2024-09-03 22:49:39 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > curried_func< / span > < / span > < / code > < / pre > < / div > < / details > < / div > < / div > < / main > < footer class = "VPDocFooter" data-v-01c90815 data-v-28deee4a > <!-- [ --> <!-- ] --> < div class = "edit-info" data-v-28deee4a > < div class = "edit-link" data-v-28deee4a > < a class = "VPLink link vp-external-link-icon no-icon edit-link-button" href = "https://github.com/snowykami/mbcp/tree/main/mbcp//mp_math/function.py" target = "_blank" rel = "noreferrer" data-v-28deee4a > <!-- [ --> < span class = "vpi-square-pen edit-link-icon" data-v-28deee4a > < / span > 在 GitHub 上编辑此页<!-- ] --> < / a > < / div > <!-- --> < / div > < nav class = "prev-next" aria-labelledby = "doc-footer-aria-label" data-v-28deee4a > < span class = "visually-hidden" id = "doc-footer-aria-label" data-v-28deee4a > Pager< / span > < div class = "pager" data-v-28deee4a > < a class = "VPLink link pager-link prev" href = "/api/mp_math/equation.html" data-v-28deee4a > <!-- [ --> < span class = "desc" data-v-28deee4a > 上一页< / span > < span class = "title" data-v-28deee4a > mbcp.mp_math.equation< / span > <!-- ] --> < / a > < / div > < div class = "pager" data-v-28deee4a > < a class = "VPLink link pager-link next" href = "/api/mp_math/" data-v-28deee4a > <!-- [ --> < span class = "desc" data-v-28deee4a > 下一页< / span > < span class = "title" data-v-28deee4a > mbcp.mp_math< / span > <!-- ] --> < / a > < / div > < / nav > < / footer > <!-- [ --> <!-- ] --> < / div > < / div > < / div > <!-- [ --> <!-- ] --> < / div > < / div > < footer class = "VPFooter has-sidebar" data-v-3b4648ff data-v-d69bcf5d > < div class = "container" data-v-d69bcf5d > < p class = "message" data-v-d69bcf5d > 文档由 < a href = "https://vitepress.dev/" > VitePress< / a > 构建 | API引用由 < a href = "https://github.com/LiteyukiStudio/litedoc" > litedoc< / a > 生成< / p > < p class = "copyright" data-v-d69bcf5d > Copyright (C) 2020-2024 SnowyKami. All Rights Reserved< / p > < / div > < / footer > <!-- [ --> <!-- ] --> < / div > < / div >
< script > w i n d o w . _ _ V P _ H A S H _ M A P _ _ = J S O N . p a r s e ( " { \ " a p i _ i n d e x . m d \ " : \ " Y S - z q W w M \ " , \ " a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " C T h Q B 5 n q \ " , \ " a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " D q j Q Q 6 Y m \ " , \ " a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " C 1 Y M G s I R \ " , \ " a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " C 0 P _ - k o l \ " , \ " a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " y E j 9 p z O D \ " , \ " a p i _ m p _ m a t h _ l i n e . m d \ " : \ " O k m n 0 B T W \ " , \ " a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " b d i O S v F y \ " , \ " a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " D l - F d X x 3 \ " , \ " a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " x U 6 H j e L 2 \ " , \ " a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " B q l o N j d D \ " , \ " a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " C G B Z j r 3 t \ " , \ " a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " B 4 4 3 f t A V \ " , \ " a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " V x g s H i Z a \ " , \ " a p i _ p r e s e t s _ i n d e x . m d \ " : \ " B E Z B x 6 G j \ " , \ " a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " C z r Z X 1 L i \ " , \ " d e m o _ b e s t - p r a c t i c e . m d \ " : \ " C m Y j f r x d \ " , \ " d e m o _ i n d e x . m d \ " : \ " C V A d l a F I \ " , \ " e n _ a p i _ i n d e x . m d \ " : \ " B r J l a d - k \ " , \ " e n _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " B v z e T d t j \ " , \ " e n _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " C r U t _ 3 F V \ " , \ " e n _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " C H B t H 4 v 6 \ " , \ " e n _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " D 6 8 b T y e d \ " , \ " e n _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " D 3 3 1 A s 7 i \ " , \ " e n _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " B 6 9 k H o P c \ " , \ " e n _ a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " x R G J G U M m \ " , \ " e n _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " B d K g R u m w \ " , \ " e n _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " B e T 2 o q I N \ " , \ " e n _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " D b F v I n H k \ " , \ " e n _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " C Y q 8 h n c D \ " , \ " e n _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " C P G k Z z w r \ " , \ " e n _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " Z K B y d _ x 0 \ " , \ " e n _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " B h o Z y G S V \ " , \ " e n _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " B M 4 z z W d 9 \ " , \ " e n _ d e m o _ b e s t - p r a c t i c e . m d \ " : \ " C m t Y 1 0 5 n \ " , \ " e n _ g u i d e _ i n d e x . m d \ " : \ " C 3 k I 8 f 8 A \ " , \ " e n _ i n d e x . m d \ " : \ " C c - N t 9 O t \ " , \ " e n _ r e f e r _ i n d e x . m d \ " : \ " C q 6 G W i 0 V \ " , \ " g u i d e _ i n d e x . m d \ " : \ " C J O q v l S E \ " , \ " i n d e x . m d \ " : \ " W V p b C 1 C 1 \ " , \ " j a _ a p i _ i n d e x . m d \ " : \ " 6 u 5 f 7 W 7 q \ " , \ " j a _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " C b T F N F p P \ " , \ " j a _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " H r V L d L V W \ " , \ " j a _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " B R _ c j Y x P \ " , \ " j a _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " C e N P n p r i \ " , \ " j a _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " B V Y Y B c g X \ " , \ " j a _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " C m V m q 6 P C \ " , \ " j a _ a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " B n S H E E F C \ " , \ " j a _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " D 7 v 3 q _ U 8 \ " , \ " j a _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " B q C 8 J g j G \ " , \ " j a _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " v i 1 F H 0 - - \ " , \ " j a _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " D h P m c v K - \ " , \ " j a _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " B 7 o D y - S U \ " , \ " j a _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " i g h e y 3 J D \ " , \ " j a _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " B o w 2 2 H N O \ " , \ " j a _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " C - u C q j X i \ " , \ " j a _ d e m o _ b e s t - p r a c t i c e . m d \ " : \ " C B H i F 6 e c \ " , \ " j a _ g u i d e _ i n d e x . m d \ " : \ " w 1 T f 2 A d m \ " , \ " j a _ i n d e x . m d \ " : \ " B v j V 8 R I J \ " , \ " j a _ r e f e r _ i n d e x . m d \ " : \ " D a m U s c s 8 \ " , \ " r e f e r _ f u n c t i o n _ c u r r y . m d \ " : \ " D _ o q R D d 3 \ " , \ " r e f e r _ f u n c t i o n _ f u n c t i o n . m d \ " : \ " B i _ 8 2 l I J \ " , \ " r e f e r _ i n d e x . m d \ " : \ " y F Z W 0 k I 4 \ " , \ " z h t _ a p i _ i n d e x . m d \ " : \ " D M j E 1 x B r \ " , \ " z h t _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " D 6 i - - 7 z d \ " , \ " z h t _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " D I 0 x A y W X \ " , \ " z h t _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " B 3 r t 0 P g w \ " , \ " z h t _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " C f 9 u t a T V \ " , \ " z h t _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " D b g I 3 v D 1 \ " , \ " z h t _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " - w t K M T M J \ " , \ " z h t _ a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " B b O e R s - n \ " , \ " z h t _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " o _ V r o q h a \ " , \ " z h t _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " C N w x P Y y R \ " , \ " z h t _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " D r 2 1 f 1 4 B \ " , \ " z h t _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " B 5 7 z 4 I w N \ " , \ " z h t _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " D C G 5 C r a B \ " , \ " z h t _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " D j Z A B i v I \ " , \ " z h t _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " B l 7 t n V S 9 \ " , \ " z h t _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " B Q a n u b Q 0 \ " , \ " z h t _ d e m o _ b e s t - p r a c t i c e . m d \ " : \ " C P N b D _ L g \ " , \ " z h t _ g u i d e _ i n d e x . m d \ " : \ " B N n M V i C 8 \ " , \ " z h t _ i n d e x . m d \ " : \ " f k O Y k Z Z e \ " , \ " z h t _ r e f e r _ i n d e x . m d \ " : \ " B 7 C Q S 2 U W \ " } " ) ; f u n c t i o n d e s e r i a l i z e F u n c t i o n s ( r ) { r e t u r n A r r a y . i s A r r a y ( r ) ? r . m a p ( d e s e r i a l i z e F u n c t i o n s ) : t y p e o f r = = " o b j e c t " & & r ! = = n u l l ? O b j e c t . k e y s ( r ) . r e d u c e ( ( t , n ) = > ( t [ n ] = d e s e r i a l i z e F u n c t i o n s ( r [ n ] ) , t ) , { } ) : t y p e o f r = = " s t r i n g " & & r . s t a r t s W i t h ( " _ v p - f n _ " ) ? n e w F u n c t i o n ( ` r e t u r n $ { r . s l i c e ( 7 ) } ` ) ( ) : r } ; w i n d o w . _ _ V P _ S I T E _ D A T A _ _ = d e s e r i a l i z e F u n c t i o n s ( J S O N . p a r s e ( " { \ " l a n g \ " : \ " e n - U S \ " , \ " d i r \ " : \ " l t r \ " , \ " t i t l e \ " : \ " V i t e P r e s s \ " , \ " d e s c r i p t i o n \ " : \ " A V i t e P r e s s s i t e \ " , \ " b a s e \ " : \ " / \ " , \ " h e a d \ " : [ ] , \ " r o u t e r \ " : { \ " p r e f e t c h L i n k s \ " : t r u e } , \ " a p p e a r a n c e \ " : t r u e , \ " t h e m e C o n f i g \ " : { \ " l o g o \ " : \ " / m b c p - l o g o . s v g \ " , \ " s i d e b a r \ " : { \ " / a p i / \ " : { \ " b a s e \ " : \ " / a p i / \ " , \ " i t e m s \ " : [ { \ " t e x t \ " : \ " M B C P \ " , \ " i t e m s \ " : [ { \ " t e x t \ " : \ " m p _ m a t h \ " , \ " i t e m s \ " : [ { \ " t e x t \ " : \ " m b c p . m p _ m a t h . a n g l e \ " , \ " l i n k \ " : \ " m p _ m
2024-08-30 13:46:30 +08:00
< / body >
< / html >