PyPyNum 1.12.0__tar.gz → 1.12.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pypynum-1.12.0 → pypynum-1.12.1}/PKG-INFO +25 -143
- {pypynum-1.12.0 → pypynum-1.12.1}/PyPyNum.egg-info/PKG-INFO +25 -143
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/Matrix.py +2 -4
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/README.md +24 -142
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/__init__.py +1 -1
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/multiprec.py +108 -22
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/zh_cn.py +20 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/setup.py +1 -1
- {pypynum-1.12.0 → pypynum-1.12.1}/PyPyNum.egg-info/SOURCES.txt +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/PyPyNum.egg-info/dependency_links.txt +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/PyPyNum.egg-info/top_level.txt +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/Array.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/FourierT.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/Geometry.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/Graph.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/Group.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/Logic.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/NeuralN.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/PyPyNum.png +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/Quaternion.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/Symbolics.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/Tensor.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/Tree.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/Vector.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/chars.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/cipher.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/confs.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/constants.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/dists.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/equations.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/errors.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/file.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/image.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/maths.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/numbers.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/plotting.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/polynomial.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/pprinters.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/random.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/regression.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/sequence.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/stattest.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/test.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/this.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/tools.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/types.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/ufuncs.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/pypynum/utils.py +0 -0
- {pypynum-1.12.0 → pypynum-1.12.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyPyNum
|
|
3
|
-
Version: 1.12.
|
|
3
|
+
Version: 1.12.1
|
|
4
4
|
Summary: PyPyNum is a Python library for math & science computations, covering algebra, calculus, stats, with data structures like matrices, vectors, tensors. It offers numerical tools, programs, and supports computational ops, functions, processing, simulation, & visualization in data science & ML, crucial for research, engineering, & data processing.
|
|
5
5
|
Home-page: https://github.com/PythonSJL/PyPyNum
|
|
6
6
|
Author: Shen Jiayi
|
|
@@ -234,7 +234,7 @@ processing.</font><font color = red>[Python>=3.4]</font>
|
|
|
234
234
|
[](https://pepy.tech/project/pypynum)
|
|
235
235
|
[](https://pepy.tech/project/pypynum)
|
|
236
236
|
|
|
237
|
-
## Version -> 1.12.
|
|
237
|
+
## Version -> 1.12.1 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
|
|
238
238
|
|
|
239
239
|

|
|
240
240
|
|
|
@@ -338,151 +338,22 @@ Python interpreter and run it!
|
|
|
338
338
|
```
|
|
339
339
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
340
340
|
|
|
341
|
-
|
|
342
|
-
其中包括一些用中文名称封装的函数,
|
|
343
|
-
并将继续补充未封装的函数。
|
|
341
|
+
修复了矩阵的默认输出格式
|
|
344
342
|
|
|
345
|
-
|
|
346
|
-
which includes some functions encapsulated with Chinese names,
|
|
347
|
-
and will continue to supplement unencapsulated functions.
|
|
348
|
-
|
|
349
|
-
以下是当前已经过中文名称封装的函数:
|
|
350
|
-
|
|
351
|
-
The following are the functions that have already been encapsulated with Chinese names:
|
|
352
|
-
|
|
353
|
-
["Fraction转为Decimal", "RC4伪随机生成算法", "RC4初始化密钥调度算法", "RC4密码", "ROT13密码", "S型函数", "base64密码",
|
|
354
|
-
"x对数y乘积", "y次方根", "一维傅里叶变换", "上伽玛", "上标转整数", "下伽玛", "下标转整数", "中位数", "中国剩余定理",
|
|
355
|
-
"中心矩", "乘积和", "代替密码", "众数", "伽玛函数", "余切", "余割", "余弦", "偏度", "全一", "全部填充", "全零", "写入",
|
|
356
|
-
"几何平均数", "凯撒密码", "判定系数", "判断平方数", "加权平均", "协方差", "原根", "原点矩", "双曲余切", "双曲余割",
|
|
357
|
-
"双曲余弦", "双曲正切", "双曲正割", "双曲正弦", "反余切", "反余割", "反余弦", "反双曲余切", "反双曲余割", "反双曲余弦",
|
|
358
|
-
"反双曲正切", "反双曲正割", "反双曲正弦", "反正切", "反正割", "反正弦", "可能是平方数", "填充序列", "多次方根取整",
|
|
359
|
-
"多精度余弦", "多精度圆周率", "多精度对数", "多精度欧拉数", "多精度正弦", "多精度自然对数", "多精度黄金分割率",
|
|
360
|
-
"多项式方程", "导数", "峰度", "希尔256密码", "平均数", "平方平均数", "平方根取整", "序列滚动", "归一化",
|
|
361
|
-
"扩展欧几里得算法", "排列数", "数组", "整数转上标", "整数转下标", "方差", "普莱费尔密码", "最大公约数", "最小公倍数",
|
|
362
|
-
"极差", "标准差", "模运算阶", "欧拉函数", "正切", "正割", "正弦", "相关系数", "积分", "积累乘积", "符号函数",
|
|
363
|
-
"类似形状全一", "类似形状全零", "类似形状填充", "累乘积", "累加和", "线性方程组", "组合数", "维吉尼亚密码", "自然对数",
|
|
364
|
-
"自然指数", "莫尔斯密码", "误差函数", "读取", "调和平均数", "贝塔函数", "贝塞尔I0", "贝塞尔Iv", "负一整数次幂",
|
|
365
|
-
"转换为列表", "转换为数组", "连续乘积", "连续加和", "阶乘函数", "阿特巴什密码", "频率统计", "黎曼函数"]
|
|
366
|
-
|
|
367
|
-
(120 functions)
|
|
368
|
-
|
|
369
|
-
下面是一个使用示例
|
|
370
|
-
|
|
371
|
-
Here is an example of usage
|
|
372
|
-
|
|
373
|
-
>>> from pypynum import zh_cn
|
|
374
|
-
>>> print(zh_cn.多精度正弦(1, 100))
|
|
375
|
-
0.8414709848078965066525023216302989996225630607983710656727517099919104043912396689486397435430526959
|
|
376
|
-
|
|
377
|
-
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
378
|
-
|
|
379
|
-
Group类修复了原有方法的问题并且新增了
|
|
380
|
-
一些方法。
|
|
381
|
-
|
|
382
|
-
The Group class has fixed the
|
|
383
|
-
issues with the original methods
|
|
384
|
-
and added some new methods.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
下面是新增的方法(Monoid是幺半群):
|
|
388
|
-
|
|
389
|
-
Here are the newly added methods:
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
elements(self)
|
|
393
|
-
getop(self)
|
|
394
|
-
identity(self)
|
|
395
|
-
is_monoid(self, modulus=None)
|
|
396
|
-
is_subgroup(self, other, modulus=None)
|
|
397
|
-
is_supergroup(self, other, modulus=None)
|
|
398
|
-
setop(self, operation)
|
|
399
|
-
|
|
400
|
-
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
401
|
-
|
|
402
|
-
"Polynomial"类增加了五个寻找特殊点的方法,下面是这五个方法。
|
|
403
|
-
|
|
404
|
-
The "Polynomial" class has added five methods for finding special points.
|
|
405
|
-
Here are these five methods.
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
1. `stationaries(self, tolerance=1e-15)`:
|
|
409
|
-
|
|
410
|
-
计算多项式的**驻点**,即一阶导数等于零的点。
|
|
411
|
-
驻点可能是局部极大值、局部极小值或鞍点。
|
|
412
|
-
|
|
413
|
-
Calculate the stationary point of a polynomial,
|
|
414
|
-
which is the point where the first derivative equals zero.
|
|
415
|
-
The stationary point may be a local maximum,
|
|
416
|
-
local minimum,
|
|
417
|
-
or saddle point.
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
2. `saddles(self, tolerance=1e-15)`:
|
|
421
|
-
|
|
422
|
-
计算多项式的**鞍点**。
|
|
423
|
-
鞍点是驻点,其一阶导数在该点为零,而二阶导数在该点不为零且一阶导数与二阶导数的符号相反。
|
|
424
|
-
|
|
425
|
-
Calculate the saddle point of a polynomial.
|
|
426
|
-
The saddle point is a stationary point,
|
|
427
|
-
where its first derivative is zero and its second derivative is non-zero,
|
|
428
|
-
and the signs of the first and second derivatives are opposite.
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
3. `minima(self, tolerance=1e-15)`:
|
|
432
|
-
|
|
433
|
-
计算多项式的**局部极小值点**。
|
|
434
|
-
局部极小值点是驻点,其二阶导数在该点大于零。
|
|
435
|
-
|
|
436
|
-
Calculate the local minimum points of a polynomial.
|
|
437
|
-
The local minimum point is a stationary point,
|
|
438
|
-
and its second derivative is greater than zero at that point.
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
4. `maxima(self, tolerance=1e-15)`:
|
|
442
|
-
|
|
443
|
-
计算多项式的**局部极大值点**。
|
|
444
|
-
局部极大值点是驻点,其二阶导数在该点小于零。
|
|
445
|
-
|
|
446
|
-
Calculate the local maximum points of a polynomial.
|
|
447
|
-
The local maximum point is a stationary point,
|
|
448
|
-
and its second derivative is less than zero at that point.
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
5. `inflections(self, tolerance=1e-15)`:
|
|
452
|
-
|
|
453
|
-
计算多项式的**拐点**。
|
|
454
|
-
拐点是二阶导数等于零的点,并且三阶导数在该点不为零,表示函数在该点改变其凹凸性。
|
|
455
|
-
|
|
456
|
-
Calculate the inflection point of a polynomial.
|
|
457
|
-
The inflection point is the point where the second derivative equals zero,
|
|
458
|
-
and the third derivative is not zero at that point,
|
|
459
|
-
indicating that the function changes its concavity and convexity at that point.
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
每个方法都使用了`tolerance`参数来确定计算过程中可接受的误差范围。
|
|
463
|
-
例如,在判断导数是否为零或者是否大于/小于零时,都会考虑到这个容差值。
|
|
464
|
-
|
|
465
|
-
Each method uses the 'tolerance' parameter to determine the acceptable range of error during the calculation process.
|
|
466
|
-
For example,
|
|
467
|
-
when determining whether the derivative is zero or greater/less than zero,
|
|
468
|
-
this tolerance value will be taken into account.
|
|
343
|
+
Fixed the default output format of the matrix
|
|
469
344
|
|
|
470
345
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
471
346
|
|
|
472
|
-
|
|
473
|
-
然后重命名和新增了几个函数。
|
|
347
|
+
multiprec模块新增了一些函数
|
|
474
348
|
|
|
475
|
-
The
|
|
476
|
-
and several functions were renamed and added.
|
|
349
|
+
The multiprec module has added some new functions
|
|
477
350
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
mp_pi(sigfigs: int, method: str = 'chudnovsky') -> decimal.Decimal
|
|
485
|
-
mp_sin(x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
351
|
+
mp_atan(x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
352
|
+
mp_atan2(y: Union[int, str, decimal.Decimal], x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
353
|
+
mp_cosh(x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
354
|
+
mp_exp(x: Union[int, str, decimal.Decimal], sigfigs: int, builtin: bool = True) -> decimal.Decimal
|
|
355
|
+
mp_sinh(x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
356
|
+
setprec(sigfigs: int)
|
|
486
357
|
|
|
487
358
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
488
359
|
```
|
|
@@ -558,7 +429,7 @@ PyPyNum
|
|
|
558
429
|
│ └── FUNCTION
|
|
559
430
|
├── Group
|
|
560
431
|
│ ├── CLASS
|
|
561
|
-
│ │ └── Group(object)/__init__(self: Any, data: Any) -> Any
|
|
432
|
+
│ │ └── Group(object)/__init__(self: Any, data: Any, operation: Any) -> Any
|
|
562
433
|
│ └── FUNCTION
|
|
563
434
|
│ └── group(data: Any) -> Any
|
|
564
435
|
├── Logic
|
|
@@ -813,13 +684,19 @@ PyPyNum
|
|
|
813
684
|
│ ├── CLASS
|
|
814
685
|
│ └── FUNCTION
|
|
815
686
|
│ ├── frac2dec(frac: fractions.Fraction, sigfigs: int) -> decimal.Decimal
|
|
687
|
+
│ ├── mp_atan(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
688
|
+
│ ├── mp_atan2(y: typing.Union[int, str, decimal.Decimal], x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
816
689
|
│ ├── mp_cos(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
690
|
+
│ ├── mp_cosh(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
817
691
|
│ ├── mp_e(sigfigs: int, method: str) -> decimal.Decimal
|
|
692
|
+
│ ├── mp_exp(x: typing.Union[int, str, decimal.Decimal], sigfigs: int, builtin: bool) -> decimal.Decimal
|
|
818
693
|
│ ├── mp_ln(x: typing.Union[int, str, decimal.Decimal], sigfigs: int, builtin: bool) -> decimal.Decimal
|
|
819
694
|
│ ├── mp_log(x: typing.Union[int, str, decimal.Decimal], base: typing.Union[int, str, decimal.Decimal], sigfigs: int, builtin: bool) -> decimal.Decimal
|
|
820
695
|
│ ├── mp_phi(sigfigs: int, method: str) -> decimal.Decimal
|
|
821
696
|
│ ├── mp_pi(sigfigs: int, method: str) -> decimal.Decimal
|
|
822
|
-
│
|
|
697
|
+
│ ├── mp_sin(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
698
|
+
│ ├── mp_sinh(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
699
|
+
│ └── setprec(sigfigs: int) -> Any
|
|
823
700
|
├── numbers
|
|
824
701
|
│ ├── CLASS
|
|
825
702
|
│ └── FUNCTION
|
|
@@ -991,11 +868,16 @@ PyPyNum
|
|
|
991
868
|
├── 填充序列(形状: Any, 序列: Any, 重复: Any, 填充: Any, 返回类型: Any) -> Any
|
|
992
869
|
├── 多次方根取整(被开方数: int, 开方数: int) -> int
|
|
993
870
|
├── 多精度余弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
871
|
+
├── 多精度双曲余弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
872
|
+
├── 多精度双曲正弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
873
|
+
├── 多精度反正切(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
994
874
|
├── 多精度圆周率(有效位数: int, 方法: str) -> decimal.Decimal
|
|
995
875
|
├── 多精度对数(真数: typing.Union[int, float], 底数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
|
|
876
|
+
├── 多精度方位角(y: typing.Union[int, float], x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
996
877
|
├── 多精度欧拉数(有效位数: int, 方法: str) -> decimal.Decimal
|
|
997
878
|
├── 多精度正弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
998
879
|
├── 多精度自然对数(真数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
|
|
880
|
+
├── 多精度自然指数(指数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
|
|
999
881
|
├── 多精度黄金分割率(有效位数: int, 方法: str) -> decimal.Decimal
|
|
1000
882
|
├── 多项式方程(系数: list) -> list
|
|
1001
883
|
├── 导数(函数: Any, 参数: float, 步长: float, 额外参数: Any, 额外关键字参数: Any) -> float
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyPyNum
|
|
3
|
-
Version: 1.12.
|
|
3
|
+
Version: 1.12.1
|
|
4
4
|
Summary: PyPyNum is a Python library for math & science computations, covering algebra, calculus, stats, with data structures like matrices, vectors, tensors. It offers numerical tools, programs, and supports computational ops, functions, processing, simulation, & visualization in data science & ML, crucial for research, engineering, & data processing.
|
|
5
5
|
Home-page: https://github.com/PythonSJL/PyPyNum
|
|
6
6
|
Author: Shen Jiayi
|
|
@@ -234,7 +234,7 @@ processing.</font><font color = red>[Python>=3.4]</font>
|
|
|
234
234
|
[](https://pepy.tech/project/pypynum)
|
|
235
235
|
[](https://pepy.tech/project/pypynum)
|
|
236
236
|
|
|
237
|
-
## Version -> 1.12.
|
|
237
|
+
## Version -> 1.12.1 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
|
|
238
238
|
|
|
239
239
|

|
|
240
240
|
|
|
@@ -338,151 +338,22 @@ Python interpreter and run it!
|
|
|
338
338
|
```
|
|
339
339
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
340
340
|
|
|
341
|
-
|
|
342
|
-
其中包括一些用中文名称封装的函数,
|
|
343
|
-
并将继续补充未封装的函数。
|
|
341
|
+
修复了矩阵的默认输出格式
|
|
344
342
|
|
|
345
|
-
|
|
346
|
-
which includes some functions encapsulated with Chinese names,
|
|
347
|
-
and will continue to supplement unencapsulated functions.
|
|
348
|
-
|
|
349
|
-
以下是当前已经过中文名称封装的函数:
|
|
350
|
-
|
|
351
|
-
The following are the functions that have already been encapsulated with Chinese names:
|
|
352
|
-
|
|
353
|
-
["Fraction转为Decimal", "RC4伪随机生成算法", "RC4初始化密钥调度算法", "RC4密码", "ROT13密码", "S型函数", "base64密码",
|
|
354
|
-
"x对数y乘积", "y次方根", "一维傅里叶变换", "上伽玛", "上标转整数", "下伽玛", "下标转整数", "中位数", "中国剩余定理",
|
|
355
|
-
"中心矩", "乘积和", "代替密码", "众数", "伽玛函数", "余切", "余割", "余弦", "偏度", "全一", "全部填充", "全零", "写入",
|
|
356
|
-
"几何平均数", "凯撒密码", "判定系数", "判断平方数", "加权平均", "协方差", "原根", "原点矩", "双曲余切", "双曲余割",
|
|
357
|
-
"双曲余弦", "双曲正切", "双曲正割", "双曲正弦", "反余切", "反余割", "反余弦", "反双曲余切", "反双曲余割", "反双曲余弦",
|
|
358
|
-
"反双曲正切", "反双曲正割", "反双曲正弦", "反正切", "反正割", "反正弦", "可能是平方数", "填充序列", "多次方根取整",
|
|
359
|
-
"多精度余弦", "多精度圆周率", "多精度对数", "多精度欧拉数", "多精度正弦", "多精度自然对数", "多精度黄金分割率",
|
|
360
|
-
"多项式方程", "导数", "峰度", "希尔256密码", "平均数", "平方平均数", "平方根取整", "序列滚动", "归一化",
|
|
361
|
-
"扩展欧几里得算法", "排列数", "数组", "整数转上标", "整数转下标", "方差", "普莱费尔密码", "最大公约数", "最小公倍数",
|
|
362
|
-
"极差", "标准差", "模运算阶", "欧拉函数", "正切", "正割", "正弦", "相关系数", "积分", "积累乘积", "符号函数",
|
|
363
|
-
"类似形状全一", "类似形状全零", "类似形状填充", "累乘积", "累加和", "线性方程组", "组合数", "维吉尼亚密码", "自然对数",
|
|
364
|
-
"自然指数", "莫尔斯密码", "误差函数", "读取", "调和平均数", "贝塔函数", "贝塞尔I0", "贝塞尔Iv", "负一整数次幂",
|
|
365
|
-
"转换为列表", "转换为数组", "连续乘积", "连续加和", "阶乘函数", "阿特巴什密码", "频率统计", "黎曼函数"]
|
|
366
|
-
|
|
367
|
-
(120 functions)
|
|
368
|
-
|
|
369
|
-
下面是一个使用示例
|
|
370
|
-
|
|
371
|
-
Here is an example of usage
|
|
372
|
-
|
|
373
|
-
>>> from pypynum import zh_cn
|
|
374
|
-
>>> print(zh_cn.多精度正弦(1, 100))
|
|
375
|
-
0.8414709848078965066525023216302989996225630607983710656727517099919104043912396689486397435430526959
|
|
376
|
-
|
|
377
|
-
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
378
|
-
|
|
379
|
-
Group类修复了原有方法的问题并且新增了
|
|
380
|
-
一些方法。
|
|
381
|
-
|
|
382
|
-
The Group class has fixed the
|
|
383
|
-
issues with the original methods
|
|
384
|
-
and added some new methods.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
下面是新增的方法(Monoid是幺半群):
|
|
388
|
-
|
|
389
|
-
Here are the newly added methods:
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
elements(self)
|
|
393
|
-
getop(self)
|
|
394
|
-
identity(self)
|
|
395
|
-
is_monoid(self, modulus=None)
|
|
396
|
-
is_subgroup(self, other, modulus=None)
|
|
397
|
-
is_supergroup(self, other, modulus=None)
|
|
398
|
-
setop(self, operation)
|
|
399
|
-
|
|
400
|
-
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
401
|
-
|
|
402
|
-
"Polynomial"类增加了五个寻找特殊点的方法,下面是这五个方法。
|
|
403
|
-
|
|
404
|
-
The "Polynomial" class has added five methods for finding special points.
|
|
405
|
-
Here are these five methods.
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
1. `stationaries(self, tolerance=1e-15)`:
|
|
409
|
-
|
|
410
|
-
计算多项式的**驻点**,即一阶导数等于零的点。
|
|
411
|
-
驻点可能是局部极大值、局部极小值或鞍点。
|
|
412
|
-
|
|
413
|
-
Calculate the stationary point of a polynomial,
|
|
414
|
-
which is the point where the first derivative equals zero.
|
|
415
|
-
The stationary point may be a local maximum,
|
|
416
|
-
local minimum,
|
|
417
|
-
or saddle point.
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
2. `saddles(self, tolerance=1e-15)`:
|
|
421
|
-
|
|
422
|
-
计算多项式的**鞍点**。
|
|
423
|
-
鞍点是驻点,其一阶导数在该点为零,而二阶导数在该点不为零且一阶导数与二阶导数的符号相反。
|
|
424
|
-
|
|
425
|
-
Calculate the saddle point of a polynomial.
|
|
426
|
-
The saddle point is a stationary point,
|
|
427
|
-
where its first derivative is zero and its second derivative is non-zero,
|
|
428
|
-
and the signs of the first and second derivatives are opposite.
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
3. `minima(self, tolerance=1e-15)`:
|
|
432
|
-
|
|
433
|
-
计算多项式的**局部极小值点**。
|
|
434
|
-
局部极小值点是驻点,其二阶导数在该点大于零。
|
|
435
|
-
|
|
436
|
-
Calculate the local minimum points of a polynomial.
|
|
437
|
-
The local minimum point is a stationary point,
|
|
438
|
-
and its second derivative is greater than zero at that point.
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
4. `maxima(self, tolerance=1e-15)`:
|
|
442
|
-
|
|
443
|
-
计算多项式的**局部极大值点**。
|
|
444
|
-
局部极大值点是驻点,其二阶导数在该点小于零。
|
|
445
|
-
|
|
446
|
-
Calculate the local maximum points of a polynomial.
|
|
447
|
-
The local maximum point is a stationary point,
|
|
448
|
-
and its second derivative is less than zero at that point.
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
5. `inflections(self, tolerance=1e-15)`:
|
|
452
|
-
|
|
453
|
-
计算多项式的**拐点**。
|
|
454
|
-
拐点是二阶导数等于零的点,并且三阶导数在该点不为零,表示函数在该点改变其凹凸性。
|
|
455
|
-
|
|
456
|
-
Calculate the inflection point of a polynomial.
|
|
457
|
-
The inflection point is the point where the second derivative equals zero,
|
|
458
|
-
and the third derivative is not zero at that point,
|
|
459
|
-
indicating that the function changes its concavity and convexity at that point.
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
每个方法都使用了`tolerance`参数来确定计算过程中可接受的误差范围。
|
|
463
|
-
例如,在判断导数是否为零或者是否大于/小于零时,都会考虑到这个容差值。
|
|
464
|
-
|
|
465
|
-
Each method uses the 'tolerance' parameter to determine the acceptable range of error during the calculation process.
|
|
466
|
-
For example,
|
|
467
|
-
when determining whether the derivative is zero or greater/less than zero,
|
|
468
|
-
this tolerance value will be taken into account.
|
|
343
|
+
Fixed the default output format of the matrix
|
|
469
344
|
|
|
470
345
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
471
346
|
|
|
472
|
-
|
|
473
|
-
然后重命名和新增了几个函数。
|
|
347
|
+
multiprec模块新增了一些函数
|
|
474
348
|
|
|
475
|
-
The
|
|
476
|
-
and several functions were renamed and added.
|
|
349
|
+
The multiprec module has added some new functions
|
|
477
350
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
mp_pi(sigfigs: int, method: str = 'chudnovsky') -> decimal.Decimal
|
|
485
|
-
mp_sin(x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
351
|
+
mp_atan(x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
352
|
+
mp_atan2(y: Union[int, str, decimal.Decimal], x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
353
|
+
mp_cosh(x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
354
|
+
mp_exp(x: Union[int, str, decimal.Decimal], sigfigs: int, builtin: bool = True) -> decimal.Decimal
|
|
355
|
+
mp_sinh(x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
356
|
+
setprec(sigfigs: int)
|
|
486
357
|
|
|
487
358
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
488
359
|
```
|
|
@@ -558,7 +429,7 @@ PyPyNum
|
|
|
558
429
|
│ └── FUNCTION
|
|
559
430
|
├── Group
|
|
560
431
|
│ ├── CLASS
|
|
561
|
-
│ │ └── Group(object)/__init__(self: Any, data: Any) -> Any
|
|
432
|
+
│ │ └── Group(object)/__init__(self: Any, data: Any, operation: Any) -> Any
|
|
562
433
|
│ └── FUNCTION
|
|
563
434
|
│ └── group(data: Any) -> Any
|
|
564
435
|
├── Logic
|
|
@@ -813,13 +684,19 @@ PyPyNum
|
|
|
813
684
|
│ ├── CLASS
|
|
814
685
|
│ └── FUNCTION
|
|
815
686
|
│ ├── frac2dec(frac: fractions.Fraction, sigfigs: int) -> decimal.Decimal
|
|
687
|
+
│ ├── mp_atan(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
688
|
+
│ ├── mp_atan2(y: typing.Union[int, str, decimal.Decimal], x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
816
689
|
│ ├── mp_cos(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
690
|
+
│ ├── mp_cosh(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
817
691
|
│ ├── mp_e(sigfigs: int, method: str) -> decimal.Decimal
|
|
692
|
+
│ ├── mp_exp(x: typing.Union[int, str, decimal.Decimal], sigfigs: int, builtin: bool) -> decimal.Decimal
|
|
818
693
|
│ ├── mp_ln(x: typing.Union[int, str, decimal.Decimal], sigfigs: int, builtin: bool) -> decimal.Decimal
|
|
819
694
|
│ ├── mp_log(x: typing.Union[int, str, decimal.Decimal], base: typing.Union[int, str, decimal.Decimal], sigfigs: int, builtin: bool) -> decimal.Decimal
|
|
820
695
|
│ ├── mp_phi(sigfigs: int, method: str) -> decimal.Decimal
|
|
821
696
|
│ ├── mp_pi(sigfigs: int, method: str) -> decimal.Decimal
|
|
822
|
-
│
|
|
697
|
+
│ ├── mp_sin(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
698
|
+
│ ├── mp_sinh(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
699
|
+
│ └── setprec(sigfigs: int) -> Any
|
|
823
700
|
├── numbers
|
|
824
701
|
│ ├── CLASS
|
|
825
702
|
│ └── FUNCTION
|
|
@@ -991,11 +868,16 @@ PyPyNum
|
|
|
991
868
|
├── 填充序列(形状: Any, 序列: Any, 重复: Any, 填充: Any, 返回类型: Any) -> Any
|
|
992
869
|
├── 多次方根取整(被开方数: int, 开方数: int) -> int
|
|
993
870
|
├── 多精度余弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
871
|
+
├── 多精度双曲余弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
872
|
+
├── 多精度双曲正弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
873
|
+
├── 多精度反正切(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
994
874
|
├── 多精度圆周率(有效位数: int, 方法: str) -> decimal.Decimal
|
|
995
875
|
├── 多精度对数(真数: typing.Union[int, float], 底数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
|
|
876
|
+
├── 多精度方位角(y: typing.Union[int, float], x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
996
877
|
├── 多精度欧拉数(有效位数: int, 方法: str) -> decimal.Decimal
|
|
997
878
|
├── 多精度正弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
998
879
|
├── 多精度自然对数(真数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
|
|
880
|
+
├── 多精度自然指数(指数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
|
|
999
881
|
├── 多精度黄金分割率(有效位数: int, 方法: str) -> decimal.Decimal
|
|
1000
882
|
├── 多项式方程(系数: list) -> list
|
|
1001
883
|
├── 导数(函数: Any, 参数: float, 步长: float, 额外参数: Any, 额外关键字参数: Any) -> float
|
|
@@ -211,11 +211,9 @@ class Matrix(Array):
|
|
|
211
211
|
"\\end{{{}}}".format(matrix_type)]
|
|
212
212
|
return "".join(latex_str)
|
|
213
213
|
|
|
214
|
-
def
|
|
214
|
+
def __str__(self, use_latex=False):
|
|
215
215
|
use_latex = config.use_latex or use_latex
|
|
216
|
-
return self.latex() if use_latex else super().
|
|
217
|
-
|
|
218
|
-
__str__ = __repr__
|
|
216
|
+
return self.latex() if use_latex else super().__str__()
|
|
219
217
|
|
|
220
218
|
def __setitem__(self, key, value):
|
|
221
219
|
if isinstance(key, (int, slice)):
|
|
@@ -20,7 +20,7 @@ processing.</font><font color = red>[Python>=3.4]</font>
|
|
|
20
20
|
[](https://pepy.tech/project/pypynum)
|
|
21
21
|
[](https://pepy.tech/project/pypynum)
|
|
22
22
|
|
|
23
|
-
## Version -> 1.12.
|
|
23
|
+
## Version -> 1.12.1 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
|
|
24
24
|
|
|
25
25
|

|
|
26
26
|
|
|
@@ -124,151 +124,22 @@ Python interpreter and run it!
|
|
|
124
124
|
```
|
|
125
125
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
其中包括一些用中文名称封装的函数,
|
|
129
|
-
并将继续补充未封装的函数。
|
|
127
|
+
修复了矩阵的默认输出格式
|
|
130
128
|
|
|
131
|
-
|
|
132
|
-
which includes some functions encapsulated with Chinese names,
|
|
133
|
-
and will continue to supplement unencapsulated functions.
|
|
134
|
-
|
|
135
|
-
以下是当前已经过中文名称封装的函数:
|
|
136
|
-
|
|
137
|
-
The following are the functions that have already been encapsulated with Chinese names:
|
|
138
|
-
|
|
139
|
-
["Fraction转为Decimal", "RC4伪随机生成算法", "RC4初始化密钥调度算法", "RC4密码", "ROT13密码", "S型函数", "base64密码",
|
|
140
|
-
"x对数y乘积", "y次方根", "一维傅里叶变换", "上伽玛", "上标转整数", "下伽玛", "下标转整数", "中位数", "中国剩余定理",
|
|
141
|
-
"中心矩", "乘积和", "代替密码", "众数", "伽玛函数", "余切", "余割", "余弦", "偏度", "全一", "全部填充", "全零", "写入",
|
|
142
|
-
"几何平均数", "凯撒密码", "判定系数", "判断平方数", "加权平均", "协方差", "原根", "原点矩", "双曲余切", "双曲余割",
|
|
143
|
-
"双曲余弦", "双曲正切", "双曲正割", "双曲正弦", "反余切", "反余割", "反余弦", "反双曲余切", "反双曲余割", "反双曲余弦",
|
|
144
|
-
"反双曲正切", "反双曲正割", "反双曲正弦", "反正切", "反正割", "反正弦", "可能是平方数", "填充序列", "多次方根取整",
|
|
145
|
-
"多精度余弦", "多精度圆周率", "多精度对数", "多精度欧拉数", "多精度正弦", "多精度自然对数", "多精度黄金分割率",
|
|
146
|
-
"多项式方程", "导数", "峰度", "希尔256密码", "平均数", "平方平均数", "平方根取整", "序列滚动", "归一化",
|
|
147
|
-
"扩展欧几里得算法", "排列数", "数组", "整数转上标", "整数转下标", "方差", "普莱费尔密码", "最大公约数", "最小公倍数",
|
|
148
|
-
"极差", "标准差", "模运算阶", "欧拉函数", "正切", "正割", "正弦", "相关系数", "积分", "积累乘积", "符号函数",
|
|
149
|
-
"类似形状全一", "类似形状全零", "类似形状填充", "累乘积", "累加和", "线性方程组", "组合数", "维吉尼亚密码", "自然对数",
|
|
150
|
-
"自然指数", "莫尔斯密码", "误差函数", "读取", "调和平均数", "贝塔函数", "贝塞尔I0", "贝塞尔Iv", "负一整数次幂",
|
|
151
|
-
"转换为列表", "转换为数组", "连续乘积", "连续加和", "阶乘函数", "阿特巴什密码", "频率统计", "黎曼函数"]
|
|
152
|
-
|
|
153
|
-
(120 functions)
|
|
154
|
-
|
|
155
|
-
下面是一个使用示例
|
|
156
|
-
|
|
157
|
-
Here is an example of usage
|
|
158
|
-
|
|
159
|
-
>>> from pypynum import zh_cn
|
|
160
|
-
>>> print(zh_cn.多精度正弦(1, 100))
|
|
161
|
-
0.8414709848078965066525023216302989996225630607983710656727517099919104043912396689486397435430526959
|
|
162
|
-
|
|
163
|
-
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
164
|
-
|
|
165
|
-
Group类修复了原有方法的问题并且新增了
|
|
166
|
-
一些方法。
|
|
167
|
-
|
|
168
|
-
The Group class has fixed the
|
|
169
|
-
issues with the original methods
|
|
170
|
-
and added some new methods.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
下面是新增的方法(Monoid是幺半群):
|
|
174
|
-
|
|
175
|
-
Here are the newly added methods:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
elements(self)
|
|
179
|
-
getop(self)
|
|
180
|
-
identity(self)
|
|
181
|
-
is_monoid(self, modulus=None)
|
|
182
|
-
is_subgroup(self, other, modulus=None)
|
|
183
|
-
is_supergroup(self, other, modulus=None)
|
|
184
|
-
setop(self, operation)
|
|
185
|
-
|
|
186
|
-
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
187
|
-
|
|
188
|
-
"Polynomial"类增加了五个寻找特殊点的方法,下面是这五个方法。
|
|
189
|
-
|
|
190
|
-
The "Polynomial" class has added five methods for finding special points.
|
|
191
|
-
Here are these five methods.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
1. `stationaries(self, tolerance=1e-15)`:
|
|
195
|
-
|
|
196
|
-
计算多项式的**驻点**,即一阶导数等于零的点。
|
|
197
|
-
驻点可能是局部极大值、局部极小值或鞍点。
|
|
198
|
-
|
|
199
|
-
Calculate the stationary point of a polynomial,
|
|
200
|
-
which is the point where the first derivative equals zero.
|
|
201
|
-
The stationary point may be a local maximum,
|
|
202
|
-
local minimum,
|
|
203
|
-
or saddle point.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
2. `saddles(self, tolerance=1e-15)`:
|
|
207
|
-
|
|
208
|
-
计算多项式的**鞍点**。
|
|
209
|
-
鞍点是驻点,其一阶导数在该点为零,而二阶导数在该点不为零且一阶导数与二阶导数的符号相反。
|
|
210
|
-
|
|
211
|
-
Calculate the saddle point of a polynomial.
|
|
212
|
-
The saddle point is a stationary point,
|
|
213
|
-
where its first derivative is zero and its second derivative is non-zero,
|
|
214
|
-
and the signs of the first and second derivatives are opposite.
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
3. `minima(self, tolerance=1e-15)`:
|
|
218
|
-
|
|
219
|
-
计算多项式的**局部极小值点**。
|
|
220
|
-
局部极小值点是驻点,其二阶导数在该点大于零。
|
|
221
|
-
|
|
222
|
-
Calculate the local minimum points of a polynomial.
|
|
223
|
-
The local minimum point is a stationary point,
|
|
224
|
-
and its second derivative is greater than zero at that point.
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
4. `maxima(self, tolerance=1e-15)`:
|
|
228
|
-
|
|
229
|
-
计算多项式的**局部极大值点**。
|
|
230
|
-
局部极大值点是驻点,其二阶导数在该点小于零。
|
|
231
|
-
|
|
232
|
-
Calculate the local maximum points of a polynomial.
|
|
233
|
-
The local maximum point is a stationary point,
|
|
234
|
-
and its second derivative is less than zero at that point.
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
5. `inflections(self, tolerance=1e-15)`:
|
|
238
|
-
|
|
239
|
-
计算多项式的**拐点**。
|
|
240
|
-
拐点是二阶导数等于零的点,并且三阶导数在该点不为零,表示函数在该点改变其凹凸性。
|
|
241
|
-
|
|
242
|
-
Calculate the inflection point of a polynomial.
|
|
243
|
-
The inflection point is the point where the second derivative equals zero,
|
|
244
|
-
and the third derivative is not zero at that point,
|
|
245
|
-
indicating that the function changes its concavity and convexity at that point.
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
每个方法都使用了`tolerance`参数来确定计算过程中可接受的误差范围。
|
|
249
|
-
例如,在判断导数是否为零或者是否大于/小于零时,都会考虑到这个容差值。
|
|
250
|
-
|
|
251
|
-
Each method uses the 'tolerance' parameter to determine the acceptable range of error during the calculation process.
|
|
252
|
-
For example,
|
|
253
|
-
when determining whether the derivative is zero or greater/less than zero,
|
|
254
|
-
this tolerance value will be taken into account.
|
|
129
|
+
Fixed the default output format of the matrix
|
|
255
130
|
|
|
256
131
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
257
132
|
|
|
258
|
-
|
|
259
|
-
然后重命名和新增了几个函数。
|
|
133
|
+
multiprec模块新增了一些函数
|
|
260
134
|
|
|
261
|
-
The
|
|
262
|
-
and several functions were renamed and added.
|
|
135
|
+
The multiprec module has added some new functions
|
|
263
136
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
mp_pi(sigfigs: int, method: str = 'chudnovsky') -> decimal.Decimal
|
|
271
|
-
mp_sin(x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
137
|
+
mp_atan(x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
138
|
+
mp_atan2(y: Union[int, str, decimal.Decimal], x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
139
|
+
mp_cosh(x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
140
|
+
mp_exp(x: Union[int, str, decimal.Decimal], sigfigs: int, builtin: bool = True) -> decimal.Decimal
|
|
141
|
+
mp_sinh(x: Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
142
|
+
setprec(sigfigs: int)
|
|
272
143
|
|
|
273
144
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
274
145
|
```
|
|
@@ -344,7 +215,7 @@ PyPyNum
|
|
|
344
215
|
│ └── FUNCTION
|
|
345
216
|
├── Group
|
|
346
217
|
│ ├── CLASS
|
|
347
|
-
│ │ └── Group(object)/__init__(self: Any, data: Any) -> Any
|
|
218
|
+
│ │ └── Group(object)/__init__(self: Any, data: Any, operation: Any) -> Any
|
|
348
219
|
│ └── FUNCTION
|
|
349
220
|
│ └── group(data: Any) -> Any
|
|
350
221
|
├── Logic
|
|
@@ -599,13 +470,19 @@ PyPyNum
|
|
|
599
470
|
│ ├── CLASS
|
|
600
471
|
│ └── FUNCTION
|
|
601
472
|
│ ├── frac2dec(frac: fractions.Fraction, sigfigs: int) -> decimal.Decimal
|
|
473
|
+
│ ├── mp_atan(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
474
|
+
│ ├── mp_atan2(y: typing.Union[int, str, decimal.Decimal], x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
602
475
|
│ ├── mp_cos(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
476
|
+
│ ├── mp_cosh(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
603
477
|
│ ├── mp_e(sigfigs: int, method: str) -> decimal.Decimal
|
|
478
|
+
│ ├── mp_exp(x: typing.Union[int, str, decimal.Decimal], sigfigs: int, builtin: bool) -> decimal.Decimal
|
|
604
479
|
│ ├── mp_ln(x: typing.Union[int, str, decimal.Decimal], sigfigs: int, builtin: bool) -> decimal.Decimal
|
|
605
480
|
│ ├── mp_log(x: typing.Union[int, str, decimal.Decimal], base: typing.Union[int, str, decimal.Decimal], sigfigs: int, builtin: bool) -> decimal.Decimal
|
|
606
481
|
│ ├── mp_phi(sigfigs: int, method: str) -> decimal.Decimal
|
|
607
482
|
│ ├── mp_pi(sigfigs: int, method: str) -> decimal.Decimal
|
|
608
|
-
│
|
|
483
|
+
│ ├── mp_sin(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
484
|
+
│ ├── mp_sinh(x: typing.Union[int, str, decimal.Decimal], sigfigs: int) -> decimal.Decimal
|
|
485
|
+
│ └── setprec(sigfigs: int) -> Any
|
|
609
486
|
├── numbers
|
|
610
487
|
│ ├── CLASS
|
|
611
488
|
│ └── FUNCTION
|
|
@@ -777,11 +654,16 @@ PyPyNum
|
|
|
777
654
|
├── 填充序列(形状: Any, 序列: Any, 重复: Any, 填充: Any, 返回类型: Any) -> Any
|
|
778
655
|
├── 多次方根取整(被开方数: int, 开方数: int) -> int
|
|
779
656
|
├── 多精度余弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
657
|
+
├── 多精度双曲余弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
658
|
+
├── 多精度双曲正弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
659
|
+
├── 多精度反正切(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
780
660
|
├── 多精度圆周率(有效位数: int, 方法: str) -> decimal.Decimal
|
|
781
661
|
├── 多精度对数(真数: typing.Union[int, float], 底数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
|
|
662
|
+
├── 多精度方位角(y: typing.Union[int, float], x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
782
663
|
├── 多精度欧拉数(有效位数: int, 方法: str) -> decimal.Decimal
|
|
783
664
|
├── 多精度正弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
|
|
784
665
|
├── 多精度自然对数(真数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
|
|
666
|
+
├── 多精度自然指数(指数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
|
|
785
667
|
├── 多精度黄金分割率(有效位数: int, 方法: str) -> decimal.Decimal
|
|
786
668
|
├── 多项式方程(系数: list) -> list
|
|
787
669
|
├── 导数(函数: Any, 参数: float, 步长: float, 额外参数: Any, 额外关键字参数: Any) -> float
|
|
@@ -65,7 +65,7 @@ from .utils import OrderedSet, InfIterator, LinkedList, IntervalSet
|
|
|
65
65
|
from .Vector import vec
|
|
66
66
|
from . import zh_cn
|
|
67
67
|
|
|
68
|
-
__version__ = "1.12.
|
|
68
|
+
__version__ = "1.12.1"
|
|
69
69
|
print("PyPyNum", "Version -> " + __version__, "PyPI -> https://pypi.org/project/PyPyNum/",
|
|
70
70
|
"Gitee -> https://www.gitee.com/PythonSJL/PyPyNum", "GitHub -> https://github.com/PythonSJL/PyPyNum", sep=" | ")
|
|
71
71
|
del math, arr, ite, num, prec, real, geom, ContentError, RandomError, LogicError, InputError, FullError, Union
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
from decimal import Decimal, getcontext as __
|
|
2
2
|
from fractions import Fraction
|
|
3
|
-
|
|
4
3
|
from .types import prec
|
|
5
4
|
|
|
6
5
|
__context = __()
|
|
7
6
|
del __
|
|
8
7
|
|
|
9
8
|
|
|
9
|
+
def setprec(sigfigs: int):
|
|
10
|
+
__context.prec = sigfigs
|
|
11
|
+
|
|
12
|
+
|
|
10
13
|
def frac2dec(frac: Fraction, sigfigs: int) -> Decimal:
|
|
11
14
|
__context.prec = sigfigs
|
|
12
15
|
return Decimal(frac.numerator) / Decimal(frac.denominator)
|
|
@@ -175,27 +178,26 @@ def mp_ln(x: prec, sigfigs: int, builtin: bool = True) -> Decimal:
|
|
|
175
178
|
if builtin:
|
|
176
179
|
__context.prec = sigfigs
|
|
177
180
|
return Decimal(x).ln()
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return ln_x * sign
|
|
181
|
+
x = Decimal(x)
|
|
182
|
+
if x <= 0:
|
|
183
|
+
raise ValueError("Natural logarithm is not defined for x <= 0")
|
|
184
|
+
sigfigs = sigfigs + 5
|
|
185
|
+
__context.prec = sigfigs
|
|
186
|
+
sign = -1
|
|
187
|
+
if x > 1:
|
|
188
|
+
x = 1 / x
|
|
189
|
+
sign = 1
|
|
190
|
+
ln_x = Decimal(0)
|
|
191
|
+
term = Decimal(1)
|
|
192
|
+
dx = 1 - x
|
|
193
|
+
k = 1
|
|
194
|
+
eps = Decimal(10) ** -sigfigs
|
|
195
|
+
while abs(term) >= eps:
|
|
196
|
+
term *= dx
|
|
197
|
+
ln_x += term / k
|
|
198
|
+
k += 1
|
|
199
|
+
__context.prec -= 5
|
|
200
|
+
return ln_x * sign
|
|
199
201
|
|
|
200
202
|
|
|
201
203
|
def mp_log(x: prec, base: prec, sigfigs: int, builtin: bool = True) -> Decimal:
|
|
@@ -215,3 +217,87 @@ def mp_log(x: prec, base: prec, sigfigs: int, builtin: bool = True) -> Decimal:
|
|
|
215
217
|
log_x_base = ln_x / ln_base
|
|
216
218
|
__context.prec -= 5
|
|
217
219
|
return +log_x_base
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def mp_atan(x: prec, sigfigs: int) -> Decimal:
|
|
223
|
+
x = Decimal(x)
|
|
224
|
+
if abs(x) != x:
|
|
225
|
+
return -mp_atan(-x, sigfigs)
|
|
226
|
+
__context.prec = sigfigs + 5
|
|
227
|
+
m = 0
|
|
228
|
+
if x > 2:
|
|
229
|
+
x = 1 / x
|
|
230
|
+
flag = -1
|
|
231
|
+
else:
|
|
232
|
+
flag = 0
|
|
233
|
+
if x > 0.5:
|
|
234
|
+
x = x / (1 + (1 + x ** 2).sqrt())
|
|
235
|
+
m = 2
|
|
236
|
+
flag = 1
|
|
237
|
+
if x > 0.5:
|
|
238
|
+
x = x / (1 + (1 + x ** 2).sqrt())
|
|
239
|
+
m = 4
|
|
240
|
+
atan_x = 0
|
|
241
|
+
term = power = x
|
|
242
|
+
n = 1
|
|
243
|
+
constant = -x * x
|
|
244
|
+
eps = Decimal(10) ** -sigfigs
|
|
245
|
+
while abs(term) >= eps:
|
|
246
|
+
atan_x += term
|
|
247
|
+
power *= constant
|
|
248
|
+
n += 2
|
|
249
|
+
term = power / n
|
|
250
|
+
if flag:
|
|
251
|
+
atan_x = atan_x * m if flag > 0 else mp_pi(sigfigs + 5) - atan_x
|
|
252
|
+
atan_x %= mp_pi(sigfigs) / 2
|
|
253
|
+
__context.prec = sigfigs
|
|
254
|
+
return +atan_x
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def mp_atan2(y: prec, x: prec, sigfigs: int) -> Decimal:
|
|
258
|
+
pi = mp_pi(sigfigs + 5)
|
|
259
|
+
if x == 0:
|
|
260
|
+
if y == 0:
|
|
261
|
+
raise ValueError("Cannot compute atan2(0, 0)")
|
|
262
|
+
if y > 0:
|
|
263
|
+
return pi / 2
|
|
264
|
+
else:
|
|
265
|
+
return -pi / 2
|
|
266
|
+
result = mp_atan(y / x, sigfigs + 5)
|
|
267
|
+
if x < 0:
|
|
268
|
+
if y >= 0:
|
|
269
|
+
result += pi
|
|
270
|
+
else:
|
|
271
|
+
result -= pi
|
|
272
|
+
__context.prec = sigfigs
|
|
273
|
+
return +result
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
def mp_exp(x: prec, sigfigs: int, builtin: bool = True) -> Decimal:
|
|
277
|
+
if builtin:
|
|
278
|
+
__context.prec = sigfigs
|
|
279
|
+
return Decimal(x).exp()
|
|
280
|
+
x = Decimal(x)
|
|
281
|
+
__context.prec = sigfigs + 5
|
|
282
|
+
n = term = exp_x = Decimal(1)
|
|
283
|
+
eps = Decimal(10) ** -sigfigs
|
|
284
|
+
while abs(term) >= eps:
|
|
285
|
+
term *= x / n
|
|
286
|
+
exp_x += term
|
|
287
|
+
n += 1
|
|
288
|
+
__context.prec = sigfigs
|
|
289
|
+
return +exp_x
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
def mp_sinh(x: prec, sigfigs: int) -> Decimal:
|
|
293
|
+
x = Decimal(x)
|
|
294
|
+
sinh_x = (Decimal(1) - mp_exp(-2 * x, sigfigs + 5)) / (2 * mp_exp(-x, sigfigs + 5))
|
|
295
|
+
__context.prec = sigfigs
|
|
296
|
+
return +sinh_x
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
def mp_cosh(x: prec, sigfigs: int) -> Decimal:
|
|
300
|
+
x = Decimal(x)
|
|
301
|
+
cosh_x = (Decimal(1) + mp_exp(-2 * x, sigfigs + 5)) / (2 * mp_exp(-x, sigfigs + 5))
|
|
302
|
+
__context.prec = sigfigs
|
|
303
|
+
return +cosh_x
|
|
@@ -165,6 +165,26 @@ def 多精度对数(真数: real, 底数: real, 有效位数: int, 使用内置
|
|
|
165
165
|
return mp_log(真数, 底数, 有效位数, 使用内置方法)
|
|
166
166
|
|
|
167
167
|
|
|
168
|
+
def 多精度反正切(x: real, 有效位数: int) -> Decimal:
|
|
169
|
+
return mp_atan(x, 有效位数)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def 多精度方位角(y: real, x: real, 有效位数: int) -> Decimal:
|
|
173
|
+
return mp_atan2(y, x, 有效位数)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def 多精度自然指数(指数: real, 有效位数: int, 使用内置方法: bool = True) -> Decimal:
|
|
177
|
+
return mp_exp(指数, 有效位数, 使用内置方法)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def 多精度双曲正弦(x: real, 有效位数: int) -> Decimal:
|
|
181
|
+
return mp_sinh(x, 有效位数)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def 多精度双曲余弦(x: real, 有效位数: int) -> Decimal:
|
|
185
|
+
return mp_cosh(x, 有效位数)
|
|
186
|
+
|
|
187
|
+
|
|
168
188
|
def 下伽玛(s: num, x: num) -> num:
|
|
169
189
|
return lower_gamma(s, x)
|
|
170
190
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|