PyPyNum 1.8.1__tar.gz → 1.8.2__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.8.1 → PyPyNum-1.8.2}/PKG-INFO +47 -23
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/PyPyNum.egg-info/PKG-INFO +47 -23
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/Array.py +5 -2
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/Quaternion.py +1 -1
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/README.md +43 -19
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/Vector.py +2 -2
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/__init__.py +3 -3
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/maths.py +9 -9
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/test.py +2 -1
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/this.py +2 -1
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/setup.py +4 -4
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/PyPyNum.egg-info/SOURCES.txt +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/PyPyNum.egg-info/dependency_links.txt +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/PyPyNum.egg-info/top_level.txt +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/FourierT.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/Geometry.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/Graph.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/Group.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/Logic.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/Matrix.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/NeuralN.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/PyPyNum.png +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/Symbolics.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/Tensor.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/Tree.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/chars.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/cipher.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/constants.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/equations.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/errors.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/file.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/numbers.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/plotting.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/polynomial.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/probability.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/random.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/regression.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/sequence.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/tools.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/types.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/pypynum/utils.py +0 -0
- {PyPyNum-1.8.1 → PyPyNum-1.8.2}/setup.cfg +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyPyNum
|
|
3
|
-
Version: 1.8.
|
|
4
|
-
Summary: A multifunctional mathematical calculation package written in pure Python programming language [Python>=3.
|
|
5
|
-
Home-page: https://
|
|
3
|
+
Version: 1.8.2
|
|
4
|
+
Summary: A multifunctional mathematical calculation package written in pure Python programming language [Python>=3.4]
|
|
5
|
+
Home-page: https://github.com/PythonSJL/PyPyNum
|
|
6
6
|
Author: Shen Jiayi
|
|
7
7
|
Author-email: 2261748025@qq.com
|
|
8
8
|
License:
|
|
@@ -669,13 +669,13 @@ License:
|
|
|
669
669
|
<http://www.gnu.org/licenses/>.
|
|
670
670
|
|
|
671
671
|
Keywords: math,数学,mathematics,数学计算,numerical,数值,computation,计算,scientific,科学,algebra,代数,calculus,微积分,statistics,统计,linear-algebra,线性代数,optimization,优化,numerical-analysis,数值分析,matrix,矩阵,vector,向量,tensor,张量,numerics,数值计算,library,库,tools,工具,utils,实用程序,algorithms,算法,software,软件,package,包,methods,方法,data-science,数据科学,machine-learning,机器学习,computational,计算的,operations,操作,functions,函数,processing,处理,programming,编程,simulation,仿真,visualization,可视化,physics,物理
|
|
672
|
-
Requires-Python: >=3.
|
|
672
|
+
Requires-Python: >=3.4
|
|
673
673
|
Description-Content-Type: text/markdown
|
|
674
674
|
|
|
675
675
|
# <font color = blue>PyPyNum</font>
|
|
676
676
|
|
|
677
677
|
<font color = gree>A multifunctional mathematical calculation package written in pure Python programming language
|
|
678
|
-
</font><font color = red>[Python>=3.
|
|
678
|
+
</font><font color = red>[Python>=3.4]</font>
|
|
679
679
|
|
|
680
680
|
```
|
|
681
681
|
________ ___ ___ ________ ___ ___ ________ ___ ___ _____ ______
|
|
@@ -692,7 +692,7 @@ Description-Content-Type: text/markdown
|
|
|
692
692
|
[](https://pepy.tech/project/pypynum)
|
|
693
693
|
[](https://pepy.tech/project/pypynum)
|
|
694
694
|
|
|
695
|
-
## Version -> 1.8.
|
|
695
|
+
## Version -> 1.8.2 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
|
|
696
696
|
|
|
697
697
|

|
|
698
698
|
|
|
@@ -704,8 +704,9 @@ The logo cannot be displayed on PyPI, it can be viewed in Gitee.
|
|
|
704
704
|
|
|
705
705
|
#### Introduction
|
|
706
706
|
|
|
707
|
-
+
|
|
708
|
-
+
|
|
707
|
+
+ 多功能数学库,类似于numpy、scipy等,专为PyPy解释器制作,亦支持其他类型的Python解释器
|
|
708
|
+
+ Multi functional math library, similar to numpy, scipy, etc., designed specifically for PyPy interpreters and also
|
|
709
|
+
supports other types of Python interpreters
|
|
709
710
|
+ 不定期更新版本,增加更多实用功能
|
|
710
711
|
+ Update versions periodically to add more practical features
|
|
711
712
|
+ 如需联系,QQ 2261748025 (Py𝙿𝚢𝚝𝚑𝚘𝚗-水晶兰)
|
|
@@ -741,26 +742,49 @@ Python interpreter and run it!)
|
|
|
741
742
|
```
|
|
742
743
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
743
744
|
|
|
744
|
-
|
|
745
|
+
已确认此库能够向下兼容Python 3.4版本
|
|
746
|
+
以此支持IronPython解释器。
|
|
745
747
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
748
|
+
It has been confirmed that this
|
|
749
|
+
library is backward compatible
|
|
750
|
+
with Python version 3.4 to
|
|
751
|
+
support the IronPython
|
|
752
|
+
interpreter.
|
|
749
753
|
|
|
750
754
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
751
755
|
|
|
752
|
-
|
|
756
|
+
修改并优化了部分功能。
|
|
753
757
|
|
|
754
|
-
|
|
758
|
+
Modified and optimized some
|
|
759
|
+
features.
|
|
755
760
|
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
761
|
+
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
762
|
+
|
|
763
|
+
修改了fill函数,该函数将一维值序列填充
|
|
764
|
+
到指定形状的数组中。如果未指定列表,则默
|
|
765
|
+
认为从零开始递增的序列。此函数默认为循环
|
|
766
|
+
填充,否则使用零填充来填充剩余位置。
|
|
767
|
+
|
|
768
|
+
Modified the fill function,
|
|
769
|
+
which fills a one-dimensional
|
|
770
|
+
value sequence into an array of
|
|
771
|
+
specified shapes. If no list is
|
|
772
|
+
specified, it defaults to a
|
|
773
|
+
sequence that increments from
|
|
774
|
+
zero. This function defaults to
|
|
775
|
+
loop padding, otherwise zero
|
|
776
|
+
padding is used to fill the
|
|
777
|
+
remaining positions.
|
|
778
|
+
|
|
779
|
+
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
780
|
+
|
|
781
|
+
使用辛普森公式提高定积分的计算精度。
|
|
782
|
+
|
|
783
|
+
Use Simpson's formula to improve
|
|
784
|
+
the calculation accuracy of
|
|
785
|
+
definite integrals.
|
|
786
|
+
|
|
787
|
+
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
764
788
|
```
|
|
765
789
|
|
|
766
790
|
### 运行用时测试
|
|
@@ -811,7 +835,7 @@ PyPyNum
|
|
|
811
835
|
Array
|
|
812
836
|
FUNCTIONS
|
|
813
837
|
array(data=None)
|
|
814
|
-
fill(shape, sequence=None)
|
|
838
|
+
fill(shape, sequence=None, repeat=True)
|
|
815
839
|
function(_array, _function, args=None)
|
|
816
840
|
get_shape(data)
|
|
817
841
|
is_valid_array(_array, _shape)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyPyNum
|
|
3
|
-
Version: 1.8.
|
|
4
|
-
Summary: A multifunctional mathematical calculation package written in pure Python programming language [Python>=3.
|
|
5
|
-
Home-page: https://
|
|
3
|
+
Version: 1.8.2
|
|
4
|
+
Summary: A multifunctional mathematical calculation package written in pure Python programming language [Python>=3.4]
|
|
5
|
+
Home-page: https://github.com/PythonSJL/PyPyNum
|
|
6
6
|
Author: Shen Jiayi
|
|
7
7
|
Author-email: 2261748025@qq.com
|
|
8
8
|
License:
|
|
@@ -669,13 +669,13 @@ License:
|
|
|
669
669
|
<http://www.gnu.org/licenses/>.
|
|
670
670
|
|
|
671
671
|
Keywords: math,数学,mathematics,数学计算,numerical,数值,computation,计算,scientific,科学,algebra,代数,calculus,微积分,statistics,统计,linear-algebra,线性代数,optimization,优化,numerical-analysis,数值分析,matrix,矩阵,vector,向量,tensor,张量,numerics,数值计算,library,库,tools,工具,utils,实用程序,algorithms,算法,software,软件,package,包,methods,方法,data-science,数据科学,machine-learning,机器学习,computational,计算的,operations,操作,functions,函数,processing,处理,programming,编程,simulation,仿真,visualization,可视化,physics,物理
|
|
672
|
-
Requires-Python: >=3.
|
|
672
|
+
Requires-Python: >=3.4
|
|
673
673
|
Description-Content-Type: text/markdown
|
|
674
674
|
|
|
675
675
|
# <font color = blue>PyPyNum</font>
|
|
676
676
|
|
|
677
677
|
<font color = gree>A multifunctional mathematical calculation package written in pure Python programming language
|
|
678
|
-
</font><font color = red>[Python>=3.
|
|
678
|
+
</font><font color = red>[Python>=3.4]</font>
|
|
679
679
|
|
|
680
680
|
```
|
|
681
681
|
________ ___ ___ ________ ___ ___ ________ ___ ___ _____ ______
|
|
@@ -692,7 +692,7 @@ Description-Content-Type: text/markdown
|
|
|
692
692
|
[](https://pepy.tech/project/pypynum)
|
|
693
693
|
[](https://pepy.tech/project/pypynum)
|
|
694
694
|
|
|
695
|
-
## Version -> 1.8.
|
|
695
|
+
## Version -> 1.8.2 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
|
|
696
696
|
|
|
697
697
|

|
|
698
698
|
|
|
@@ -704,8 +704,9 @@ The logo cannot be displayed on PyPI, it can be viewed in Gitee.
|
|
|
704
704
|
|
|
705
705
|
#### Introduction
|
|
706
706
|
|
|
707
|
-
+
|
|
708
|
-
+
|
|
707
|
+
+ 多功能数学库,类似于numpy、scipy等,专为PyPy解释器制作,亦支持其他类型的Python解释器
|
|
708
|
+
+ Multi functional math library, similar to numpy, scipy, etc., designed specifically for PyPy interpreters and also
|
|
709
|
+
supports other types of Python interpreters
|
|
709
710
|
+ 不定期更新版本,增加更多实用功能
|
|
710
711
|
+ Update versions periodically to add more practical features
|
|
711
712
|
+ 如需联系,QQ 2261748025 (Py𝙿𝚢𝚝𝚑𝚘𝚗-水晶兰)
|
|
@@ -741,26 +742,49 @@ Python interpreter and run it!)
|
|
|
741
742
|
```
|
|
742
743
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
743
744
|
|
|
744
|
-
|
|
745
|
+
已确认此库能够向下兼容Python 3.4版本
|
|
746
|
+
以此支持IronPython解释器。
|
|
745
747
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
748
|
+
It has been confirmed that this
|
|
749
|
+
library is backward compatible
|
|
750
|
+
with Python version 3.4 to
|
|
751
|
+
support the IronPython
|
|
752
|
+
interpreter.
|
|
749
753
|
|
|
750
754
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
751
755
|
|
|
752
|
-
|
|
756
|
+
修改并优化了部分功能。
|
|
753
757
|
|
|
754
|
-
|
|
758
|
+
Modified and optimized some
|
|
759
|
+
features.
|
|
755
760
|
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
761
|
+
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
762
|
+
|
|
763
|
+
修改了fill函数,该函数将一维值序列填充
|
|
764
|
+
到指定形状的数组中。如果未指定列表,则默
|
|
765
|
+
认为从零开始递增的序列。此函数默认为循环
|
|
766
|
+
填充,否则使用零填充来填充剩余位置。
|
|
767
|
+
|
|
768
|
+
Modified the fill function,
|
|
769
|
+
which fills a one-dimensional
|
|
770
|
+
value sequence into an array of
|
|
771
|
+
specified shapes. If no list is
|
|
772
|
+
specified, it defaults to a
|
|
773
|
+
sequence that increments from
|
|
774
|
+
zero. This function defaults to
|
|
775
|
+
loop padding, otherwise zero
|
|
776
|
+
padding is used to fill the
|
|
777
|
+
remaining positions.
|
|
778
|
+
|
|
779
|
+
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
780
|
+
|
|
781
|
+
使用辛普森公式提高定积分的计算精度。
|
|
782
|
+
|
|
783
|
+
Use Simpson's formula to improve
|
|
784
|
+
the calculation accuracy of
|
|
785
|
+
definite integrals.
|
|
786
|
+
|
|
787
|
+
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
764
788
|
```
|
|
765
789
|
|
|
766
790
|
### 运行用时测试
|
|
@@ -811,7 +835,7 @@ PyPyNum
|
|
|
811
835
|
Array
|
|
812
836
|
FUNCTIONS
|
|
813
837
|
array(data=None)
|
|
814
|
-
fill(shape, sequence=None)
|
|
838
|
+
fill(shape, sequence=None, repeat=True)
|
|
815
839
|
function(_array, _function, args=None)
|
|
816
840
|
get_shape(data)
|
|
817
841
|
is_valid_array(_array, _shape)
|
|
@@ -183,19 +183,22 @@ def zeros_like(_nested_list):
|
|
|
183
183
|
return 0
|
|
184
184
|
|
|
185
185
|
|
|
186
|
-
def fill(shape, sequence=None):
|
|
186
|
+
def fill(shape, sequence=None, repeat=True):
|
|
187
187
|
pointer = -1
|
|
188
188
|
length = 1
|
|
189
189
|
for item in shape:
|
|
190
190
|
length *= item
|
|
191
191
|
if sequence is None:
|
|
192
192
|
sequence = list(range(length))
|
|
193
|
+
total = len(sequence)
|
|
193
194
|
|
|
194
195
|
def inner(_shape):
|
|
195
196
|
nonlocal pointer
|
|
196
197
|
if len(_shape) == 0:
|
|
198
|
+
if pointer == total and not repeat:
|
|
199
|
+
return 0
|
|
197
200
|
pointer += 1
|
|
198
|
-
return sequence[pointer %
|
|
201
|
+
return sequence[pointer % total]
|
|
199
202
|
else:
|
|
200
203
|
_array = []
|
|
201
204
|
for i in range(_shape[0]):
|
|
@@ -203,4 +203,4 @@ def change(data: Union[Quaternion, Matrix, Euler], to: str) -> Union[Quaternion,
|
|
|
203
203
|
roll = atan2(t3, t4)
|
|
204
204
|
return Euler(yaw, pitch, roll)
|
|
205
205
|
else:
|
|
206
|
-
raise TypeError("Data can only be Euler or Quaternion")
|
|
206
|
+
raise TypeError("Data can only be Euler or Matrix or Quaternion")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# <font color = blue>PyPyNum</font>
|
|
2
2
|
|
|
3
3
|
<font color = gree>A multifunctional mathematical calculation package written in pure Python programming language
|
|
4
|
-
</font><font color = red>[Python>=3.
|
|
4
|
+
</font><font color = red>[Python>=3.4]</font>
|
|
5
5
|
|
|
6
6
|
```
|
|
7
7
|
________ ___ ___ ________ ___ ___ ________ ___ ___ _____ ______
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
[](https://pepy.tech/project/pypynum)
|
|
19
19
|
[](https://pepy.tech/project/pypynum)
|
|
20
20
|
|
|
21
|
-
## Version -> 1.8.
|
|
21
|
+
## Version -> 1.8.2 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
|
|
22
22
|
|
|
23
23
|

|
|
24
24
|
|
|
@@ -30,8 +30,9 @@ The logo cannot be displayed on PyPI, it can be viewed in Gitee.
|
|
|
30
30
|
|
|
31
31
|
#### Introduction
|
|
32
32
|
|
|
33
|
-
+
|
|
34
|
-
+
|
|
33
|
+
+ 多功能数学库,类似于numpy、scipy等,专为PyPy解释器制作,亦支持其他类型的Python解释器
|
|
34
|
+
+ Multi functional math library, similar to numpy, scipy, etc., designed specifically for PyPy interpreters and also
|
|
35
|
+
supports other types of Python interpreters
|
|
35
36
|
+ 不定期更新版本,增加更多实用功能
|
|
36
37
|
+ Update versions periodically to add more practical features
|
|
37
38
|
+ 如需联系,QQ 2261748025 (Py𝙿𝚢𝚝𝚑𝚘𝚗-水晶兰)
|
|
@@ -67,26 +68,49 @@ Python interpreter and run it!)
|
|
|
67
68
|
```
|
|
68
69
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
69
70
|
|
|
70
|
-
|
|
71
|
+
已确认此库能够向下兼容Python 3.4版本
|
|
72
|
+
以此支持IronPython解释器。
|
|
71
73
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
It has been confirmed that this
|
|
75
|
+
library is backward compatible
|
|
76
|
+
with Python version 3.4 to
|
|
77
|
+
support the IronPython
|
|
78
|
+
interpreter.
|
|
75
79
|
|
|
76
80
|
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
77
81
|
|
|
78
|
-
|
|
82
|
+
修改并优化了部分功能。
|
|
79
83
|
|
|
80
|
-
|
|
84
|
+
Modified and optimized some
|
|
85
|
+
features.
|
|
81
86
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
88
|
+
|
|
89
|
+
修改了fill函数,该函数将一维值序列填充
|
|
90
|
+
到指定形状的数组中。如果未指定列表,则默
|
|
91
|
+
认为从零开始递增的序列。此函数默认为循环
|
|
92
|
+
填充,否则使用零填充来填充剩余位置。
|
|
93
|
+
|
|
94
|
+
Modified the fill function,
|
|
95
|
+
which fills a one-dimensional
|
|
96
|
+
value sequence into an array of
|
|
97
|
+
specified shapes. If no list is
|
|
98
|
+
specified, it defaults to a
|
|
99
|
+
sequence that increments from
|
|
100
|
+
zero. This function defaults to
|
|
101
|
+
loop padding, otherwise zero
|
|
102
|
+
padding is used to fill the
|
|
103
|
+
remaining positions.
|
|
104
|
+
|
|
105
|
+
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
106
|
+
|
|
107
|
+
使用辛普森公式提高定积分的计算精度。
|
|
108
|
+
|
|
109
|
+
Use Simpson's formula to improve
|
|
110
|
+
the calculation accuracy of
|
|
111
|
+
definite integrals.
|
|
112
|
+
|
|
113
|
+
!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
|
|
90
114
|
```
|
|
91
115
|
|
|
92
116
|
### 运行用时测试
|
|
@@ -137,7 +161,7 @@ PyPyNum
|
|
|
137
161
|
Array
|
|
138
162
|
FUNCTIONS
|
|
139
163
|
array(data=None)
|
|
140
|
-
fill(shape, sequence=None)
|
|
164
|
+
fill(shape, sequence=None, repeat=True)
|
|
141
165
|
function(_array, _function, args=None)
|
|
142
166
|
get_shape(data)
|
|
143
167
|
is_valid_array(_array, _shape)
|
|
@@ -45,7 +45,7 @@ class Vector(Array):
|
|
|
45
45
|
return self.norm()
|
|
46
46
|
|
|
47
47
|
def __pos__(self):
|
|
48
|
-
return Vector([
|
|
48
|
+
return Vector([item for item in self.data])
|
|
49
49
|
|
|
50
50
|
def __neg__(self):
|
|
51
51
|
return Vector([-item for item in self.data])
|
|
@@ -73,7 +73,7 @@ class Vector(Array):
|
|
|
73
73
|
for a in range(self.len):
|
|
74
74
|
axis = Vector([1 if p == a else 0 for p in range(self.len)])
|
|
75
75
|
result.append(acos(self @ axis / (self.norm() * axis.norm())))
|
|
76
|
-
elif
|
|
76
|
+
elif int(abs(axes)) == axes:
|
|
77
77
|
axis = Vector([1 if p == axes else 0 for p in range(self.len)])
|
|
78
78
|
result = acos(self @ axis / (self.norm() * axis.norm()))
|
|
79
79
|
elif isinstance(axes, (list, tuple)):
|
|
@@ -21,7 +21,7 @@ from .Graph import *
|
|
|
21
21
|
from .Group import group
|
|
22
22
|
from .Logic import *
|
|
23
23
|
from .maths import *
|
|
24
|
-
from .Matrix import mat, identity, rotate90, lu, qr, eigen, svd
|
|
24
|
+
from .Matrix import mat, identity, rotate90, lu, qr, hessenberg, eigen, svd
|
|
25
25
|
from .NeuralN import *
|
|
26
26
|
from .numbers import *
|
|
27
27
|
from .plotting import unary, binary, c_unary, color
|
|
@@ -39,7 +39,7 @@ from . import types
|
|
|
39
39
|
from .utils import OrderedSet, InfIterator
|
|
40
40
|
from .Vector import vec
|
|
41
41
|
|
|
42
|
-
__version__ = "1.8.
|
|
42
|
+
__version__ = "1.8.2"
|
|
43
43
|
print("PyPyNum", "Version -> " + __version__, "PyPI -> https://pypi.org/project/PyPyNum/",
|
|
44
|
-
"Gitee -> https://www.gitee.com/PythonSJL/PyPyNum", sep=" | ")
|
|
44
|
+
"Gitee -> https://www.gitee.com/PythonSJL/PyPyNum", "GitHub -> https://github.com/PythonSJL/PyPyNum", sep=" | ")
|
|
45
45
|
del math, arr, ite, num, real, geom, ContentError, RandomError, LogicError, InputError, FullError, Union
|
|
@@ -750,7 +750,7 @@ def pi(i: int, n: int, f) -> num:
|
|
|
750
750
|
return product(list(map(f, range(i, n + 1))))
|
|
751
751
|
|
|
752
752
|
|
|
753
|
-
def derivative(f, x: real, h: real = 1e-
|
|
753
|
+
def derivative(f, x: real, h: real = 1e-6) -> float:
|
|
754
754
|
"""
|
|
755
755
|
introduction
|
|
756
756
|
==========
|
|
@@ -759,17 +759,18 @@ def derivative(f, x: real, h: real = 1e-7) -> float:
|
|
|
759
759
|
example
|
|
760
760
|
==========
|
|
761
761
|
>>> derivative(lambda a: a ** 2, 2)
|
|
762
|
-
|
|
762
|
+
4.000000000115023
|
|
763
763
|
>>>
|
|
764
764
|
:param f: function
|
|
765
765
|
:param x: integer | float
|
|
766
766
|
:param h: integer | float
|
|
767
767
|
:return:
|
|
768
768
|
"""
|
|
769
|
+
h = h / 2
|
|
769
770
|
return (f(x + h) - f(x - h)) / (2 * h)
|
|
770
771
|
|
|
771
772
|
|
|
772
|
-
def definite_integral(f, x_start: real, x_end: real, n: int =
|
|
773
|
+
def definite_integral(f, x_start: real, x_end: real, n: int = 1000000) -> float:
|
|
773
774
|
"""
|
|
774
775
|
introduction
|
|
775
776
|
==========
|
|
@@ -778,7 +779,7 @@ def definite_integral(f, x_start: real, x_end: real, n: int = 10000000) -> float
|
|
|
778
779
|
example
|
|
779
780
|
==========
|
|
780
781
|
>>> definite_integral(lambda a: a ** 2, 0, 2)
|
|
781
|
-
2.
|
|
782
|
+
2.666666666666616
|
|
782
783
|
>>>
|
|
783
784
|
:param f: function
|
|
784
785
|
:param x_start: integer | float
|
|
@@ -787,11 +788,10 @@ def definite_integral(f, x_start: real, x_end: real, n: int = 10000000) -> float
|
|
|
787
788
|
:return:
|
|
788
789
|
"""
|
|
789
790
|
h = (x_end - x_start) / n
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
return _sum * h / 2
|
|
791
|
+
s = f(x_start) + f(x_end)
|
|
792
|
+
s += sum(map(lambda i: 4 * f(x_start + i * h), range(1, n, 2)))
|
|
793
|
+
s += sum(map(lambda i: 2 * f(x_start + i * h), range(2, n - 1, 2)))
|
|
794
|
+
return s * h / 3
|
|
795
795
|
|
|
796
796
|
|
|
797
797
|
def beta(p: real, q: real) -> real:
|
|
@@ -5,5 +5,6 @@ The Zen of PyPyNum
|
|
|
5
5
|
Zen = "\x9a¤¢\xa0¢°¼§¢°éâñåâòõÖ°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°\x9a\x9a±äù°õóñâòýõ°ã·äõü½äàõóþÿó°äåÿôþñäã°ñ°ãù°þ÷ùãõô°âñüåôÿÝ\x9a¾÷þùãùýÿâà°õò°äø÷ùý°äù°¼ôâñçâÿöäø÷ùñâäã°ãù°þÿùäñäþõýõüàýù°õøä°öÙ\x9a¾äù°âõôùãþÿóõâ°¼ôþõøõâàýÿó°ÿä°÷þù÷þõüüñøó°ãù°þÿùäñäþõýõüàýù°õøä°öÙ\x9a¾÷þùøãåâ°ÿä°âÿùâõàåã°ãù°÷þùäùñç°ãõýùäõýÿã°¼âõæõçÿØ\x9a¾þÿùäñþùäãñâóÿâà°þñøä°âõääõò°ãù°éüäàýÿâà°÷þùäóÑ\x9a¾øóñÿâààñ°ãåÿùæòÿ½õþÿ°éüþÿ°õøä°¼éüüñõôù½õþÿ°õò°äãåý°õâõøÄ\x9a¾õäñüåóõàã°ÿä°õ÷âå°õøä°äãùãõâ°¼ããõþõå÷ñæ°öÿ°õóþõãõâà°õøä°þÙ\x9a¾ôõäåý°éüäùóùüàèõ°ããõüþÅ\x9a¾ôõóþõüùã°äÿþ°¼þõûÿàã°õò°äãåý°ãâÿââÕ\x9a¾éäùâåà°âõæÿ°ãøàýåùâä°þõäöÿ°éäùüñóùäóñâÀ\x9a¾ãýâÿþ°õøä°õôùââõæÿ°äÿþ°ôüåÿøã°ãõãñó°üñùóõàÃ\x9a¾äþåÿýñâñà°ãù°éäùüùòñôñõÂ\x9a¾ãõþÿ°ôõäñÿüò°âõæÿ°ãþùç°õôÿó°õãâñàÃ\x9a¾ãõùøóâñâõùø°ôõäãõþ°ãäñõò°õâåäóåâäã°äñüÖ\x9a¾ôõäñóùüàýÿóâõæÿ°þñøä°âõääõò°ãù°ôõäñóùäãùøàÿÃ\x9a¾þÿùäåüÿæþÿó°âõæÿ°ôõââõöõâà°ãù°ããõþôâñçâÿöäø÷ùñâäÃ\x9a¾éäùâåóãòÿ°ãàýåâä°éäùâñüÓ\x9a¾éûþåüó°ÿä°âÿùâõàåã°ãù°äþñ÷õüÕ\x9a\x9a¾þÿøäéÀ°þù°éüõâåà°þõääùâç°õ÷ñûóñà°øäñý°ñ°ãù°ãùøÄ\x9a\x9aùéñùÚ°þõøÃ°éò°¼ýåÞéÀéÀ°öÿ°þõʰõøÄ°°°°\x9a"
|
|
6
6
|
print("".join([chr(ord(_) ^ 144) for _ in Zen[::-1]]))
|
|
7
7
|
for _ in list(globals().keys()):
|
|
8
|
-
|
|
8
|
+
if _ != "__builtins__":
|
|
9
|
+
del globals()[_]
|
|
9
10
|
del _
|
|
@@ -680,16 +680,16 @@ For more information on this, and how to apply and follow the GNU AGPL, see
|
|
|
680
680
|
|
|
681
681
|
setup(
|
|
682
682
|
name="PyPyNum",
|
|
683
|
-
version="1.8.
|
|
683
|
+
version="1.8.2",
|
|
684
684
|
packages=find_packages(),
|
|
685
|
-
url="https://
|
|
685
|
+
url="https://github.com/PythonSJL/PyPyNum",
|
|
686
686
|
license=LICENSE,
|
|
687
687
|
author="Shen Jiayi",
|
|
688
688
|
author_email="2261748025@qq.com",
|
|
689
689
|
description="""
|
|
690
|
-
A multifunctional mathematical calculation package written in pure Python programming language [Python>=3.
|
|
690
|
+
A multifunctional mathematical calculation package written in pure Python programming language [Python>=3.4]
|
|
691
691
|
""",
|
|
692
|
-
python_requires=">=3.
|
|
692
|
+
python_requires=">=3.4",
|
|
693
693
|
package_data={"pypynum": ["*"]},
|
|
694
694
|
long_description=md,
|
|
695
695
|
long_description_content_type="text/markdown",
|
|
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
|