passagemath-singular 10.6.31rc3__cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

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.

Potentially problematic release.


This version of passagemath-singular might be problematic. Click here for more details.

Files changed (491) hide show
  1. PySingular.cpython-314-x86_64-linux-gnu.so +0 -0
  2. passagemath_singular-10.6.31rc3.dist-info/METADATA +183 -0
  3. passagemath_singular-10.6.31rc3.dist-info/RECORD +491 -0
  4. passagemath_singular-10.6.31rc3.dist-info/WHEEL +6 -0
  5. passagemath_singular-10.6.31rc3.dist-info/top_level.txt +3 -0
  6. passagemath_singular.libs/libSingular-4-20aec911.4.1.so +0 -0
  7. passagemath_singular.libs/libcddgmp-21acf0c6.so.0.1.3 +0 -0
  8. passagemath_singular.libs/libfactory-4-fcee31da.4.1.so +0 -0
  9. passagemath_singular.libs/libflint-66e12231.so.21.0.0 +0 -0
  10. passagemath_singular.libs/libgf2x-a4cdec90.so.3.0.0 +0 -0
  11. passagemath_singular.libs/libgfortran-83c28eba.so.5.0.0 +0 -0
  12. passagemath_singular.libs/libgmp-6e109695.so.10.5.0 +0 -0
  13. passagemath_singular.libs/libgsl-cda90e79.so.28.0.0 +0 -0
  14. passagemath_singular.libs/libmpfr-82690d50.so.6.2.1 +0 -0
  15. passagemath_singular.libs/libntl-e6f0d543.so.44.0.1 +0 -0
  16. passagemath_singular.libs/libomalloc-0-5c9e866e.9.6.so +0 -0
  17. passagemath_singular.libs/libopenblasp-r0-6dcb67f9.3.29.so +0 -0
  18. passagemath_singular.libs/libpolys-4-5c0a87e0.4.1.so +0 -0
  19. passagemath_singular.libs/libquadmath-2284e583.so.0.0.0 +0 -0
  20. passagemath_singular.libs/libreadline-ea270e21.so.8.2 +0 -0
  21. passagemath_singular.libs/libsingular_resources-4-a1aafc6d.4.1.so +0 -0
  22. passagemath_singular.libs/libtinfo-ceb117d9.so.6.3 +0 -0
  23. sage/algebras/all__sagemath_singular.py +3 -0
  24. sage/algebras/fusion_rings/all.py +19 -0
  25. sage/algebras/fusion_rings/f_matrix.py +2448 -0
  26. sage/algebras/fusion_rings/fast_parallel_fmats_methods.cpython-314-x86_64-linux-gnu.so +0 -0
  27. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pxd +5 -0
  28. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pyx +538 -0
  29. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.cpython-314-x86_64-linux-gnu.so +0 -0
  30. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pxd +3 -0
  31. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pyx +331 -0
  32. sage/algebras/fusion_rings/fusion_double.py +899 -0
  33. sage/algebras/fusion_rings/fusion_ring.py +1580 -0
  34. sage/algebras/fusion_rings/poly_tup_engine.cpython-314-x86_64-linux-gnu.so +0 -0
  35. sage/algebras/fusion_rings/poly_tup_engine.pxd +24 -0
  36. sage/algebras/fusion_rings/poly_tup_engine.pyx +579 -0
  37. sage/algebras/fusion_rings/shm_managers.cpython-314-x86_64-linux-gnu.so +0 -0
  38. sage/algebras/fusion_rings/shm_managers.pxd +24 -0
  39. sage/algebras/fusion_rings/shm_managers.pyx +780 -0
  40. sage/algebras/letterplace/all.py +1 -0
  41. sage/algebras/letterplace/free_algebra_element_letterplace.cpython-314-x86_64-linux-gnu.so +0 -0
  42. sage/algebras/letterplace/free_algebra_element_letterplace.pxd +18 -0
  43. sage/algebras/letterplace/free_algebra_element_letterplace.pyx +755 -0
  44. sage/algebras/letterplace/free_algebra_letterplace.cpython-314-x86_64-linux-gnu.so +0 -0
  45. sage/algebras/letterplace/free_algebra_letterplace.pxd +35 -0
  46. sage/algebras/letterplace/free_algebra_letterplace.pyx +914 -0
  47. sage/algebras/letterplace/letterplace_ideal.cpython-314-x86_64-linux-gnu.so +0 -0
  48. sage/algebras/letterplace/letterplace_ideal.pyx +408 -0
  49. sage/algebras/quatalg/all.py +2 -0
  50. sage/algebras/quatalg/quaternion_algebra.py +4778 -0
  51. sage/algebras/quatalg/quaternion_algebra_cython.cpython-314-x86_64-linux-gnu.so +0 -0
  52. sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
  53. sage/algebras/quatalg/quaternion_algebra_element.cpython-314-x86_64-linux-gnu.so +0 -0
  54. sage/algebras/quatalg/quaternion_algebra_element.pxd +29 -0
  55. sage/algebras/quatalg/quaternion_algebra_element.pyx +2176 -0
  56. sage/all__sagemath_singular.py +11 -0
  57. sage/ext_data/all__sagemath_singular.py +1 -0
  58. sage/ext_data/singular/function_field/core.lib +98 -0
  59. sage/interfaces/all__sagemath_singular.py +1 -0
  60. sage/interfaces/singular.py +2835 -0
  61. sage/libs/all__sagemath_singular.py +1 -0
  62. sage/libs/singular/__init__.py +1 -0
  63. sage/libs/singular/decl.pxd +1168 -0
  64. sage/libs/singular/function.cpython-314-x86_64-linux-gnu.so +0 -0
  65. sage/libs/singular/function.pxd +87 -0
  66. sage/libs/singular/function.pyx +1901 -0
  67. sage/libs/singular/function_factory.py +61 -0
  68. sage/libs/singular/groebner_strategy.cpython-314-x86_64-linux-gnu.so +0 -0
  69. sage/libs/singular/groebner_strategy.pxd +22 -0
  70. sage/libs/singular/groebner_strategy.pyx +582 -0
  71. sage/libs/singular/option.cpython-314-x86_64-linux-gnu.so +0 -0
  72. sage/libs/singular/option.pyx +671 -0
  73. sage/libs/singular/polynomial.cpython-314-x86_64-linux-gnu.so +0 -0
  74. sage/libs/singular/polynomial.pxd +39 -0
  75. sage/libs/singular/polynomial.pyx +661 -0
  76. sage/libs/singular/ring.cpython-314-x86_64-linux-gnu.so +0 -0
  77. sage/libs/singular/ring.pxd +58 -0
  78. sage/libs/singular/ring.pyx +893 -0
  79. sage/libs/singular/singular.cpython-314-x86_64-linux-gnu.so +0 -0
  80. sage/libs/singular/singular.pxd +72 -0
  81. sage/libs/singular/singular.pyx +1944 -0
  82. sage/libs/singular/standard_options.py +145 -0
  83. sage/matrix/all__sagemath_singular.py +1 -0
  84. sage/matrix/matrix_mpolynomial_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  85. sage/matrix/matrix_mpolynomial_dense.pxd +7 -0
  86. sage/matrix/matrix_mpolynomial_dense.pyx +615 -0
  87. sage/rings/all__sagemath_singular.py +1 -0
  88. sage/rings/function_field/all__sagemath_singular.py +1 -0
  89. sage/rings/function_field/derivations_polymod.py +911 -0
  90. sage/rings/function_field/element_polymod.cpython-314-x86_64-linux-gnu.so +0 -0
  91. sage/rings/function_field/element_polymod.pyx +406 -0
  92. sage/rings/function_field/function_field_polymod.py +2611 -0
  93. sage/rings/function_field/ideal_polymod.py +1775 -0
  94. sage/rings/function_field/order_polymod.py +1475 -0
  95. sage/rings/function_field/place_polymod.py +681 -0
  96. sage/rings/polynomial/all__sagemath_singular.py +1 -0
  97. sage/rings/polynomial/multi_polynomial_ideal_libsingular.cpython-314-x86_64-linux-gnu.so +0 -0
  98. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pxd +5 -0
  99. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx +339 -0
  100. sage/rings/polynomial/multi_polynomial_libsingular.cpython-314-x86_64-linux-gnu.so +0 -0
  101. sage/rings/polynomial/multi_polynomial_libsingular.pxd +30 -0
  102. sage/rings/polynomial/multi_polynomial_libsingular.pyx +6277 -0
  103. sage/rings/polynomial/plural.cpython-314-x86_64-linux-gnu.so +0 -0
  104. sage/rings/polynomial/plural.pxd +48 -0
  105. sage/rings/polynomial/plural.pyx +3171 -0
  106. sage/symbolic/all__sagemath_singular.py +1 -0
  107. sage/symbolic/comparison_impl.pxi +428 -0
  108. sage/symbolic/constants_c_impl.pxi +178 -0
  109. sage/symbolic/expression.cpython-314-x86_64-linux-gnu.so +0 -0
  110. sage/symbolic/expression.pxd +7 -0
  111. sage/symbolic/expression.pyx +14200 -0
  112. sage/symbolic/getitem_impl.pxi +202 -0
  113. sage/symbolic/pynac.pxi +572 -0
  114. sage/symbolic/pynac_constant_impl.pxi +133 -0
  115. sage/symbolic/pynac_function_impl.pxi +206 -0
  116. sage/symbolic/pynac_impl.pxi +2576 -0
  117. sage/symbolic/pynac_wrap.h +124 -0
  118. sage/symbolic/series_impl.pxi +272 -0
  119. sage/symbolic/substitution_map_impl.pxi +94 -0
  120. sage_wheels/bin/ESingular +0 -0
  121. sage_wheels/bin/Singular +0 -0
  122. sage_wheels/bin/TSingular +0 -0
  123. sage_wheels/lib/singular/MOD/cohomo.la +41 -0
  124. sage_wheels/lib/singular/MOD/cohomo.so +0 -0
  125. sage_wheels/lib/singular/MOD/customstd.la +41 -0
  126. sage_wheels/lib/singular/MOD/customstd.so +0 -0
  127. sage_wheels/lib/singular/MOD/freealgebra.la +41 -0
  128. sage_wheels/lib/singular/MOD/freealgebra.so +0 -0
  129. sage_wheels/lib/singular/MOD/gfanlib.la +41 -0
  130. sage_wheels/lib/singular/MOD/gfanlib.so +0 -0
  131. sage_wheels/lib/singular/MOD/gitfan.la +41 -0
  132. sage_wheels/lib/singular/MOD/gitfan.so +0 -0
  133. sage_wheels/lib/singular/MOD/interval.la +41 -0
  134. sage_wheels/lib/singular/MOD/interval.so +0 -0
  135. sage_wheels/lib/singular/MOD/loctriv.la +41 -0
  136. sage_wheels/lib/singular/MOD/loctriv.so +0 -0
  137. sage_wheels/lib/singular/MOD/machinelearning.la +41 -0
  138. sage_wheels/lib/singular/MOD/machinelearning.so +0 -0
  139. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.la +41 -0
  140. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.so +0 -0
  141. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.la +41 -0
  142. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.so +0 -0
  143. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.la +41 -0
  144. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.so +0 -0
  145. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.la +41 -0
  146. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.so +0 -0
  147. sage_wheels/lib/singular/MOD/partialgb.la +41 -0
  148. sage_wheels/lib/singular/MOD/partialgb.so +0 -0
  149. sage_wheels/lib/singular/MOD/pyobject.la +41 -0
  150. sage_wheels/lib/singular/MOD/pyobject.so +0 -0
  151. sage_wheels/lib/singular/MOD/singmathic.la +41 -0
  152. sage_wheels/lib/singular/MOD/singmathic.so +0 -0
  153. sage_wheels/lib/singular/MOD/sispasm.la +41 -0
  154. sage_wheels/lib/singular/MOD/sispasm.so +0 -0
  155. sage_wheels/lib/singular/MOD/subsets.la +41 -0
  156. sage_wheels/lib/singular/MOD/subsets.so +0 -0
  157. sage_wheels/lib/singular/MOD/systhreads.la +41 -0
  158. sage_wheels/lib/singular/MOD/systhreads.so +0 -0
  159. sage_wheels/lib/singular/MOD/syzextra.la +41 -0
  160. sage_wheels/lib/singular/MOD/syzextra.so +0 -0
  161. sage_wheels/libexec/singular/MOD/change_cost +0 -0
  162. sage_wheels/libexec/singular/MOD/singularsurf +11 -0
  163. sage_wheels/libexec/singular/MOD/singularsurf_jupyter +9 -0
  164. sage_wheels/libexec/singular/MOD/singularsurf_win +10 -0
  165. sage_wheels/libexec/singular/MOD/solve_IP +0 -0
  166. sage_wheels/libexec/singular/MOD/surfex +16 -0
  167. sage_wheels/libexec/singular/MOD/toric_ideal +0 -0
  168. sage_wheels/share/factory/gftables/10201 +342 -0
  169. sage_wheels/share/factory/gftables/1024 +37 -0
  170. sage_wheels/share/factory/gftables/10609 +356 -0
  171. sage_wheels/share/factory/gftables/11449 +384 -0
  172. sage_wheels/share/factory/gftables/11881 +398 -0
  173. sage_wheels/share/factory/gftables/121 +6 -0
  174. sage_wheels/share/factory/gftables/12167 +408 -0
  175. sage_wheels/share/factory/gftables/125 +7 -0
  176. sage_wheels/share/factory/gftables/12769 +428 -0
  177. sage_wheels/share/factory/gftables/128 +7 -0
  178. sage_wheels/share/factory/gftables/1331 +47 -0
  179. sage_wheels/share/factory/gftables/1369 +48 -0
  180. sage_wheels/share/factory/gftables/14641 +490 -0
  181. sage_wheels/share/factory/gftables/15625 +523 -0
  182. sage_wheels/share/factory/gftables/16 +3 -0
  183. sage_wheels/share/factory/gftables/16129 +540 -0
  184. sage_wheels/share/factory/gftables/16384 +549 -0
  185. sage_wheels/share/factory/gftables/16807 +563 -0
  186. sage_wheels/share/factory/gftables/1681 +58 -0
  187. sage_wheels/share/factory/gftables/169 +8 -0
  188. sage_wheels/share/factory/gftables/17161 +574 -0
  189. sage_wheels/share/factory/gftables/1849 +64 -0
  190. sage_wheels/share/factory/gftables/18769 +628 -0
  191. sage_wheels/share/factory/gftables/19321 +646 -0
  192. sage_wheels/share/factory/gftables/19683 +659 -0
  193. sage_wheels/share/factory/gftables/2048 +71 -0
  194. sage_wheels/share/factory/gftables/2187 +75 -0
  195. sage_wheels/share/factory/gftables/2197 +76 -0
  196. sage_wheels/share/factory/gftables/2209 +76 -0
  197. sage_wheels/share/factory/gftables/22201 +742 -0
  198. sage_wheels/share/factory/gftables/22801 +762 -0
  199. sage_wheels/share/factory/gftables/2401 +82 -0
  200. sage_wheels/share/factory/gftables/243 +11 -0
  201. sage_wheels/share/factory/gftables/24389 +815 -0
  202. sage_wheels/share/factory/gftables/24649 +824 -0
  203. sage_wheels/share/factory/gftables/25 +3 -0
  204. sage_wheels/share/factory/gftables/256 +11 -0
  205. sage_wheels/share/factory/gftables/26569 +888 -0
  206. sage_wheels/share/factory/gftables/27 +3 -0
  207. sage_wheels/share/factory/gftables/27889 +932 -0
  208. sage_wheels/share/factory/gftables/2809 +96 -0
  209. sage_wheels/share/factory/gftables/28561 +954 -0
  210. sage_wheels/share/factory/gftables/289 +12 -0
  211. sage_wheels/share/factory/gftables/29791 +995 -0
  212. sage_wheels/share/factory/gftables/29929 +1000 -0
  213. sage_wheels/share/factory/gftables/3125 +107 -0
  214. sage_wheels/share/factory/gftables/32 +4 -0
  215. sage_wheels/share/factory/gftables/32041 +1070 -0
  216. sage_wheels/share/factory/gftables/32761 +1094 -0
  217. sage_wheels/share/factory/gftables/32768 +1095 -0
  218. sage_wheels/share/factory/gftables/343 +14 -0
  219. sage_wheels/share/factory/gftables/3481 +118 -0
  220. sage_wheels/share/factory/gftables/361 +14 -0
  221. sage_wheels/share/factory/gftables/36481 +1218 -0
  222. sage_wheels/share/factory/gftables/3721 +126 -0
  223. sage_wheels/share/factory/gftables/37249 +1244 -0
  224. sage_wheels/share/factory/gftables/38809 +1296 -0
  225. sage_wheels/share/factory/gftables/39601 +1322 -0
  226. sage_wheels/share/factory/gftables/4 +3 -0
  227. sage_wheels/share/factory/gftables/4096 +139 -0
  228. sage_wheels/share/factory/gftables/44521 +1486 -0
  229. sage_wheels/share/factory/gftables/4489 +152 -0
  230. sage_wheels/share/factory/gftables/49 +4 -0
  231. sage_wheels/share/factory/gftables/4913 +166 -0
  232. sage_wheels/share/factory/gftables/49729 +1660 -0
  233. sage_wheels/share/factory/gftables/5041 +170 -0
  234. sage_wheels/share/factory/gftables/50653 +1691 -0
  235. sage_wheels/share/factory/gftables/512 +20 -0
  236. sage_wheels/share/factory/gftables/51529 +1720 -0
  237. sage_wheels/share/factory/gftables/52441 +1750 -0
  238. sage_wheels/share/factory/gftables/529 +20 -0
  239. sage_wheels/share/factory/gftables/5329 +180 -0
  240. sage_wheels/share/factory/gftables/54289 +1812 -0
  241. sage_wheels/share/factory/gftables/57121 +1906 -0
  242. sage_wheels/share/factory/gftables/58081 +1938 -0
  243. sage_wheels/share/factory/gftables/59049 +1971 -0
  244. sage_wheels/share/factory/gftables/6241 +210 -0
  245. sage_wheels/share/factory/gftables/625 +23 -0
  246. sage_wheels/share/factory/gftables/63001 +2102 -0
  247. sage_wheels/share/factory/gftables/64 +5 -0
  248. sage_wheels/share/factory/gftables/6561 +221 -0
  249. sage_wheels/share/factory/gftables/6859 +231 -0
  250. sage_wheels/share/factory/gftables/6889 +232 -0
  251. sage_wheels/share/factory/gftables/729 +27 -0
  252. sage_wheels/share/factory/gftables/7921 +266 -0
  253. sage_wheels/share/factory/gftables/8 +3 -0
  254. sage_wheels/share/factory/gftables/81 +5 -0
  255. sage_wheels/share/factory/gftables/8192 +276 -0
  256. sage_wheels/share/factory/gftables/841 +30 -0
  257. sage_wheels/share/factory/gftables/9 +3 -0
  258. sage_wheels/share/factory/gftables/9409 +316 -0
  259. sage_wheels/share/factory/gftables/961 +34 -0
  260. sage_wheels/share/info/singular.info +191898 -0
  261. sage_wheels/share/singular/LIB/GND.lib +1359 -0
  262. sage_wheels/share/singular/LIB/JMBTest.lib +976 -0
  263. sage_wheels/share/singular/LIB/JMSConst.lib +1363 -0
  264. sage_wheels/share/singular/LIB/KVequiv.lib +699 -0
  265. sage_wheels/share/singular/LIB/SingularityDBM.lib +491 -0
  266. sage_wheels/share/singular/LIB/VecField.lib +1542 -0
  267. sage_wheels/share/singular/LIB/absfact.lib +959 -0
  268. sage_wheels/share/singular/LIB/ainvar.lib +730 -0
  269. sage_wheels/share/singular/LIB/aksaka.lib +419 -0
  270. sage_wheels/share/singular/LIB/alexpoly.lib +2542 -0
  271. sage_wheels/share/singular/LIB/algebra.lib +1193 -0
  272. sage_wheels/share/singular/LIB/all.lib +136 -0
  273. sage_wheels/share/singular/LIB/arcpoint.lib +514 -0
  274. sage_wheels/share/singular/LIB/arnold.lib +4553 -0
  275. sage_wheels/share/singular/LIB/arnoldclassify.lib +2058 -0
  276. sage_wheels/share/singular/LIB/arr.lib +3486 -0
  277. sage_wheels/share/singular/LIB/assprimeszerodim.lib +755 -0
  278. sage_wheels/share/singular/LIB/autgradalg.lib +3361 -0
  279. sage_wheels/share/singular/LIB/bfun.lib +1964 -0
  280. sage_wheels/share/singular/LIB/bimodules.lib +774 -0
  281. sage_wheels/share/singular/LIB/brillnoether.lib +226 -0
  282. sage_wheels/share/singular/LIB/brnoeth.lib +5017 -0
  283. sage_wheels/share/singular/LIB/central.lib +2169 -0
  284. sage_wheels/share/singular/LIB/chern.lib +4162 -0
  285. sage_wheels/share/singular/LIB/cimonom.lib +571 -0
  286. sage_wheels/share/singular/LIB/cisimplicial.lib +1835 -0
  287. sage_wheels/share/singular/LIB/classify.lib +3239 -0
  288. sage_wheels/share/singular/LIB/classify2.lib +1462 -0
  289. sage_wheels/share/singular/LIB/classifyMapGerms.lib +1515 -0
  290. sage_wheels/share/singular/LIB/classify_aeq.lib +3253 -0
  291. sage_wheels/share/singular/LIB/classifyceq.lib +2092 -0
  292. sage_wheels/share/singular/LIB/classifyci.lib +1133 -0
  293. sage_wheels/share/singular/LIB/combinat.lib +91 -0
  294. sage_wheels/share/singular/LIB/compregb.lib +276 -0
  295. sage_wheels/share/singular/LIB/control.lib +1636 -0
  296. sage_wheels/share/singular/LIB/crypto.lib +3795 -0
  297. sage_wheels/share/singular/LIB/curveInv.lib +667 -0
  298. sage_wheels/share/singular/LIB/curvepar.lib +1817 -0
  299. sage_wheels/share/singular/LIB/customstd.lib +100 -0
  300. sage_wheels/share/singular/LIB/deRham.lib +5979 -0
  301. sage_wheels/share/singular/LIB/decodegb.lib +2134 -0
  302. sage_wheels/share/singular/LIB/decomp.lib +1655 -0
  303. sage_wheels/share/singular/LIB/deflation.lib +872 -0
  304. sage_wheels/share/singular/LIB/deform.lib +925 -0
  305. sage_wheels/share/singular/LIB/difform.lib +3055 -0
  306. sage_wheels/share/singular/LIB/divisors.lib +750 -0
  307. sage_wheels/share/singular/LIB/dmod.lib +5817 -0
  308. sage_wheels/share/singular/LIB/dmodapp.lib +3269 -0
  309. sage_wheels/share/singular/LIB/dmodideal.lib +1211 -0
  310. sage_wheels/share/singular/LIB/dmodloc.lib +2645 -0
  311. sage_wheels/share/singular/LIB/dmodvar.lib +818 -0
  312. sage_wheels/share/singular/LIB/dummy.lib +17 -0
  313. sage_wheels/share/singular/LIB/elim.lib +1009 -0
  314. sage_wheels/share/singular/LIB/ellipticcovers.lib +548 -0
  315. sage_wheels/share/singular/LIB/enumpoints.lib +146 -0
  316. sage_wheels/share/singular/LIB/equising.lib +2127 -0
  317. sage_wheels/share/singular/LIB/ffmodstd.lib +2384 -0
  318. sage_wheels/share/singular/LIB/ffsolve.lib +1289 -0
  319. sage_wheels/share/singular/LIB/findifs.lib +778 -0
  320. sage_wheels/share/singular/LIB/finitediff.lib +1768 -0
  321. sage_wheels/share/singular/LIB/finvar.lib +7989 -0
  322. sage_wheels/share/singular/LIB/fpadim.lib +2429 -0
  323. sage_wheels/share/singular/LIB/fpalgebras.lib +1666 -0
  324. sage_wheels/share/singular/LIB/fpaprops.lib +1462 -0
  325. sage_wheels/share/singular/LIB/freegb.lib +3853 -0
  326. sage_wheels/share/singular/LIB/general.lib +1350 -0
  327. sage_wheels/share/singular/LIB/gfan.lib +1768 -0
  328. sage_wheels/share/singular/LIB/gitfan.lib +3130 -0
  329. sage_wheels/share/singular/LIB/gkdim.lib +99 -0
  330. sage_wheels/share/singular/LIB/gmspoly.lib +589 -0
  331. sage_wheels/share/singular/LIB/gmssing.lib +1739 -0
  332. sage_wheels/share/singular/LIB/goettsche.lib +909 -0
  333. sage_wheels/share/singular/LIB/graal.lib +1366 -0
  334. sage_wheels/share/singular/LIB/gradedModules.lib +2541 -0
  335. sage_wheels/share/singular/LIB/graphics.lib +360 -0
  336. sage_wheels/share/singular/LIB/grobcov.lib +7706 -0
  337. sage_wheels/share/singular/LIB/groups.lib +1123 -0
  338. sage_wheels/share/singular/LIB/grwalk.lib +507 -0
  339. sage_wheels/share/singular/LIB/hdepth.lib +194 -0
  340. sage_wheels/share/singular/LIB/help.cnf +57 -0
  341. sage_wheels/share/singular/LIB/hess.lib +1946 -0
  342. sage_wheels/share/singular/LIB/hnoether.lib +4292 -0
  343. sage_wheels/share/singular/LIB/hodge.lib +400 -0
  344. sage_wheels/share/singular/LIB/homolog.lib +1965 -0
  345. sage_wheels/share/singular/LIB/hyperel.lib +975 -0
  346. sage_wheels/share/singular/LIB/inout.lib +679 -0
  347. sage_wheels/share/singular/LIB/integralbasis.lib +6224 -0
  348. sage_wheels/share/singular/LIB/interval.lib +1418 -0
  349. sage_wheels/share/singular/LIB/intprog.lib +778 -0
  350. sage_wheels/share/singular/LIB/invar.lib +443 -0
  351. sage_wheels/share/singular/LIB/involut.lib +980 -0
  352. sage_wheels/share/singular/LIB/jacobson.lib +1215 -0
  353. sage_wheels/share/singular/LIB/kskernel.lib +534 -0
  354. sage_wheels/share/singular/LIB/latex.lib +3146 -0
  355. sage_wheels/share/singular/LIB/lejeune.lib +651 -0
  356. sage_wheels/share/singular/LIB/linalg.lib +2040 -0
  357. sage_wheels/share/singular/LIB/locnormal.lib +212 -0
  358. sage_wheels/share/singular/LIB/lrcalc.lib +526 -0
  359. sage_wheels/share/singular/LIB/makedbm.lib +294 -0
  360. sage_wheels/share/singular/LIB/mathml.lib +813 -0
  361. sage_wheels/share/singular/LIB/matrix.lib +1372 -0
  362. sage_wheels/share/singular/LIB/maxlike.lib +1132 -0
  363. sage_wheels/share/singular/LIB/methods.lib +212 -0
  364. sage_wheels/share/singular/LIB/moddiq.lib +322 -0
  365. sage_wheels/share/singular/LIB/modfinduni.lib +181 -0
  366. sage_wheels/share/singular/LIB/modnormal.lib +218 -0
  367. sage_wheels/share/singular/LIB/modprimdec.lib +1278 -0
  368. sage_wheels/share/singular/LIB/modquotient.lib +269 -0
  369. sage_wheels/share/singular/LIB/modstd.lib +1024 -0
  370. sage_wheels/share/singular/LIB/modular.lib +545 -0
  371. sage_wheels/share/singular/LIB/modules.lib +2561 -0
  372. sage_wheels/share/singular/LIB/modwalk.lib +609 -0
  373. sage_wheels/share/singular/LIB/mondromy.lib +1016 -0
  374. sage_wheels/share/singular/LIB/monomialideal.lib +3851 -0
  375. sage_wheels/share/singular/LIB/mprimdec.lib +2353 -0
  376. sage_wheels/share/singular/LIB/mregular.lib +1863 -0
  377. sage_wheels/share/singular/LIB/multigrading.lib +5629 -0
  378. sage_wheels/share/singular/LIB/ncHilb.lib +777 -0
  379. sage_wheels/share/singular/LIB/ncModslimgb.lib +791 -0
  380. sage_wheels/share/singular/LIB/ncalg.lib +16311 -0
  381. sage_wheels/share/singular/LIB/ncall.lib +31 -0
  382. sage_wheels/share/singular/LIB/ncdecomp.lib +468 -0
  383. sage_wheels/share/singular/LIB/ncfactor.lib +13371 -0
  384. sage_wheels/share/singular/LIB/ncfrac.lib +1023 -0
  385. sage_wheels/share/singular/LIB/nchilbert.lib +448 -0
  386. sage_wheels/share/singular/LIB/nchomolog.lib +759 -0
  387. sage_wheels/share/singular/LIB/ncloc.lib +361 -0
  388. sage_wheels/share/singular/LIB/ncpreim.lib +795 -0
  389. sage_wheels/share/singular/LIB/ncrat.lib +2849 -0
  390. sage_wheels/share/singular/LIB/nctools.lib +1887 -0
  391. sage_wheels/share/singular/LIB/nets.lib +1456 -0
  392. sage_wheels/share/singular/LIB/nfmodstd.lib +1000 -0
  393. sage_wheels/share/singular/LIB/nfmodsyz.lib +732 -0
  394. sage_wheels/share/singular/LIB/noether.lib +1106 -0
  395. sage_wheels/share/singular/LIB/normal.lib +8700 -0
  396. sage_wheels/share/singular/LIB/normaliz.lib +2226 -0
  397. sage_wheels/share/singular/LIB/ntsolve.lib +362 -0
  398. sage_wheels/share/singular/LIB/numerAlg.lib +560 -0
  399. sage_wheels/share/singular/LIB/numerDecom.lib +2261 -0
  400. sage_wheels/share/singular/LIB/olga.lib +1933 -0
  401. sage_wheels/share/singular/LIB/orbitparam.lib +351 -0
  402. sage_wheels/share/singular/LIB/parallel.lib +319 -0
  403. sage_wheels/share/singular/LIB/paraplanecurves.lib +3110 -0
  404. sage_wheels/share/singular/LIB/perron.lib +202 -0
  405. sage_wheels/share/singular/LIB/pfd.lib +2223 -0
  406. sage_wheels/share/singular/LIB/phindex.lib +642 -0
  407. sage_wheels/share/singular/LIB/pointid.lib +673 -0
  408. sage_wheels/share/singular/LIB/polybori.lib +1430 -0
  409. sage_wheels/share/singular/LIB/polyclass.lib +525 -0
  410. sage_wheels/share/singular/LIB/polylib.lib +1174 -0
  411. sage_wheels/share/singular/LIB/polymake.lib +1902 -0
  412. sage_wheels/share/singular/LIB/presolve.lib +1533 -0
  413. sage_wheels/share/singular/LIB/primdec.lib +9576 -0
  414. sage_wheels/share/singular/LIB/primdecint.lib +1782 -0
  415. sage_wheels/share/singular/LIB/primitiv.lib +401 -0
  416. sage_wheels/share/singular/LIB/puiseuxexpansions.lib +1631 -0
  417. sage_wheels/share/singular/LIB/purityfiltration.lib +960 -0
  418. sage_wheels/share/singular/LIB/qhmoduli.lib +1561 -0
  419. sage_wheels/share/singular/LIB/qmatrix.lib +293 -0
  420. sage_wheels/share/singular/LIB/random.lib +455 -0
  421. sage_wheels/share/singular/LIB/ratgb.lib +489 -0
  422. sage_wheels/share/singular/LIB/realclassify.lib +5759 -0
  423. sage_wheels/share/singular/LIB/realizationMatroids.lib +772 -0
  424. sage_wheels/share/singular/LIB/realrad.lib +1197 -0
  425. sage_wheels/share/singular/LIB/recover.lib +2628 -0
  426. sage_wheels/share/singular/LIB/redcgs.lib +3984 -0
  427. sage_wheels/share/singular/LIB/reesclos.lib +465 -0
  428. sage_wheels/share/singular/LIB/resbinomial.lib +2802 -0
  429. sage_wheels/share/singular/LIB/resgraph.lib +789 -0
  430. sage_wheels/share/singular/LIB/resjung.lib +820 -0
  431. sage_wheels/share/singular/LIB/resolve.lib +5110 -0
  432. sage_wheels/share/singular/LIB/resources.lib +170 -0
  433. sage_wheels/share/singular/LIB/reszeta.lib +5473 -0
  434. sage_wheels/share/singular/LIB/ring.lib +1328 -0
  435. sage_wheels/share/singular/LIB/ringgb.lib +343 -0
  436. sage_wheels/share/singular/LIB/rinvar.lib +1153 -0
  437. sage_wheels/share/singular/LIB/rootisolation.lib +1481 -0
  438. sage_wheels/share/singular/LIB/rootsmr.lib +709 -0
  439. sage_wheels/share/singular/LIB/rootsur.lib +886 -0
  440. sage_wheels/share/singular/LIB/rstandard.lib +607 -0
  441. sage_wheels/share/singular/LIB/rwalk.lib +336 -0
  442. sage_wheels/share/singular/LIB/sagbi.lib +1353 -0
  443. sage_wheels/share/singular/LIB/sagbiNormaliz.lib +1622 -0
  444. sage_wheels/share/singular/LIB/sagbiNormaliz0.lib +1498 -0
  445. sage_wheels/share/singular/LIB/sagbigrob.lib +449 -0
  446. sage_wheels/share/singular/LIB/schreyer.lib +321 -0
  447. sage_wheels/share/singular/LIB/schubert.lib +2551 -0
  448. sage_wheels/share/singular/LIB/sets.lib +524 -0
  449. sage_wheels/share/singular/LIB/sheafcoh.lib +1663 -0
  450. sage_wheels/share/singular/LIB/signcond.lib +437 -0
  451. sage_wheels/share/singular/LIB/sing.lib +1094 -0
  452. sage_wheels/share/singular/LIB/sing4ti2.lib +419 -0
  453. sage_wheels/share/singular/LIB/solve.lib +2243 -0
  454. sage_wheels/share/singular/LIB/spcurve.lib +1077 -0
  455. sage_wheels/share/singular/LIB/spectrum.lib +62 -0
  456. sage_wheels/share/singular/LIB/sresext.lib +757 -0
  457. sage_wheels/share/singular/LIB/ssi.lib +143 -0
  458. sage_wheels/share/singular/LIB/standard.lib +2769 -0
  459. sage_wheels/share/singular/LIB/stanleyreisner.lib +473 -0
  460. sage_wheels/share/singular/LIB/stdmodule.lib +547 -0
  461. sage_wheels/share/singular/LIB/stratify.lib +1070 -0
  462. sage_wheels/share/singular/LIB/surf.lib +506 -0
  463. sage_wheels/share/singular/LIB/surf_jupyter.lib +223 -0
  464. sage_wheels/share/singular/LIB/surfacesignature.lib +522 -0
  465. sage_wheels/share/singular/LIB/surfex.lib +1462 -0
  466. sage_wheels/share/singular/LIB/swalk.lib +877 -0
  467. sage_wheels/share/singular/LIB/symodstd.lib +1570 -0
  468. sage_wheels/share/singular/LIB/systhreads.lib +74 -0
  469. sage_wheels/share/singular/LIB/tasks.lib +1324 -0
  470. sage_wheels/share/singular/LIB/tateProdCplxNegGrad.lib +2412 -0
  471. sage_wheels/share/singular/LIB/teachstd.lib +858 -0
  472. sage_wheels/share/singular/LIB/template.lib +116 -0
  473. sage_wheels/share/singular/LIB/toric.lib +1119 -0
  474. sage_wheels/share/singular/LIB/transformation.lib +116 -0
  475. sage_wheels/share/singular/LIB/triang.lib +1197 -0
  476. sage_wheels/share/singular/LIB/tropical.lib +8741 -0
  477. sage_wheels/share/singular/LIB/tropicalEllipticCovers.lib +2922 -0
  478. sage_wheels/share/singular/LIB/tropicalNewton.lib +1128 -0
  479. sage_wheels/share/singular/LIB/tst.lib +1108 -0
  480. sage_wheels/share/singular/LIB/weierstr.lib +241 -0
  481. sage_wheels/share/singular/LIB/zeroset.lib +1478 -0
  482. sage_wheels/share/singular/emacs/.emacs-general +184 -0
  483. sage_wheels/share/singular/emacs/.emacs-singular +234 -0
  484. sage_wheels/share/singular/emacs/COPYING +44 -0
  485. sage_wheels/share/singular/emacs/cmd-cmpl.el +241 -0
  486. sage_wheels/share/singular/emacs/ex-cmpl.el +1681 -0
  487. sage_wheels/share/singular/emacs/hlp-cmpl.el +4318 -0
  488. sage_wheels/share/singular/emacs/lib-cmpl.el +179 -0
  489. sage_wheels/share/singular/emacs/singular.el +4273 -0
  490. sage_wheels/share/singular/emacs/singular.xpm +39 -0
  491. sage_wheels/share/singular/singular.idx +5002 -0
@@ -0,0 +1,1418 @@
1
+ ///////////////////////////////////////////////////////////////////
2
+ version="version interval.lib 4.2.0.1 Dec_2020 ";
3
+ info="
4
+ LIBRARY: interval.lib implements interval arithmetic on polynomials
5
+ AUTHORS: Dominik Bendle
6
+ Clara Petroll
7
+
8
+ OVERLOADS:
9
+ // intervals
10
+ [ intervalGet indexing
11
+ = intervalAssign assigning
12
+ == intervalEqual equality
13
+ print intervalPrint pretty print
14
+ + intervalAdd addition
15
+ - intervalNegate negation (unary)
16
+ - intervalSubtract subtraction
17
+ * intervalMultiply multiplication
18
+ / intervalDivide division
19
+ ^ intervalPotentiate potentiation
20
+
21
+ // boxes
22
+ = boxSet assigning
23
+ [ boxGet indexing
24
+ == boxEqual equality
25
+ print boxPrint printing
26
+ - boxSubtract subtraction
27
+ intersect boxIntersect intersection
28
+
29
+ // intervalmatrices
30
+ [ ivmatGet indexing
31
+ print ivmatPrint printing
32
+ nrows ivmatNrows number of rows
33
+ ncols ivmatNcols number of columns
34
+ det determinant determinant
35
+ * ivmatMultiply matrix multiplication
36
+
37
+ PROCEDURES:
38
+ length2() length/size if interval
39
+ bounds2() construct interval for given bounds.
40
+
41
+ intervalmatrixInit() initialises an interval matrix
42
+ unitMatrix2() unit matrix
43
+ applyMatrix() apply matrix to box
44
+ ivmatGaussian2() Gaussian elimination on matrices
45
+
46
+ evalPolyAtBox2() evaluate interval extension of polynomial
47
+ exclusionTest() first version of our exclusion test
48
+
49
+ SEE ALSO: rootisolation_lib
50
+ ";
51
+ ///////////////////////////////////////////////////////////////////
52
+
53
+ static proc mod_init()
54
+ {
55
+ newstruct("interval", "list l");
56
+ system("install", "interval", "[", intervalGet, 2);
57
+ system("install", "interval", "=", intervalAssign, 1);
58
+ system("install", "interval", "==", intervalEqual, 2);
59
+ system("install", "interval", "string", intervalString, 1);
60
+ system("install", "interval", "print", intervalPrint, 1);
61
+ system("install", "interval", "+", intervalAdd, 2);
62
+ system("install", "interval", "-", intervalNegate, 1);
63
+ system("install", "interval", "-", intervalSubtract, 2);
64
+ system("install", "interval", "*", intervalMultiply, 2);
65
+ system("install", "interval", "/", intervalDivide, 2);
66
+ system("install", "interval", "^", intervalPotentiate, 2);
67
+
68
+ newstruct("box", "list intervals");
69
+ system("install", "box", "=", boxAssign, 1);
70
+ system("install", "box", "[", boxGet, 2);
71
+ system("install", "box", "==", boxEqual, 2);
72
+ system("install", "box", "print", boxPrint, 1);
73
+ system("install", "box", "-", boxSubtract, 2);
74
+ system("install", "box", "intersect", boxIntersect, 4);
75
+
76
+ newstruct("ivmat", "list rows");
77
+ system("install", "ivmat", "print", ivmatPrint, 1);
78
+ system("install", "ivmat", "[", ivmatGet, 2);
79
+ system("install", "ivmat", "nrows", ivmatNrows, 1);
80
+ system("install", "ivmat", "ncols", ivmatNcols, 1);
81
+ system("install", "ivmat", "det", determinant, 1);
82
+ system("install", "ivmat", "*", ivmatMultiplyGeneral, 2);
83
+ }
84
+
85
+ ///////////////////////////////////////////////////////////////////
86
+
87
+ // INTERVAL FUNCTIONS
88
+
89
+ proc bounds2(number a, number b)
90
+ "USAGE: bounds2(a, b), a, b number
91
+ RETURN: interval [a, b]."
92
+ {
93
+ // depends on implementation (TODO)
94
+ interval OUT;
95
+ // bounds need not be supplied in order
96
+ if (a < b) {
97
+ OUT.l = list(a, b);
98
+ } else {
99
+ OUT.l = list(b, a);
100
+ }
101
+
102
+ return(OUT);
103
+ }
104
+
105
+ proc intervalAssign(def input)
106
+ "USAGE: I = input, input number, int, ...
107
+ RETURN: interval I
108
+ EXAMPLE: assigning intervals with ="
109
+ {
110
+ if(typeof(input) == "number") { return(bounds2(input, input)); }
111
+ if(typeof(input) == "int" ) { return(intervalAssign(number(input))); }
112
+
113
+ ERROR("input not supported.");
114
+ }
115
+ example
116
+ {
117
+ echo = 2;
118
+ ring R = 0,x,lp;
119
+
120
+ interval I = 1; I;
121
+ I = 3/7; I;
122
+ }
123
+
124
+ proc intervalGet(interval I, int n)
125
+ "USAGE: I[n], interval I, int n
126
+ RETURN: get lower or upper bound of interval"
127
+ {
128
+ // depends on implementation (TODO)
129
+ if (n == 1 || n == 2) {
130
+ return(I.l[n]);
131
+ }
132
+ ERROR("index wrong.");
133
+ }
134
+ example
135
+ {
136
+ echo = 2;
137
+ ring R = 0,x,lp;
138
+ interval I = bounds2(0/1, 1/1);
139
+
140
+ I[1];
141
+ I[2];
142
+ }
143
+
144
+ proc intervalEqual(interval I, interval J)
145
+ "USAGE: I == J, I, J interval
146
+ RETURN: 1 if bounds are equal, 0 else
147
+ EXAMPLE: test intervals for equality"
148
+ {
149
+ return(I[1] == J[1] && I[2] == J[2]);
150
+ }
151
+ example
152
+ {
153
+ echo = 2;
154
+ ring R = 0,x,lp;
155
+
156
+ interval I = bounds2(0, 1);
157
+ interval J = bounds2(0, 1);
158
+ interval K = bounds2(0, 2);
159
+
160
+ I == J;
161
+ I == K;
162
+ }
163
+
164
+ proc length2(interval I)
165
+ "USAGE: length2(I), I interval
166
+ RETURN: length/size in measure sense
167
+ EXAMPLE: compute length of intervals"
168
+ {
169
+ return(I[2] - I[1]);
170
+ }
171
+ example
172
+ {
173
+ echo = 2;
174
+ ring R = 0,x,lp;
175
+
176
+ interval I = bounds2(0, 1); I;
177
+ length2(I);
178
+
179
+ I = bounds2(-1/2, 3/7); I;
180
+ length2(I);
181
+ }
182
+
183
+ proc intervalString(interval I)
184
+ "USAGE: string(I), I interval
185
+ RETURN: string representation of I
186
+ EXAMPLE: convert interval to string"
187
+ {
188
+ return(string("[", I[1], ", ", I[2], "]"));
189
+ }
190
+ example
191
+ {
192
+ echo = 2;
193
+ ring R = 0,x,lp;
194
+
195
+ interval I = bounds2(0, 3/2);
196
+ string("I = ", I, "!");
197
+ }
198
+
199
+ proc intervalPrint(interval I)
200
+ "USAGE: I;, I interval
201
+ EXAMPLE: prints interval in readable format"
202
+ {
203
+ string(I);
204
+ }
205
+ example
206
+ {
207
+ echo = 2;
208
+ ring R = 0,x,lp;
209
+
210
+ interval I = bounds2(1/5, 7/3);
211
+ I;
212
+ }
213
+
214
+ proc intervalAdd(interval I, interval J)
215
+ "USAGE: I + J, I, J interval
216
+ RETURN: I+J
217
+ EXAMPLE: adds two intervals"
218
+ {
219
+ // independent of implementation
220
+ return(bounds2(I[1] + J[1], I[2] + J[2]));
221
+ }
222
+ example
223
+ {
224
+ echo = 2;
225
+ ring R = 0,x,lp;
226
+ interval I = bounds2(0/1, 1/2); I;
227
+ interval J = bounds2(2/3, 1/1); J;
228
+
229
+ J = I+J; J;
230
+ }
231
+
232
+ proc intervalNegate(interval I)
233
+ "USAGE: (-I), I interval
234
+ RETURN: -I
235
+ EXAMPLE: computes negation of interval"
236
+ {
237
+ return(bounds2(-I[2], -I[1]));
238
+ }
239
+ example
240
+ {
241
+ echo = 2;
242
+ ring R = 0,x,lp;
243
+ interval I = bounds2(1/3, 1/2); I;
244
+ I = -I; I;
245
+ }
246
+
247
+ proc intervalSubtract(interval I, interval J)
248
+ "USAGE: I - J, I, J, interval,
249
+ RETURN: I-J
250
+ EXAMPLE: subtracts two intervals"
251
+ {
252
+ return(I + (-J));
253
+ }
254
+ example
255
+ {
256
+ echo = 2;
257
+ ring R = 0,x,lp;
258
+ interval I = bounds2(3/2, 14/5); I;
259
+ interval J = bounds2(1/7, 2/3); J;
260
+
261
+ J = I - J; J;
262
+ }
263
+
264
+ proc intervalMultiply(interval I, interval J)
265
+ "USAGE: I * J; I, J interval
266
+ RETURN: product I*J
267
+ EXAMPLE: multiplies intervals (and scalars)"
268
+ {
269
+ number lo = min(I[1] * J[1], I[1] * J[2], I[2] * J[1], I[2]*J[2]);
270
+ number up = max(I[1] * J[1], I[1] * J[2], I[2] * J[1], I[2]*J[2]);
271
+
272
+ return(bounds2(lo, up));
273
+ }
274
+ example
275
+ {
276
+ echo = 2;
277
+ ring R = 0,x,lp;
278
+
279
+ interval I = bounds2(1/3, 3/1); I;
280
+ interval J = bounds2(-2/5, 1/7); J;
281
+
282
+ J = I * J; J;
283
+
284
+ J = 1/2 * J; J;
285
+ }
286
+
287
+ proc intervalDivide(interval I, interval J)
288
+ "USAGE: I/J, I, J, interval
289
+ RETURN: I/J (division)
290
+ EXAMPLE: divide intervals, demonstrate zero case"
291
+ {
292
+ if (J[1]*J[2] > 0) {
293
+ interval Jinv = bounds2(1/J[2], 1/J[1]);
294
+ return(I * Jinv);
295
+ } else {
296
+ ERROR("Divisor contains zero.");
297
+ }
298
+ }
299
+ example
300
+ {
301
+ echo = 2;
302
+ ring R = 0,x,lp;
303
+
304
+ interval I = bounds2(1/1, 3/1); I;
305
+ interval J = bounds2(2/3, 3/2); J;
306
+
307
+ I/J;
308
+ J/I;
309
+
310
+ I = bounds2(-2/1, 1/2); I;
311
+
312
+ I/J;
313
+ J/I;
314
+ }
315
+
316
+ proc intervalPotentiate(interval I, int n)
317
+ "USAGE: I^n, interval I, int n
318
+ RETURN: I^n with stricter bounds than naive multiplication
319
+ EXAMPLE: potentiates an interval"
320
+ {
321
+ if (n % 2 == 1 || I[1]*I[2] >= 0 || n == 0) {
322
+ return(bounds2(I[1]^n, I[2]^n));
323
+ } else {
324
+ return(bounds2(0, max(I[1]^n, I[2]^n)));
325
+ }
326
+ }
327
+ example
328
+ {
329
+ echo = 2;
330
+ ring R = 0,x,lp;
331
+
332
+ interval I = bounds2(-1/3, 3/2); I;
333
+ I^1;
334
+ I^2;
335
+ I^3;
336
+ I^4;
337
+
338
+ interval J = bounds2(1/5, 2/5); J;
339
+ J^1;
340
+ J^2;
341
+ J^3;
342
+ J^4;
343
+ }
344
+
345
+ ///////////////////////////////////////////////////////////////////
346
+
347
+ // BOX FUNCTIONS
348
+
349
+ proc boxAssign(list intervals)
350
+ "USAGE: B = I1,I2,.., I1, I2 interval
351
+ RETURN: Box consisting of given intervals honoring amount of ring variables
352
+ EXAMPLE: construct box from intervals"
353
+ {
354
+ int v = nvars(basering);
355
+ int s = size(intervals);
356
+ box B;
357
+
358
+ // make sure box has same number of intervals as ring variables
359
+ interval z = 0;
360
+ for (int i = 1; i <= v; i++) {
361
+ if (i <= s) {
362
+ if (typeof(intervals[i]) == "interval") {
363
+ B.intervals[i] = intervals[i];
364
+ } else {
365
+ ERROR("Non-interval given.");
366
+ }
367
+ } else {
368
+ B.intervals[i] = z;
369
+ }
370
+ }
371
+
372
+ return(B);
373
+ }
374
+ example
375
+ {
376
+ echo = 2;
377
+
378
+ ring R = 0,x,lp;
379
+ interval I = bounds2(1, 2);
380
+ box B = list(I); B;
381
+
382
+ ring S = 0,x(1..15),lp;
383
+ I = bounds2(1/2, 2/3);
384
+ B = list(I, I^2, I^3); B;
385
+ }
386
+
387
+ proc boxSet(box B, int n, interval I)
388
+ "USAGE: boxSet(B, n, I), B box, n int, I interval
389
+ RETURN: B where B[i] == I
390
+ EXAMPLE: modify box"
391
+ {
392
+ if (n >= 1 && n <= nvars(basering)) {
393
+ B.intervals[n] = I;
394
+ }
395
+ return(B);
396
+ }
397
+ example
398
+ {
399
+ echo = 2;
400
+ ring R = 0,x(1..3),lp;
401
+
402
+ interval I = 1;
403
+ box B = list(I); B;
404
+ B = boxSet(B, 3, bounds2(1, 2)); B;
405
+ }
406
+
407
+ proc boxPrint(box B)
408
+ "USAGE: B;, B box,
409
+ RETURN: pretty output
410
+ EXAMPLE: output a box"
411
+ {
412
+ string(B.intervals);
413
+ }
414
+ example
415
+ {
416
+ echo = 2;
417
+ ring R = 0,x(1..4),lp;
418
+
419
+ interval I = bounds2(1, 2);
420
+ box B = list(I,I+1,I+2,I+4); B;
421
+ B = list(I,I^2); B;
422
+ }
423
+
424
+ proc boxGet(box B, int n)
425
+ "USAGE: B[n], B box, n int
426
+ RETURN: n-th interval of box
427
+ EXAMPLE: returns interval"
428
+ {
429
+ return(B.intervals[n]);
430
+ }
431
+ example
432
+ {
433
+ echo = 2;
434
+ ring R = 0,x(1..5),lp;
435
+
436
+ interval I = bounds2(1/3, 5);
437
+ box B = list(I, I/I, I+I, I-1/I, I^4);
438
+
439
+ B;
440
+ B[3];
441
+ }
442
+
443
+ proc boxEqual(box B, box C)
444
+ "USAGE: B == C, B, C box
445
+ RETURN: 1 if all bounds are equal, 0 else
446
+ EXAMPLE: test boxes for equality"
447
+ {
448
+ int n = nvars(basering);
449
+ for (int i = 1; i <= n; i++) {
450
+ if (!(B[i] == C[i])) { return(0); }
451
+ }
452
+ return(1);
453
+ }
454
+ example
455
+ {
456
+ echo = 2;
457
+ ring R = 0,x,lp;
458
+
459
+ interval I = bounds2(0,1);
460
+ interval J = bounds2(1,2);
461
+ box B = list(I, J);
462
+ box C = list(J, I);
463
+ box D = list(I, J);
464
+
465
+ B == C;
466
+ B == D;
467
+ }
468
+
469
+ proc boxSubtract(box B, box C)
470
+ "USAGE: B-C, B, C box
471
+ RETURN: componentwise subtraction"
472
+ {
473
+ int n = nvars(basering);
474
+ box OUT;
475
+ for (int i = 1; i <= n; i++) { OUT.intervals[i] = B[i] - C[i]; };
476
+ return(OUT);
477
+ }
478
+
479
+ proc lengthBox(box B)
480
+ "USAGE: lengthBox(B), B box
481
+ RETURN: length/size in measure sense
482
+ EXAMPLE: compute length of boxes"
483
+ {
484
+ number maximum = 0;
485
+ int n = nvars(basering);
486
+
487
+ for (int i=1; i <= n; i++) { maximum = max(maximum, length2(B[i])); }
488
+
489
+ return(maximum);
490
+ }
491
+ example
492
+ {
493
+ echo = 2;
494
+ ring R = 0,(x,y),lp;
495
+
496
+ interval I = bounds2(0, 1); I;
497
+ interval J = bounds2(1,3); J;
498
+
499
+ box B = list(I, J);
500
+
501
+ lengthBox(B);
502
+ }
503
+
504
+ proc boxCenter(box M)
505
+ "USAGE: boxCenter(M), M ivmat
506
+ RETURN: box containing center elements of M
507
+ EXAMPLE: compute center box"
508
+ {
509
+ int n = nvars(basering);
510
+
511
+ box C;
512
+ int i;
513
+
514
+ for (i = 1; i <= n; i++) {
515
+ C.intervals[i] = interval((M[i][1] + M[i][2])/2);
516
+ }
517
+
518
+ return(C);
519
+ }
520
+ example
521
+ {
522
+ echo = 2;
523
+ ring R = 0,(x,y),lp;
524
+ interval I1 = bounds2(1/3, 7/4);
525
+ interval I2 = bounds2(0,2);
526
+
527
+ box B= list(I1,I2);
528
+
529
+ boxCenter(B);
530
+ }
531
+
532
+ proc splitBox(box B, ideal I)
533
+ "USAGE: splitBox(box, I), box list of intervals, I ideal
534
+ RETURN: new list of smaller boxes, such that intersection of borders does not contain zeros of I
535
+ EXAMPLE: split two-dimensional interval into two"
536
+ {
537
+ // at first split only at largest interval
538
+ int imax = 1;
539
+ int n = nvars(basering);
540
+
541
+ for (int i = 2; i <= n; i++) {
542
+ if (length2(B[i]) > length2(B[imax])) { imax = i; }
543
+ }
544
+
545
+ number ratio = 1/2;
546
+ number mean;
547
+ box intersection;
548
+ ideal Inew;
549
+
550
+ while(1) {
551
+ mean = ratio * B[imax][1] + (1 - ratio) * B[imax][2];
552
+
553
+ intersection = evalIdealAtBox(I, boxSet(B, imax, mean));
554
+ for (i = 1; i <= n; i++) {
555
+ // check if any interval does not contain zero
556
+ if (intersection[i][1]*intersection[i][2] > 0) { break; }
557
+ }
558
+
559
+ Inew = I + (var(imax) - mean);
560
+ // check if groebner basis is trivial
561
+ if (std(Inew) == 1) { break; }
562
+
563
+ // else there must?/might be a zero on the intersection,
564
+ // so decrease ratio slightly
565
+ ratio = ratio * 9/10;
566
+
567
+ // make sure algorithm terminates, after taking too many steps
568
+ if ( ratio < 1/100 ) { print("splitBox took too long"); break; }
569
+ }
570
+
571
+ // now split boxes
572
+ box boxLeft = boxSet(B, imax, bounds2(B[imax][1], mean));
573
+ box boxRight = boxSet(B, imax, bounds2(mean, B[imax][2]));
574
+
575
+ return(list(boxLeft, boxRight));
576
+ }
577
+ example
578
+ {
579
+ echo = 2;
580
+ ring R = 0,(x,y),lp;
581
+
582
+ box B = list(bounds2(0,1),
583
+ bounds2(0,2));
584
+
585
+ B;
586
+ splitBox(B,1);
587
+ }
588
+
589
+ proc boxIntersect
590
+ "USAGE: intersect(B1, B2, ...) Bi box
591
+ RETURN: intersection B of the boxes Bi or -1 if the intersection is empty
592
+ EXAMPLE: intersect boxes"
593
+ {
594
+ int ninput = size(#);
595
+ if (ninput == 0) { return(-1) };
596
+
597
+ int n = nvars(basering);
598
+ int i, j;
599
+
600
+ for (i = 1; i <= ninput; i++) {
601
+ if (typeof(#[i]) <> "box") {
602
+ ERROR("Need to intersect boxes.");
603
+ }
604
+ }
605
+
606
+ box OUT;
607
+ number lower, upper;
608
+
609
+ for (i = 1; i <= n; i++) {
610
+ lower = #[1][i][1];
611
+ upper = #[1][i][2];
612
+ for (j = 2; j <= ninput; j ++) {
613
+ lower = max(lower, #[j][i][1]);
614
+ upper = min(upper, #[j][i][2]);
615
+ }
616
+
617
+ if (upper < lower) { return(-1); }
618
+
619
+ OUT.intervals[i] = bounds2(lower, upper);
620
+ }
621
+
622
+ return(OUT);
623
+ }
624
+ example
625
+ {
626
+ echo = 2;
627
+ ring R = 0,(x,y),lp;
628
+
629
+ interval I = bounds2(0,1);
630
+ interval J = bounds2(1/2, 3/2);
631
+
632
+ box B = list(I, J);
633
+ box C = list(J, I);
634
+ box D = list(I, I + 2);
635
+
636
+ intersect(B, C);
637
+ intersect(C, D);
638
+ }
639
+
640
+ proc boxIsinterior(box A, box B)
641
+ "USAGE: boxIsinterior(A, B), A, B box
642
+ RETURN: 1 if A contained in int(B) else 0
643
+ EXAMPLE: boxIsinterior"
644
+ {
645
+ int n = nvars(basering);
646
+ for (int i=1; i<= n; i++) {
647
+ if (A[i][1] <= B[i][1] || A[i][2] >= B[i][2]){return(0);}
648
+ }
649
+ return(1);
650
+ }
651
+ example
652
+ {
653
+ echo=2;
654
+ ring R=0,(x,y,z), lp;
655
+ box A=list(bounds2(1,2), bounds2(2,3), bounds2(1/2,7/2)); A;
656
+ box B1=list(bounds2(0,5/2), bounds2(1,4), bounds2(0,9)); B1;
657
+ boxIsinterior(A,B1);
658
+
659
+ box B2=list(bounds2(2,4), bounds2(1,4), bounds2(0,9)); B2;
660
+ boxIsinterior(A,B2);
661
+ }
662
+
663
+ ///////////////////////////////////////////////////////////////////
664
+
665
+ // MATRIX FUNCTIONS
666
+
667
+ proc intervalmatrixInit(numrows, numcols)
668
+ "USAGE: intervalmatrixInit(m, n) m, n int
669
+ RETURN: mxn matrix of [0,0]-intervals
670
+ EXAMPLE: initialises an interval matrix"
671
+ {
672
+ ivmat A;
673
+ A.rows = list();
674
+ int i, j;
675
+ interval z = 0;
676
+
677
+ for (i = 1; i <= numrows; i++) {
678
+ A.rows[i] = list();
679
+ for (j=1; j <= numcols; j++) {
680
+ A.rows[i][j] = z;
681
+ }
682
+ }
683
+
684
+ return(A);
685
+ }
686
+ example
687
+ {
688
+ echo = 2;
689
+ ring R = 0,x(1..5),lp;
690
+
691
+ ivmat A = intervalmatrixInit(4, 5); A;
692
+ }
693
+
694
+ proc ivmatNrows(ivmat M)
695
+ "USAGE: nrows(M), M ivmat
696
+ RETURN: number of rows of M
697
+ EXAMPLE: calculate number of rows"
698
+ {
699
+ return(size(M.rows));
700
+ }
701
+ example
702
+ {
703
+ echo = 2;
704
+ ring R = 0,x,lp;
705
+
706
+ ivmat A = intervalmatrixInit(2,3);
707
+ nrows(A);
708
+ }
709
+
710
+ proc ivmatNcols(ivmat M)
711
+ "USAGE: ncols(M), M ivmat
712
+ RETURN: number of columns of M
713
+ EXAMPLE: calculate number of columns"
714
+ {
715
+ return(size(M.rows[1]));
716
+ }
717
+ example
718
+ {
719
+ echo = 2;
720
+ ring R = 0,x,lp;
721
+
722
+ ivmat A = intervalmatrixInit(2,3);
723
+ ncols(A);
724
+ }
725
+
726
+ proc ivmatAssign(int m, int n, list #)
727
+ "USAGE: ivmatAssign(m, n, L), m, n int, L list of intervals
728
+ RETURN: interval matrix containing intervals L in row major order
729
+ EXAMPLE: builds matrix from intervals"
730
+ {
731
+ list intervals;
732
+ if (size(#) == 1 && typeof(#[1]) == "list") { intervals = #[1]; }
733
+ else { intervals = #; }
734
+
735
+ int ivsize = size(intervals);
736
+ int i, j;
737
+ int counter = 1;
738
+ ivmat A = intervalmatrixInit(m, n);
739
+
740
+ for (i = 1; i <= m; i++) {
741
+ for (j = 1; j <= n; j++) {
742
+ if (counter <= ivsize) {
743
+ A.rows[i][j] = intervals[counter];
744
+ counter++;
745
+ }
746
+ }
747
+ }
748
+
749
+ return(A);
750
+ }
751
+ example
752
+ {
753
+ echo = 2;
754
+ ring R = 0,(x,y),lp;
755
+
756
+ interval I = bounds2(1, 2);
757
+ ivmat A = ivmatAssign(2, 2, I, I^2, I/I, -I);
758
+ A;
759
+ }
760
+
761
+ proc ivmatPrint(ivmat A)
762
+ "USAGE: A; A ivmat
763
+ RETURN: nothing
764
+ EXAMPLE: prints a matrix"
765
+ {
766
+ int m = nrows(A);
767
+ for (int i = 1; i <= m; i++) {
768
+ string(A.rows[i]);
769
+ }
770
+ }
771
+ example
772
+ {
773
+ example ivmatAssign;
774
+ }
775
+
776
+ proc ivmatGet(ivmat A, int i)
777
+ "USAGE: A[i], A ivmat, i int
778
+ RETURN: list A[i] of i-th row of A
779
+ EXAMPLE: get single intervals of matrix"
780
+ {
781
+ return(A.rows[i]);
782
+ }
783
+ example
784
+ {
785
+ echo = 2;
786
+ ring R = 0,x,lp;
787
+
788
+ ivmat A = ivmatAssign(2, 2, bounds2(1, 2));
789
+ A[1][1];
790
+ A[1][2];
791
+ }
792
+
793
+ proc ivmatSet(ivmat A, int i, int j, interval I)
794
+ "USAGE: ivmatSet(A, i, j, I), A ivmat, i, j, int, I interval
795
+ RETURN: ivmat A where A[i][j] == I
796
+ EXAMPLE: assign values of A"
797
+ {
798
+ A.rows[i][j] = I;
799
+ return(A);
800
+ }
801
+ example
802
+ {
803
+ echo = 2;
804
+ ring R = 0,x,lp;
805
+ ivmat A = intervalmatrixInit(2,2); A;
806
+ A = ivmatSet(A, 1, 2, bounds2(1, 2)); A;
807
+ }
808
+
809
+ proc diagMatrix(int n, interval I)
810
+ "USAGE: diagMatrix(n, I), n int, I interval
811
+ RETURN: diagonal nxn-matrix E where E[i][i] == I for all 1 <= i <= n
812
+ EXAMPLE: create diagonal matrix"
813
+ {
814
+ ivmat E = intervalmatrixInit(n, n);
815
+ for (int i = 1; i <= n; i++) {
816
+ E.rows[i][i] = I;
817
+ }
818
+ return(E);
819
+ }
820
+ example
821
+ {
822
+ echo = 2;
823
+ ring R = 0,x,lp;
824
+ ivmat A = diagMatrix(2, bounds2(1, 2)); A;
825
+ }
826
+
827
+ proc unitMatrix2(int n)
828
+ "USAGE: unitMatrix2(n)
829
+ RETURN: nxn unit matrix
830
+ EXAMPLE: create unit matrix"
831
+ {
832
+ return(diagMatrix(n, 1));
833
+ }
834
+ example
835
+ {
836
+ echo = 2;
837
+ ring R = 0,x,lp;
838
+
839
+ ivmat E = unitMatrix2(4); E;
840
+ }
841
+
842
+ proc determinant(ivmat A)
843
+ "USAGE: det(A), A ivmat
844
+ RETURN: determinant calculated by standard interval arithmetic
845
+ EXAMPLE: calculates a determinant"
846
+ {
847
+ int n = ncols(A);
848
+ if (n == 1) { return(A[1][1]); }
849
+
850
+ interval I = 0;
851
+ for (int i = 1; i <= n; i++) {
852
+ I = I + A[1][i] * cofactor(A, 1, i);
853
+ }
854
+ return(I);
855
+ }
856
+ example
857
+ {
858
+ echo = 2;
859
+ ring R = 0,x,lp;
860
+
861
+ ivmat E = unitMatrix2(3); E;
862
+ det(E);
863
+
864
+ E = diagMatrix(3, bounds2(2, 5/2)); E;
865
+ det(E);
866
+
867
+ interval I = bounds2(1/3, 4/3);
868
+ ivmat A = ivmatAssign(2, 2, I, I+1, I+2, I^2); A;
869
+ det(A);
870
+ }
871
+
872
+ proc cofactor(ivmat A, int i, int j)
873
+ "USAGE: cofactor(A, i, j), A ivmat, i, j int
874
+ RETURN: cofactor of A at position (i,j)
875
+ EXAMPLE: compute cofactors"
876
+ {
877
+ int n = ncols(A);
878
+ if (n == 1) { return(A[1][1]); }
879
+
880
+ ivmat M = intervalmatrixInit(n-1, n-1);
881
+
882
+ // create m-1 x n-1 submatrix (minor) without row i, column j
883
+ int k, l;
884
+ for (k = 1; k < n; k++) {
885
+ for (l = 1; l < n; l++) {
886
+ M.rows[k][l] = A[k + (k>=i)][l + (l>=j)];
887
+ }
888
+ }
889
+
890
+ return( (-1)^(i+j) * det(M) );
891
+ }
892
+ example
893
+ {
894
+ echo = 2;
895
+ ring R = 0,x,lp;
896
+
897
+ interval I = bounds2(1, 2);
898
+ interval J = bounds2(2, 5/2);
899
+ interval z = 0;
900
+
901
+ ivmat A = ivmatAssign(2,2,I,z,z,J); A;
902
+
903
+ cofactor(A, 2, 1);
904
+ }
905
+
906
+ proc adjunct(ivmat A)
907
+ "USAGE: adjuct(A), A ivmat
908
+ RETURN: adjuct matrix i.e. transpose cofactor matrix
909
+ EXAMPLE: compute adjunct matrix"
910
+ {
911
+ int n = size(A[1]);
912
+ ivmat adj = intervalmatrixInit(n, n);
913
+
914
+ int i, j;
915
+ for (i = 1; i <= n; i++) {
916
+ for (j = 1; j <= n; j++) {
917
+ adj.rows[i][j] = cofactor(A, j, i);
918
+ }
919
+ }
920
+
921
+ return(adj);
922
+ }
923
+ example
924
+ {
925
+ echo = 2;
926
+ ring R = 0,x,lp;
927
+
928
+ interval I = bounds2(1, 2);
929
+ interval J = bounds2(2, 5/2);
930
+ interval z = 0;
931
+
932
+ ivmat A = ivmatAssign(2,2,I,z,z,J); A;
933
+
934
+ adjunct(A);
935
+ }
936
+
937
+ proc ivmatCenter(ivmat M)
938
+ "USAGE: ivmatCenter(M), M ivmat
939
+ RETURN: martix containing center elements of M
940
+ EXAMPLE: compute center matrix"
941
+ {
942
+ int m = nrows(M);
943
+ int n = ncols(M);
944
+
945
+ matrix C[m][n];
946
+ int i, j;
947
+
948
+ for (i = 1; i <= m; i++) {
949
+ for (j = 1; j <= n; j++) {
950
+ C[i, j] = (M[i][j][1] + M[i][j][2])/2;
951
+ }
952
+ }
953
+
954
+ return(C);
955
+ }
956
+ example
957
+ {
958
+ echo = 2;
959
+ ring R = 0,x,lp;
960
+
961
+ interval I = bounds2(1/3, 7/4);
962
+ ivmat M = diagMatrix(3, I);
963
+ M = ivmatSet(M, 3, 2, bounds2(1, 3/2)); M;
964
+
965
+ ivmatCenter(M);
966
+ }
967
+
968
+ proc ivmatRadius(ivmat M)
969
+ "USAGE: ivmatRadius(M), M ivmat
970
+ RETURN: martix containing radius elements of M
971
+ EXAMPLE: compute radius matrix"
972
+ {
973
+ int m = nrows(M);
974
+ int n = ncols(M);
975
+
976
+ matrix C[m][n];
977
+ int i, j;
978
+
979
+ for (i = 1; i <= m; i++) {
980
+ for (j = 1; j <= n; j++) {
981
+ C[i, j] = length2(M[i][j])/2;
982
+ }
983
+ }
984
+
985
+ return(C);
986
+ }
987
+ example
988
+ {
989
+ echo = 2;
990
+ ring R = 0,x,lp;
991
+
992
+ interval I = bounds2(1/3, 7/4);
993
+ ivmat M = diagMatrix(3, I);
994
+ M = ivmatSet(M, 3, 2, bounds2(1, 3/2)); M;
995
+
996
+ ivmatRadius(M);
997
+ }
998
+
999
+ proc ivmatMultiply(ivmat A, ivmat B)
1000
+ "USAGE: A*B, A, B ivmat
1001
+ RETURN: matrix product of A and B
1002
+ EXAMPLE: multiply matrices"
1003
+ {
1004
+ int m = nrows(A);
1005
+ int n = ncols(B);
1006
+ int p = ncols(A);
1007
+
1008
+ if (p <> nrows(B)) { ERROR("Matrices have wrong dimensions!"); }
1009
+
1010
+ ivmat C = intervalmatrixInit(m, n);
1011
+ int i, j, k;
1012
+ interval I;
1013
+
1014
+ for (i = 1; i <= m; i++) {
1015
+ for (j = 1; j <= n; j++) {
1016
+ I = 0;
1017
+ for (k = 1; k <= p; k++) {
1018
+ I = I + A[i][k] * B[k][j];
1019
+ }
1020
+ C.rows[i][j] = I;
1021
+ }
1022
+ }
1023
+
1024
+ return(C);
1025
+ }
1026
+ example
1027
+ {
1028
+ echo = 3;
1029
+ ring R = 0,x,lp;
1030
+
1031
+ interval I = bounds2(0, 1);
1032
+ ivmat E = intervalmatrixInit(3,3);
1033
+ for (int i = 1; i<=3; i++) { E = ivmatSet(E, i, i, I+i); } E;
1034
+
1035
+ interval z = 0;
1036
+ interval J1 = bounds2(1/3, 3/7);
1037
+ interval J2 = bounds2(2, 5/2);
1038
+ interval J3 = bounds2(6/7, 8/7);
1039
+ interval J4 = bounds2(1, 2);
1040
+
1041
+ ivmat A = ivmatAssign(3,3, J1, z, J2, J3, J3^2, z, z, J4, J2*J4); A;
1042
+
1043
+ E * A;
1044
+ A * E;
1045
+
1046
+ A * adjunct(A);
1047
+ det(A);
1048
+ }
1049
+
1050
+ proc ivmatGaussian2(ivmat A)
1051
+ "USAGE: ivmatGaussian2(A) A ivmat
1052
+ RETURN: 0 if A not invertible, 1,Ainv if A invertible
1053
+ EXAMPLE: some matrix"
1054
+ {
1055
+ int n = nrows(A);
1056
+ if (n <> ncols(A)) { ERROR("Matrix non-square"); }
1057
+
1058
+ ivmat Ainv = unitMatrix2(n);
1059
+ list tmp;
1060
+ interval TMP;
1061
+
1062
+ int i, j, pos;
1063
+ for (pos = 1; pos <= n; pos++) {
1064
+ i = pos;
1065
+
1066
+ // get non-zero interval on diagonal
1067
+ while(A[i][pos][1] * A[i][pos][2] <= 0) {
1068
+ i++;
1069
+ // if no non-zero intervals exist, then matrix must be singular
1070
+ if (i > n) { return(0); }
1071
+ }
1072
+ if (i <> pos) {
1073
+ tmp = A.rows[i];
1074
+ A.rows[i] = A.rows[pos];
1075
+ A.rows[pos] = tmp;
1076
+
1077
+ tmp = Ainv.rows[i];
1078
+ Ainv.rows[i] = Ainv.rows[pos];
1079
+ Ainv.rows[pos] = tmp;
1080
+ }
1081
+
1082
+ // pivot (pos,pos)
1083
+ TMP = A[pos][pos];
1084
+ A.rows[pos][pos] = interval(1);
1085
+
1086
+ for (j = 1; j <= n; j++) {
1087
+ if (pos <> j) { A.rows[pos][j] = A[pos][j]/TMP; }
1088
+ Ainv.rows[pos][j] = Ainv[pos][j]/TMP;
1089
+ }
1090
+
1091
+ // clear entries above and below
1092
+ for (i = 1; i <= n; i++) {
1093
+ if (i <> pos) {
1094
+ TMP = A[i][pos];
1095
+ A.rows[i][pos] = interval(0);
1096
+ for (j = 1; j <= n; j++) {
1097
+ if (j <> pos) { A.rows[i][j] = A[i][j] - A[pos][j]*TMP; }
1098
+ Ainv.rows[i][j] = Ainv[i][j] - Ainv[pos][j]*TMP;
1099
+ }
1100
+ }
1101
+ }
1102
+ }
1103
+ return(1, Ainv);
1104
+ }
1105
+ example
1106
+ {
1107
+ echo = 2;
1108
+ ring R = 0,(x,y),lp;
1109
+
1110
+ ideal I = 2x2-xy+2y2-2,2x2-3xy+3y2-2;
1111
+ box B = list(bounds2(7/8, 9/8), bounds2(-1/10, 1/20));
1112
+
1113
+ ivmat J = evalJacobianAtBox (I, B); J;
1114
+
1115
+ list result = ivmatGaussian2(J);
1116
+ ivmat Jinv = result[2];
1117
+ Jinv;
1118
+
1119
+ Jinv * J;
1120
+
1121
+ ivmat Jadj = diagMatrix(2, 1/det(J)) * adjunct(J);
1122
+ Jadj;
1123
+
1124
+ Jadj * J;
1125
+ }
1126
+
1127
+ proc applyMatrix(ivmat A, box b)
1128
+ "USAGE: A * b, A ivmat, b box
1129
+ RETURN: A*b
1130
+ EXAMPLE: apply matrix to box"
1131
+ {
1132
+ int n = nvars(basering);
1133
+
1134
+ if (ncols(A) <> n || nrows(A) <> n) { ERROR("Matrix has wrong dimensions"); }
1135
+
1136
+ int i, j;
1137
+ box result;
1138
+ interval tmp;
1139
+
1140
+ for (i = 1; i <= n; i++) {
1141
+ tmp = 0;
1142
+ for (j = 1; j <= n; j++) {
1143
+ tmp = tmp + A[i][j] * b[j];
1144
+ }
1145
+ result.intervals[i] = tmp;
1146
+ }
1147
+
1148
+ return(result);
1149
+ }
1150
+ example
1151
+ {
1152
+ echo = 3;
1153
+ ring R = 0,(x,y,z),lp;
1154
+
1155
+ ideal I = xyz3+z2y2+x,x4+y3+2z+3,xyz+1/2;
1156
+ interval J = bounds2(1/2, 3/2);
1157
+ box B = list(J,J,J);
1158
+
1159
+ ivmat A = evalJacobianAtBox(I, B); A;
1160
+ A*B;
1161
+
1162
+ unitMatrix2(3) * B;
1163
+
1164
+ diagMatrix(3, bounds2(0, 1)) * B;
1165
+ }
1166
+
1167
+ proc ivmatMultiplyGeneral(ivmat A, B)
1168
+ "USAGE: A * B, A ivmat, B ivmat or box
1169
+ RETURN: usual matrix product where box is a nx1 matrix
1170
+ EXAMPLE: multiply matrices with matrices and boxes"
1171
+ {
1172
+ if (typeof(B) == "ivmat") { return(ivmatMultiply(A, B)); }
1173
+ if (typeof(B) == "box") { return(applyMatrix(A, B)); }
1174
+ ERROR("Type not supported.");
1175
+ }
1176
+ example
1177
+ {
1178
+ example ivmatMultiply;
1179
+ example applyMatrix;
1180
+ }
1181
+
1182
+ ///////////////////////////////////////////////////////////////////
1183
+
1184
+ // POLYNOMIAL APPLICATIONS
1185
+
1186
+ // naive (?) implementation
1187
+ proc evalPolyAtBox2(poly f, box B)
1188
+ "USAGE: evalPolyAtBox2(f, B), f poly, B box
1189
+ RETURN: interval extension ff(intervals)
1190
+ EXAMPLE: computes interval extension of polynomial f"
1191
+ {
1192
+ int numvars = nvars(basering);
1193
+
1194
+ // neutral element of addition
1195
+ interval resultWhole = 0;
1196
+ interval resultMonom;
1197
+
1198
+ int i;
1199
+ number coeff;
1200
+ intvec exponent;
1201
+
1202
+ // handle each monomial separately
1203
+ while (f <> 0) {
1204
+ coeff = leadcoef(f);
1205
+ exponent = leadexp(f);
1206
+
1207
+ // neutral element of multiplication
1208
+ resultMonom = 1;
1209
+
1210
+ for (i = 1; i <= numvars; i++) {
1211
+ resultMonom = resultMonom * B[i] ^ exponent[i];
1212
+ }
1213
+
1214
+ resultWhole = resultWhole + coeff * resultMonom;
1215
+ f = f - lead(f);
1216
+ }
1217
+
1218
+ return(resultWhole);
1219
+ }
1220
+ example
1221
+ {
1222
+ echo = 2;
1223
+ ring R = 0,x,lp;
1224
+ interval I1 = bounds2(0, 1); I1;
1225
+
1226
+ poly f = x3 + 4x + 3;
1227
+
1228
+ evalPolyAtBox2(f, list(I1));
1229
+
1230
+ ring S = 0,(x,y,z),lp;
1231
+ interval I2 = bounds2(0, 1);
1232
+ box B = list(I2, I2, I2);
1233
+
1234
+ poly f = xyz2 + 2x2 + (3/2)*y3x + z + 1;
1235
+
1236
+ evalPolyAtBox2(f, B);
1237
+ }
1238
+
1239
+ proc evalJacobianAtBox(ideal I, box B)
1240
+ "USAGE: evalJacobianAtBox(I, B), I ideal B box
1241
+ RETURN: jacobian matrix of I where polynomials are evaluated at the given box
1242
+ EXAMPLE: evaluate Jacobian at box"
1243
+ {
1244
+ matrix J = jacob(I);
1245
+ int m = nrows(J);
1246
+ int n = ncols(J);
1247
+ ivmat M = intervalmatrixInit(m, n);
1248
+
1249
+ int i, j;
1250
+
1251
+ for (i = 1; i <= m; i++) {
1252
+ for (j = 1; j <=n ; j++) {
1253
+ M.rows[i][j] = evalPolyAtBox2(J[i,j], B);
1254
+ }
1255
+ }
1256
+ return(M);
1257
+ }
1258
+ example
1259
+ {
1260
+ echo = 2;
1261
+ ring R = 0,(x,y),lp;
1262
+ ideal I = 2x2-xy+2y2-2, 2x2-3xy+3y2-2;
1263
+
1264
+ interval J = bounds2(-1,1);
1265
+ evalJacobianAtBox(I, list(J,J));
1266
+ }
1267
+
1268
+ proc testPolyBox(ideal I, box B)
1269
+ "USAGE: testPolyBox(I, intervals) or testPolyBox(I, I1, I2, ..)
1270
+ I ideal, intervals list of intervals, I1, I2, .. intervals
1271
+ RETURN: -1, if ideal has no zeros in given box, 1, if unique zero in given box
1272
+ 0 if test is inconclusive
1273
+ EXAMPLE: tests the above for intersection of ellipses."
1274
+ {
1275
+ int numvars = nvars(basering);
1276
+ int i;
1277
+
1278
+ interval tmp;
1279
+
1280
+ for (i = 1; i <= ncols(I); i++) {
1281
+ tmp = evalPolyAtBox2(I[i], B);
1282
+ // check if 0 contained in every interval
1283
+ // return -1 if not
1284
+ if (tmp[1]*tmp[2] > 0) { return(-1, B); }
1285
+ }
1286
+
1287
+ if (ncols(I) == numvars) {
1288
+ // calculate center as box of intervals instead of numbers
1289
+ // so we may reuse other procedures
1290
+ box Bcenter = boxCenter(B);
1291
+
1292
+ ivmat J = evalJacobianAtBox(I, B);
1293
+ list inverse = ivmatGaussian2(J);
1294
+
1295
+ // only continue if J is invertible , i.e. J contains no singular matrix
1296
+ if (!inverse[1]) { return(0, B); }
1297
+ ivmat Jinverse = inverse[2];
1298
+
1299
+ // calculate Bcenter - f(B)^(-1)f(Bcenter)
1300
+ box fB = evalIdealAtBox(I, Bcenter);
1301
+ fB = Bcenter - (Jinverse * fB);
1302
+
1303
+ def Bint = intersect(B, fB);
1304
+
1305
+ // if intersection is empty Bint == -1
1306
+ if (typeof(Bint) == "int") { return(-1, B); }
1307
+ B = Bint;
1308
+
1309
+ // if equality holds, fB is contained in box B
1310
+ // by paper, fB contains unique solution
1311
+ if (fB == B) { return(1, B) };
1312
+ }
1313
+
1314
+ // no condition could be verified
1315
+ return(0, B);
1316
+ }
1317
+ example
1318
+ {
1319
+ echo = 2;
1320
+ ring R = 0,(x,y),lp;
1321
+ ideal I = 2x2-xy+2y2-2, 2x2-3xy+3y2-2;
1322
+
1323
+ interval unit = bounds2(0, 1);
1324
+ // there may be common zeros in [0,1]x[0,1]
1325
+ testPolyBox(I, list(unit, unit));
1326
+
1327
+ // there are no common zeros in [0,0.5]x[0,0.5]
1328
+ testPolyBox(I, list(unit/2, unit/2));
1329
+ }
1330
+
1331
+ proc evalIdealAtBox(ideal I, box B)
1332
+ "USAGE: evaluate ideal at list of intervals i.e. at a box
1333
+ RETURN: list
1334
+ EXAMPLE: evalIdealAtBox"
1335
+ {
1336
+ list resu;
1337
+
1338
+ for (int j = 1; j <= size(I); j++) {
1339
+ resu[j]=evalPolyAtBox2(I[j], B);
1340
+ }
1341
+
1342
+ return(box(resu));
1343
+ }
1344
+ example
1345
+ {
1346
+ echo = 2;
1347
+ ring R = 0,(x,y),lp;
1348
+ interval I1 = bounds2(0, 1); I1;
1349
+ interval I2 = bounds2(0, 1); I2;
1350
+
1351
+ poly f = xy2 + 2x2 + (3/2)*y3x + 1;
1352
+ poly g = 3x2 + 2y;
1353
+
1354
+ ideal I = f,g;
1355
+ list intervals = I1,I2;
1356
+
1357
+ evalIdealAtBox(I,intervals);
1358
+ }
1359
+
1360
+ proc exclusionTest(ideal I, box start, number limitsize)
1361
+ "USAGE: exclusion test for roots with interval arithmetic
1362
+ RETURN: list of boxes
1363
+ EXAMPLE: exclusionTest for intersection of two ellipses"
1364
+ {
1365
+ //set of boxes smaller than size
1366
+ list B_size;
1367
+ //set of boxes which exactly contain one solution
1368
+ list B_star;
1369
+ //set of boxes initialised to input
1370
+ list B = list(start);
1371
+ //help set of boxes
1372
+ list B_prime;
1373
+
1374
+ int i;
1375
+ int zeroTest;
1376
+
1377
+ while (size(B) <> 0) {
1378
+ // B_prime is empty set
1379
+ B_prime = list();
1380
+
1381
+ for (i=1; i<=size(B); i++) {
1382
+ //case that maybe there is a root in the box
1383
+ zeroTest, B[i] = testPolyBox(I,B[i]);
1384
+
1385
+ // maybe refine boxes in Bstar in later steps
1386
+ if (zeroTest == 1) { B_star = insert(B_star, B[i]); };
1387
+ if (zeroTest == 0) {
1388
+ //case that box is smaller than the input limitsize
1389
+ if (lengthBox(B[i]) <= limitsize){
1390
+ B_size = insert(B_size, B[i]);
1391
+ } else {
1392
+ // else split the box and put the smaller boxes to B_prime
1393
+ B_prime = B_prime + splitBox(B[i], I);
1394
+ }
1395
+ }
1396
+ }
1397
+
1398
+ // set B=B_prime
1399
+ B = B_prime;
1400
+ }
1401
+ return(B_size, B_star);
1402
+ }
1403
+ example
1404
+ {
1405
+ echo = 2;
1406
+
1407
+ ring R = 0,(x,y),lp;
1408
+ ideal I = 2x2-xy+2y2-2,2x2-3xy+3y2-2; // V(I) has four elements
1409
+
1410
+ interval i = bounds2(-3/2,3/2);
1411
+ box B = list(i, i);
1412
+
1413
+ list result = exclusionTest(I, B, 1/512);
1414
+ size(result[1]);
1415
+ size(result[2]);
1416
+ }
1417
+
1418
+ // vim: ft=singular