LMCAS
Lamina Computer Algebra System
载入中...
搜索中...
未找到
complex_analysis.hpp
浏览该文件的文档.
1/**
2 * @file complex_analysis.hpp
3 * @brief 复变函数分析:留数计算,柯西积分公式,解析延拓.
4 */
5#pragma once
7#include "result.hpp"
8#include "symbolic.hpp"
9#include <memory>
10#include <string>
11
12namespace LMCAS {
13
15
16/**
17 * @brief 计算复变函数在某极点处的留数
18 * @param f 被积函数
19 * @param z 复变量名
20 * @param z0 极点
21 * @param order 极点的阶数(默认为1,简单极点)
22 * @return 留数的符号表达式
23 */
25 const std::shared_ptr<SymbolicExpr>& f,
26 const std::string& z,
27 const std::shared_ptr<SymbolicExpr>& z0,
28 int order,
30);
31
32/**
33 * @brief 使用默认计算上下文计算留数,并显式报告无效输入和未覆盖域.
34 */
36 const std::shared_ptr<SymbolicExpr>& f,
37 const std::string& z,
38 const std::shared_ptr<SymbolicExpr>& z0,
39 int order = 1
40);
41
42
43/**
44 * @brief 使用柯西积分公式计算闭合路径积分 contour_integral f(z)/(z-z0)^n dz
45 * @param f 解析函数部分
46 * @param z 复变量名
47 * @param z0 奇点
48 * @param n 阶数
49 * @return 积分结果的符号表达式
50 */
52 const std::shared_ptr<SymbolicExpr>& f,
53 const std::string& z,
54 const std::shared_ptr<SymbolicExpr>& z0,
55 int n,
57);
58
59/**
60 * @brief 使用默认计算上下文应用柯西积分公式,并显式报告无效输入和未覆盖域.
61 */
63 const std::shared_ptr<SymbolicExpr>& f,
64 const std::string& z,
65 const std::shared_ptr<SymbolicExpr>& z0,
66 int n = 1
67);
68
69
70/**
71 * @brief 尝试对函数进行解析延拓
72 * @param f 输入函数
73 * @param z 复变量名
74 * @return 显式延拓结果;当前规则保持输入表达式时返回其自身
75 */
76LMCAS_API std::shared_ptr<SymbolicExpr> analytic_continuation(
77 const std::shared_ptr<SymbolicExpr>& f,
78 const std::string& z
79);
80
81/**
82 * @brief 提取表达式的实部 Re(expr).
83 *
84 * 将复变量 z = x + iy(或显式 i 单位)展开,分离实部.
85 * 对实值表达式直接返回自身.
86 *
87 * @param expr 输入表达式
88 * @return 实部表达式
89 */
91 const std::shared_ptr<SymbolicExpr>& expr,
93);
94
95/**
96 * @brief 使用默认计算上下文提取表达式实部,并显式报告无效输入.
97 */
99 const std::shared_ptr<SymbolicExpr>& expr
100);
101
102
103/**
104 * @brief 提取表达式的虚部 Im(expr).
105 * @param expr 输入表达式
106 * @return 虚部表达式
107 */
109 const std::shared_ptr<SymbolicExpr>& expr,
111);
112
113/**
114 * @brief 使用默认计算上下文提取表达式虚部,并显式报告无效输入.
115 */
117 const std::shared_ptr<SymbolicExpr>& expr
118);
119
120
121/**
122 * @brief 计算表达式的复共轭 conj(expr),将 i 替换为 -i.
123 * @param expr 输入表达式
124 * @return 共轭表达式
125 */
127 const std::shared_ptr<SymbolicExpr>& expr,
129);
130
131/**
132 * @brief 使用默认计算上下文计算共轭,并显式报告无效输入.
133 */
135 const std::shared_ptr<SymbolicExpr>& expr
136);
137
138
139/**
140 * @brief 检查函数 f(z) 在变量 z 上是否解析(满足 Cauchy-Riemann 方程).
141 *
142 * 设 f = u(x,y) + i*v(x,y),检查 partialu/partialx = partialv/partialy 且 partialu/partialy = -partialv/partialx.
143 *
144 * @param f 复变函数表达式
145 * @param z 复变量名(实部记为 z_re,虚部记为 z_im 进行分解)
146 * @return 解析返回 true
147 */
149 const std::shared_ptr<SymbolicExpr>& f,
150 const std::string& z,
152);
153
154/**
155 * @brief 使用默认计算上下文检查解析性,并显式报告无效输入.
156 */
158 const std::shared_ptr<SymbolicExpr>& f,
159 const std::string& z
160);
161
162
163/**
164 * @brief calculate_residue 的别名,匹配规范命名 residue.
165 */
167 const std::shared_ptr<SymbolicExpr>& f,
168 const std::string& z,
169 const std::shared_ptr<SymbolicExpr>& z0,
170 int order,
172);
173
175 const std::shared_ptr<SymbolicExpr>& f,
176 const std::string& z,
177 const std::shared_ptr<SymbolicExpr>& z0,
178 int order = 1
179);
180
181
182} // namespace LMCAS
#define LMCAS_API
Result< bool > ComplexBoolResult
const std::vector< Polynomial< BigInt > > const BigInt ComputationContext & context
const std::vector< FGLMPoly > const MonomialOrder & order
ExpressionResult real_part_checked(const std::shared_ptr< SymbolicExpr > &expr, ComputationContext &context)
Result< std::shared_ptr< SymbolicExpr > > ExpressionResult
Result of an operation that produces a symbolic expression.
std::shared_ptr< SymbolicExpr > analytic_continuation(const std::shared_ptr< SymbolicExpr > &f, const std::string &)
ExpressionResult calculate_residue_checked(const std::shared_ptr< SymbolicExpr > &f, const std::string &z, const std::shared_ptr< SymbolicExpr > &z0, int order, ComputationContext &context)
ExpressionResult conjugate_checked(const std::shared_ptr< SymbolicExpr > &expr, ComputationContext &context)
ExpressionResult imag_part_checked(const std::shared_ptr< SymbolicExpr > &expr, ComputationContext &context)
ExpressionResult residue_checked(const std::shared_ptr< SymbolicExpr > &f, const std::string &z, const std::shared_ptr< SymbolicExpr > &z0, int order, ComputationContext &context)
ExpressionResult cauchy_integral_checked(const std::shared_ptr< SymbolicExpr > &f, const std::string &z, const std::shared_ptr< SymbolicExpr > &z0, int n, ComputationContext &context)
ComplexBoolResult is_analytic_checked(const std::shared_ptr< SymbolicExpr > &f, const std::string &z, ComputationContext &context)
符号表达式主类 SymbolicExpr 及其工厂方法,运算接口.