PyPyNum 1.8.0__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.
Files changed (43) hide show
  1. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/PKG-INFO +59 -92
  2. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/PyPyNum.egg-info/PKG-INFO +59 -92
  3. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/PyPyNum.egg-info/SOURCES.txt +0 -1
  4. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Array.py +5 -2
  5. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Matrix.py +236 -32
  6. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Quaternion.py +1 -1
  7. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/README.md +55 -88
  8. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Vector.py +2 -2
  9. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/__init__.py +3 -3
  10. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/equations.py +3 -4
  11. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/maths.py +15 -10
  12. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/plotting.py +1 -0
  13. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/test.py +2 -1
  14. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/this.py +2 -1
  15. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/setup.py +12 -20
  16. PyPyNum-1.8.0/pypynum/__temporary.py +0 -169
  17. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/PyPyNum.egg-info/dependency_links.txt +0 -0
  18. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/PyPyNum.egg-info/top_level.txt +0 -0
  19. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/FourierT.py +0 -0
  20. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Geometry.py +0 -0
  21. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Graph.py +0 -0
  22. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Group.py +0 -0
  23. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Logic.py +0 -0
  24. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/NeuralN.py +0 -0
  25. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/PyPyNum.png +0 -0
  26. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Symbolics.py +0 -0
  27. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Tensor.py +0 -0
  28. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/Tree.py +0 -0
  29. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/chars.py +0 -0
  30. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/cipher.py +0 -0
  31. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/constants.py +0 -0
  32. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/errors.py +0 -0
  33. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/file.py +0 -0
  34. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/numbers.py +0 -0
  35. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/polynomial.py +0 -0
  36. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/probability.py +0 -0
  37. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/random.py +0 -0
  38. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/regression.py +0 -0
  39. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/sequence.py +0 -0
  40. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/tools.py +0 -0
  41. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/types.py +0 -0
  42. {PyPyNum-1.8.0 → PyPyNum-1.8.2}/pypynum/utils.py +0 -0
  43. {PyPyNum-1.8.0 → 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.0
4
- Summary: A multifunctional mathematical calculation package written in pure Python programming language [Python>=3.5]
5
- Home-page: https://www.gitee.com/PythonSJL/PyPyNum
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.5
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.5]</font>
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
  [![Downloads](https://static.pepy.tech/badge/pypynum/month)](https://pepy.tech/project/pypynum)
693
693
  [![Downloads](https://static.pepy.tech/badge/pypynum/week)](https://pepy.tech/project/pypynum)
694
694
 
695
- ## Version -> 1.8.0 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum
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
  ![LOGO](PyPyNum.png)
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
- + DIY数学库,类似于numpy、scipy等,专为PyPy解释器制作
708
- + DIY math library, similar to numpy, scipy, etc., specifically designed for PyPy interpreters
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,90 +742,49 @@ Python interpreter and run it!)
741
742
  ```
742
743
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
743
744
 
744
- 新增代码行数为603行
745
+ 已确认此库能够向下兼容Python 3.4版本
746
+ 以此支持IronPython解释器。
745
747
 
746
- Add 603 new lines of code
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.
747
753
 
748
754
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
749
755
 
750
- 新增函数“magic_square”的功能简介:可
751
- 以生成任意大于等于三的整数阶幻方。
756
+ 修改并优化了部分功能。
752
757
 
753
- Introduction to the newly added
754
- function "magic square": It can
755
- generate any integer order magic
756
- square greater than or equal to
757
- three.
758
+ Modified and optimized some
759
+ features.
758
760
 
759
761
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
760
762
 
761
- 新增模块“Graph”的功能简介:具有有向图
762
- 、无向图、带权有向图、带权无向图这四个对
763
- 象,支持添加或删除顶点和边,以及深度优先
764
- 搜索与广度优先搜索这两种图的遍历方式,还
765
- 有计算最短路径等功能。
766
-
767
- Introduction to the functions of
768
- the newly added module "Graph":
769
- it has four objects: directed
770
- graph, undirected graph,
771
- weighted directed graph, and
772
- weighted undirected graph. It
773
- supports adding or removing
774
- vertices and edges, as well as
775
- depth first search and breadth
776
- first search for graph
777
- traversal. It also has functions
778
- such as calculating the shortest
779
- path.
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.
780
778
 
781
779
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
782
780
 
783
- 新增模块“polynomial”的功能简介:有一
784
- 个多项式对象,可以通过传入包含“(次数,
785
- 系数)”的二元组组成的序列创建多项式对象
786
- ,可以随时设置某一项的数值,并且支持多
787
- 项式形式的四则运算,还有取商式、取余式
788
- 、求幂、求模幂的功能。
789
-
790
- Introduction to the newly added
791
- module "polynomial": There is a
792
- polynomial object that can be
793
- created by passing in a sequence
794
- of binary tuples containing
795
- "degree, coefficient". The value
796
- of a certain term can be set at
797
- any time, and it supports
798
- polynomial form arithmetic
799
- operations. It also has
800
- functions such as quotient,
801
- remainder, exponentiation, and
802
- modular exponentiation.
781
+ 使用辛普森公式提高定积分的计算精度。
803
782
 
804
- !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
805
-
806
- <<<以下结构中的省略号表示原有的部分>>>
807
-
808
- <<<The ellipsis in the following structure represents the original part>>>
783
+ Use Simpson's formula to improve
784
+ the calculation accuracy of
785
+ definite integrals.
809
786
 
810
- PyPyNum
811
- ★ Graph [Graph theory]
812
- CLASSES
813
- BaseGraph
814
- BaseWeGraph
815
- WeDiGraph
816
- WeUnGraph
817
- DiGraph
818
- UnGraph
819
- ★ polynomial [Polynomial object]
820
- CLASSES
821
- Polynomial
822
- FUNCTIONS
823
- poly(terms=None)
824
- ★ tools [Other useful tools]
825
- FUNCTIONS
826
- ...
827
- magic_square(n)
787
+ !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
828
788
  ```
829
789
 
830
790
  ### 运行用时测试
@@ -875,7 +835,7 @@ PyPyNum
875
835
  Array
876
836
  FUNCTIONS
877
837
  array(data=None)
878
- fill(shape, sequence=None)
838
+ fill(shape, sequence=None, repeat=True)
879
839
  function(_array, _function, args=None)
880
840
  get_shape(data)
881
841
  is_valid_array(_array, _shape)
@@ -939,14 +899,16 @@ PyPyNum
939
899
  CLASSES
940
900
  Matrix
941
901
  FUNCTIONS
942
- eig(matrix)
943
- identity(n)
944
- lu(matrix)
902
+ eigen(matrix: pypynum.Matrix.Matrix) -> tuple
903
+ hessenberg(matrix: pypynum.Matrix.Matrix) -> tuple
904
+ identity(n: int) -> pypynum.Matrix.Matrix
905
+ lu(matrix: pypynum.Matrix.Matrix) -> tuple
945
906
  mat(data)
946
- qr(matrix)
907
+ qr(matrix: pypynum.Matrix.Matrix) -> tuple
908
+ rotate90(matrix: pypynum.Matrix.Matrix, times: int) -> pypynum.Matrix.Matrix
947
909
  same(rows, cols, value=0)
948
- svd(matrix)
949
- tril_indices(n, k=0, m=None)
910
+ svd(matrix: pypynum.Matrix.Matrix) -> tuple
911
+ tril_indices(n: int, k: int = 0, m: int = None) -> tuple
950
912
  zeros(_dimensions)
951
913
  zeros_like(_nested_list)
952
914
  ★ NeuralN [A simple neural network model]
@@ -1130,6 +1092,9 @@ PyPyNum
1130
1092
  average(data, weights, expected=False)
1131
1093
  exgcd(a: int, b: int) -> tuple
1132
1094
  crt(n: arr, a: arr) -> int
1095
+ isqrt(x: int) -> int
1096
+ is_possibly_square(n: int) -> bool
1097
+ is_square(n: int) -> bool
1133
1098
  ★ numbers [Conversion of various numbers]
1134
1099
  FUNCTIONS
1135
1100
  float2fraction(number: float, mixed: bool = False, error: float = 1e-15) -> tuple
@@ -1359,7 +1324,7 @@ print(v1.angles())
1359
1324
  6.62607015e-34
1360
1325
  1.618033988749895
1361
1326
  3.141592653589793
1362
- 1000000000000.0
1327
+ 1000000000000
1363
1328
 
1364
1329
  >>> p = [1, -2, -3, 4]
1365
1330
  >>> m = [
@@ -1373,7 +1338,9 @@ print(v1.angles())
1373
1338
  >>> print(equations.polynomial_equation(p))
1374
1339
  >>> print(equations.linear_equation(*m))
1375
1340
 
1376
- [(-1.5615528128088307-6.5209667308287455e-24j) (2.5615528128088294+4.456233626665941e-24j) (1.0000000000000007+3.241554513744382e-25j)]
1341
+ [[(-1.5615528128088307-6.5209667308287455e-24j) 0 0]
1342
+ [ 0 (2.5615528128088294+4.456233626665941e-24j) 0]
1343
+ [ 0 0 (1.0000000000000007+3.241554513744382e-25j)]]
1377
1344
  [ 1.6666666666666667 -0.6666666666666666 -0.4444444444444444]
1378
1345
 
1379
1346
  >>> print(maths.cot(constants.pi / 3))
@@ -1468,10 +1435,10 @@ print(v1.angles())
1468
1435
  >>> print(random.randint(0, 9, [2, 3, 4]))
1469
1436
  >>> print(random.uniform(0, 9, [2, 3, 4]))
1470
1437
 
1471
- [[[0.4334341920363395, 0.055711784711422116, -1.0235500373980284, 0.30031229336738374], [-0.2650367914670356, 0.5513398538865067, -0.9735921328831166, 0.41345578602104827], [-0.11598957920080871, -0.9044539791933183, 1.6448227575237069, -0.26304156924843813]], [[0.27363898507271256, -0.5897181011789576, 1.5120937498473583, 2.1302709742844694], [1.9743293887616236, 0.4117207260898469, 0.5809554193110543, -1.8456249006764007], [1.274481044612177, -0.30645083457981553, -1.3285606156236818, 0.33473439037886943]]]
1472
- [[[0.5269441534226782, 0.36498666932667356, 0.7363066388832684, 0.5878544826035406], [0.5684721009896431, 0.9009577979323332, 0.036288112799501615, 0.18351641818419884], [0.24258369409385339, 0.09354340906140202, 0.4856203412285762, 0.783031677244552]], [[0.8777465681935882, 0.6406910705155251, 0.10275292827025073, 0.01295823682977526], [0.3898500974345528, 0.6216248983423127, 0.3179425906177036, 0.012870877167621808], [0.2660481991211192, 0.09872041627158801, 0.3681944568198672, 0.494087114885137]]]
1473
- [[[5, 9, 5, 6], [6, 7, 6, 1], [1, 3, 2, 4]], [[5, 8, 8, 3], [3, 2, 3, 9], [3, 0, 7, 1]]]
1474
- [[[8.610851610963957, 1.3747433091161905, 1.3831050577679438, 4.715182178697273], [0.8765517657148284, 4.809554825684029, 2.7557819856736137, 5.938765584746821], [6.088739464744903, 4.627722536295625, 0.6116370455995369, 5.875683438664389]], [[7.7228845997304845, 5.428461366109726, 8.02712172516869, 5.9319006090345425], [5.726626482636939, 7.978329508380601, 1.114307478513796, 6.236721706167868], [1.4123245528031072, 5.327811122183013, 7.324213082306745, 1.5016363011868927]]]
1438
+ [[[1.524086835643172, -0.20868457467847845, 0.5240261503975477, -0.6439838767682032], [-1.091904210196648, -0.20567633973733265, 1.374424576574523, 0.6563097903476932], [0.2171635934136032, 1.0821030876490199, -0.8410496800310051, -0.8321549344577578]], [[0.5306996954571072, -0.4441704154154241, 1.0481960055260355, 0.39805451821848287], [-0.4006858882593715, -0.06238294764009237, -1.1536673264483728, -0.8063185246185602], [0.3029117113345387, -0.32570360518676644, 0.6608320231980702, 1.7415150171137153]]]
1439
+ [[[0.3736243541521843, 0.8599079983285199, 0.4260061864869946, 0.8441437619796597], [0.8955986631978392, 0.7570336992646656, 0.6706841989644684, 0.328634366074538], [0.4371430562585502, 0.9576395263025738, 0.2380278778546957, 0.806813631306664]], [[0.18549375381453237, 0.5749941389233029, 0.7009767023241946, 0.30017399397762223], [0.6661914823434657, 0.7802291606608635, 0.6847755352217044, 0.2661053533652564], [0.07937643994416943, 0.5452043474222034, 0.8026792060861194, 0.07776400257578953]]]
1440
+ [[[9, 0, 9, 0], [2, 6, 3, 4], [5, 8, 4, 7]], [[7, 7, 6, 3], [5, 5, 5, 8], [3, 4, 6, 6]]]
1441
+ [[[5.049093842782947, 1.3880585421884204, 8.533634113864629, 3.550264239771317], [3.3311351975225176, 5.131771033264564, 0.9570872044431911, 5.165536082759862], [1.2035779060925538, 8.292998518472567, 8.014641974770818, 6.251632912237915]], [[6.411677800595937, 5.365937405245105, 8.70943859614565, 4.348757668525482], [7.827612569569748, 1.3718742546020972, 0.5252489627763138, 2.065015517785291], [4.620664668451086, 2.604569735623819, 5.548107842615733, 7.60342292447815]]]
1475
1442
 
1476
1443
  >>> print(regression.linear_regression(list(range(5)), [2, 4, 6, 7, 8]))
1477
1444
  >>> print(regression.parabolic_regression(list(range(5)), [2, 4, 6, 7, 8]))
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyPyNum
3
- Version: 1.8.0
4
- Summary: A multifunctional mathematical calculation package written in pure Python programming language [Python>=3.5]
5
- Home-page: https://www.gitee.com/PythonSJL/PyPyNum
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.5
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.5]</font>
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
  [![Downloads](https://static.pepy.tech/badge/pypynum/month)](https://pepy.tech/project/pypynum)
693
693
  [![Downloads](https://static.pepy.tech/badge/pypynum/week)](https://pepy.tech/project/pypynum)
694
694
 
695
- ## Version -> 1.8.0 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum
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
  ![LOGO](PyPyNum.png)
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
- + DIY数学库,类似于numpy、scipy等,专为PyPy解释器制作
708
- + DIY math library, similar to numpy, scipy, etc., specifically designed for PyPy interpreters
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,90 +742,49 @@ Python interpreter and run it!)
741
742
  ```
742
743
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
743
744
 
744
- 新增代码行数为603行
745
+ 已确认此库能够向下兼容Python 3.4版本
746
+ 以此支持IronPython解释器。
745
747
 
746
- Add 603 new lines of code
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.
747
753
 
748
754
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
749
755
 
750
- 新增函数“magic_square”的功能简介:可
751
- 以生成任意大于等于三的整数阶幻方。
756
+ 修改并优化了部分功能。
752
757
 
753
- Introduction to the newly added
754
- function "magic square": It can
755
- generate any integer order magic
756
- square greater than or equal to
757
- three.
758
+ Modified and optimized some
759
+ features.
758
760
 
759
761
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
760
762
 
761
- 新增模块“Graph”的功能简介:具有有向图
762
- 、无向图、带权有向图、带权无向图这四个对
763
- 象,支持添加或删除顶点和边,以及深度优先
764
- 搜索与广度优先搜索这两种图的遍历方式,还
765
- 有计算最短路径等功能。
766
-
767
- Introduction to the functions of
768
- the newly added module "Graph":
769
- it has four objects: directed
770
- graph, undirected graph,
771
- weighted directed graph, and
772
- weighted undirected graph. It
773
- supports adding or removing
774
- vertices and edges, as well as
775
- depth first search and breadth
776
- first search for graph
777
- traversal. It also has functions
778
- such as calculating the shortest
779
- path.
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.
780
778
 
781
779
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
782
780
 
783
- 新增模块“polynomial”的功能简介:有一
784
- 个多项式对象,可以通过传入包含“(次数,
785
- 系数)”的二元组组成的序列创建多项式对象
786
- ,可以随时设置某一项的数值,并且支持多
787
- 项式形式的四则运算,还有取商式、取余式
788
- 、求幂、求模幂的功能。
789
-
790
- Introduction to the newly added
791
- module "polynomial": There is a
792
- polynomial object that can be
793
- created by passing in a sequence
794
- of binary tuples containing
795
- "degree, coefficient". The value
796
- of a certain term can be set at
797
- any time, and it supports
798
- polynomial form arithmetic
799
- operations. It also has
800
- functions such as quotient,
801
- remainder, exponentiation, and
802
- modular exponentiation.
781
+ 使用辛普森公式提高定积分的计算精度。
803
782
 
804
- !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
805
-
806
- <<<以下结构中的省略号表示原有的部分>>>
807
-
808
- <<<The ellipsis in the following structure represents the original part>>>
783
+ Use Simpson's formula to improve
784
+ the calculation accuracy of
785
+ definite integrals.
809
786
 
810
- PyPyNum
811
- ★ Graph [Graph theory]
812
- CLASSES
813
- BaseGraph
814
- BaseWeGraph
815
- WeDiGraph
816
- WeUnGraph
817
- DiGraph
818
- UnGraph
819
- ★ polynomial [Polynomial object]
820
- CLASSES
821
- Polynomial
822
- FUNCTIONS
823
- poly(terms=None)
824
- ★ tools [Other useful tools]
825
- FUNCTIONS
826
- ...
827
- magic_square(n)
787
+ !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
828
788
  ```
829
789
 
830
790
  ### 运行用时测试
@@ -875,7 +835,7 @@ PyPyNum
875
835
  Array
876
836
  FUNCTIONS
877
837
  array(data=None)
878
- fill(shape, sequence=None)
838
+ fill(shape, sequence=None, repeat=True)
879
839
  function(_array, _function, args=None)
880
840
  get_shape(data)
881
841
  is_valid_array(_array, _shape)
@@ -939,14 +899,16 @@ PyPyNum
939
899
  CLASSES
940
900
  Matrix
941
901
  FUNCTIONS
942
- eig(matrix)
943
- identity(n)
944
- lu(matrix)
902
+ eigen(matrix: pypynum.Matrix.Matrix) -> tuple
903
+ hessenberg(matrix: pypynum.Matrix.Matrix) -> tuple
904
+ identity(n: int) -> pypynum.Matrix.Matrix
905
+ lu(matrix: pypynum.Matrix.Matrix) -> tuple
945
906
  mat(data)
946
- qr(matrix)
907
+ qr(matrix: pypynum.Matrix.Matrix) -> tuple
908
+ rotate90(matrix: pypynum.Matrix.Matrix, times: int) -> pypynum.Matrix.Matrix
947
909
  same(rows, cols, value=0)
948
- svd(matrix)
949
- tril_indices(n, k=0, m=None)
910
+ svd(matrix: pypynum.Matrix.Matrix) -> tuple
911
+ tril_indices(n: int, k: int = 0, m: int = None) -> tuple
950
912
  zeros(_dimensions)
951
913
  zeros_like(_nested_list)
952
914
  ★ NeuralN [A simple neural network model]
@@ -1130,6 +1092,9 @@ PyPyNum
1130
1092
  average(data, weights, expected=False)
1131
1093
  exgcd(a: int, b: int) -> tuple
1132
1094
  crt(n: arr, a: arr) -> int
1095
+ isqrt(x: int) -> int
1096
+ is_possibly_square(n: int) -> bool
1097
+ is_square(n: int) -> bool
1133
1098
  ★ numbers [Conversion of various numbers]
1134
1099
  FUNCTIONS
1135
1100
  float2fraction(number: float, mixed: bool = False, error: float = 1e-15) -> tuple
@@ -1359,7 +1324,7 @@ print(v1.angles())
1359
1324
  6.62607015e-34
1360
1325
  1.618033988749895
1361
1326
  3.141592653589793
1362
- 1000000000000.0
1327
+ 1000000000000
1363
1328
 
1364
1329
  >>> p = [1, -2, -3, 4]
1365
1330
  >>> m = [
@@ -1373,7 +1338,9 @@ print(v1.angles())
1373
1338
  >>> print(equations.polynomial_equation(p))
1374
1339
  >>> print(equations.linear_equation(*m))
1375
1340
 
1376
- [(-1.5615528128088307-6.5209667308287455e-24j) (2.5615528128088294+4.456233626665941e-24j) (1.0000000000000007+3.241554513744382e-25j)]
1341
+ [[(-1.5615528128088307-6.5209667308287455e-24j) 0 0]
1342
+ [ 0 (2.5615528128088294+4.456233626665941e-24j) 0]
1343
+ [ 0 0 (1.0000000000000007+3.241554513744382e-25j)]]
1377
1344
  [ 1.6666666666666667 -0.6666666666666666 -0.4444444444444444]
1378
1345
 
1379
1346
  >>> print(maths.cot(constants.pi / 3))
@@ -1468,10 +1435,10 @@ print(v1.angles())
1468
1435
  >>> print(random.randint(0, 9, [2, 3, 4]))
1469
1436
  >>> print(random.uniform(0, 9, [2, 3, 4]))
1470
1437
 
1471
- [[[0.4334341920363395, 0.055711784711422116, -1.0235500373980284, 0.30031229336738374], [-0.2650367914670356, 0.5513398538865067, -0.9735921328831166, 0.41345578602104827], [-0.11598957920080871, -0.9044539791933183, 1.6448227575237069, -0.26304156924843813]], [[0.27363898507271256, -0.5897181011789576, 1.5120937498473583, 2.1302709742844694], [1.9743293887616236, 0.4117207260898469, 0.5809554193110543, -1.8456249006764007], [1.274481044612177, -0.30645083457981553, -1.3285606156236818, 0.33473439037886943]]]
1472
- [[[0.5269441534226782, 0.36498666932667356, 0.7363066388832684, 0.5878544826035406], [0.5684721009896431, 0.9009577979323332, 0.036288112799501615, 0.18351641818419884], [0.24258369409385339, 0.09354340906140202, 0.4856203412285762, 0.783031677244552]], [[0.8777465681935882, 0.6406910705155251, 0.10275292827025073, 0.01295823682977526], [0.3898500974345528, 0.6216248983423127, 0.3179425906177036, 0.012870877167621808], [0.2660481991211192, 0.09872041627158801, 0.3681944568198672, 0.494087114885137]]]
1473
- [[[5, 9, 5, 6], [6, 7, 6, 1], [1, 3, 2, 4]], [[5, 8, 8, 3], [3, 2, 3, 9], [3, 0, 7, 1]]]
1474
- [[[8.610851610963957, 1.3747433091161905, 1.3831050577679438, 4.715182178697273], [0.8765517657148284, 4.809554825684029, 2.7557819856736137, 5.938765584746821], [6.088739464744903, 4.627722536295625, 0.6116370455995369, 5.875683438664389]], [[7.7228845997304845, 5.428461366109726, 8.02712172516869, 5.9319006090345425], [5.726626482636939, 7.978329508380601, 1.114307478513796, 6.236721706167868], [1.4123245528031072, 5.327811122183013, 7.324213082306745, 1.5016363011868927]]]
1438
+ [[[1.524086835643172, -0.20868457467847845, 0.5240261503975477, -0.6439838767682032], [-1.091904210196648, -0.20567633973733265, 1.374424576574523, 0.6563097903476932], [0.2171635934136032, 1.0821030876490199, -0.8410496800310051, -0.8321549344577578]], [[0.5306996954571072, -0.4441704154154241, 1.0481960055260355, 0.39805451821848287], [-0.4006858882593715, -0.06238294764009237, -1.1536673264483728, -0.8063185246185602], [0.3029117113345387, -0.32570360518676644, 0.6608320231980702, 1.7415150171137153]]]
1439
+ [[[0.3736243541521843, 0.8599079983285199, 0.4260061864869946, 0.8441437619796597], [0.8955986631978392, 0.7570336992646656, 0.6706841989644684, 0.328634366074538], [0.4371430562585502, 0.9576395263025738, 0.2380278778546957, 0.806813631306664]], [[0.18549375381453237, 0.5749941389233029, 0.7009767023241946, 0.30017399397762223], [0.6661914823434657, 0.7802291606608635, 0.6847755352217044, 0.2661053533652564], [0.07937643994416943, 0.5452043474222034, 0.8026792060861194, 0.07776400257578953]]]
1440
+ [[[9, 0, 9, 0], [2, 6, 3, 4], [5, 8, 4, 7]], [[7, 7, 6, 3], [5, 5, 5, 8], [3, 4, 6, 6]]]
1441
+ [[[5.049093842782947, 1.3880585421884204, 8.533634113864629, 3.550264239771317], [3.3311351975225176, 5.131771033264564, 0.9570872044431911, 5.165536082759862], [1.2035779060925538, 8.292998518472567, 8.014641974770818, 6.251632912237915]], [[6.411677800595937, 5.365937405245105, 8.70943859614565, 4.348757668525482], [7.827612569569748, 1.3718742546020972, 0.5252489627763138, 2.065015517785291], [4.620664668451086, 2.604569735623819, 5.548107842615733, 7.60342292447815]]]
1475
1442
 
1476
1443
  >>> print(regression.linear_regression(list(range(5)), [2, 4, 6, 7, 8]))
1477
1444
  >>> print(regression.parabolic_regression(list(range(5)), [2, 4, 6, 7, 8]))
@@ -19,7 +19,6 @@ pypynum/Tensor.py
19
19
  pypynum/Tree.py
20
20
  pypynum/Vector.py
21
21
  pypynum/__init__.py
22
- pypynum/__temporary.py
23
22
  pypynum/chars.py
24
23
  pypynum/cipher.py
25
24
  pypynum/constants.py
@@ -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 % len(sequence)]
201
+ return sequence[pointer % total]
199
202
  else:
200
203
  _array = []
201
204
  for i in range(_shape[0]):