passagemath-singular 10.6.31rc3__cp314-cp314-musllinux_1_2_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 (493) hide show
  1. PySingular.cpython-314-x86_64-linux-musl.so +0 -0
  2. passagemath_singular-10.6.31rc3.dist-info/METADATA +183 -0
  3. passagemath_singular-10.6.31rc3.dist-info/RECORD +493 -0
  4. passagemath_singular-10.6.31rc3.dist-info/WHEEL +5 -0
  5. passagemath_singular-10.6.31rc3.dist-info/top_level.txt +3 -0
  6. passagemath_singular.libs/libSingular-4-67059f19.4.1.so +0 -0
  7. passagemath_singular.libs/libcddgmp-30166d29.so.0.1.3 +0 -0
  8. passagemath_singular.libs/libfactory-4-9d37bcf4.4.1.so +0 -0
  9. passagemath_singular.libs/libflint-fd6f12fc.so.21.0.0 +0 -0
  10. passagemath_singular.libs/libgcc_s-0cd532bd.so.1 +0 -0
  11. passagemath_singular.libs/libgf2x-9e30c3e3.so.3.0.0 +0 -0
  12. passagemath_singular.libs/libgfortran-2c33b284.so.5.0.0 +0 -0
  13. passagemath_singular.libs/libgmp-0e7fc84e.so.10.5.0 +0 -0
  14. passagemath_singular.libs/libgsl-42cda06f.so.28.0.0 +0 -0
  15. passagemath_singular.libs/libmpfr-aaecbfc0.so.6.2.1 +0 -0
  16. passagemath_singular.libs/libncursesw-9c9e32c3.so.6.5 +0 -0
  17. passagemath_singular.libs/libntl-26885ca2.so.44.0.1 +0 -0
  18. passagemath_singular.libs/libomalloc-0-e9ff96db.9.6.so +0 -0
  19. passagemath_singular.libs/libopenblasp-r0-905cb27d.3.29.so +0 -0
  20. passagemath_singular.libs/libpolys-4-8bcf8e7d.4.1.so +0 -0
  21. passagemath_singular.libs/libquadmath-bb76a5fc.so.0.0.0 +0 -0
  22. passagemath_singular.libs/libreadline-06542304.so.8.2 +0 -0
  23. passagemath_singular.libs/libsingular_resources-4-73bf7623.4.1.so +0 -0
  24. passagemath_singular.libs/libstdc++-5d72f927.so.6.0.33 +0 -0
  25. sage/algebras/all__sagemath_singular.py +3 -0
  26. sage/algebras/fusion_rings/all.py +19 -0
  27. sage/algebras/fusion_rings/f_matrix.py +2448 -0
  28. sage/algebras/fusion_rings/fast_parallel_fmats_methods.cpython-314-x86_64-linux-musl.so +0 -0
  29. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pxd +5 -0
  30. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pyx +538 -0
  31. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.cpython-314-x86_64-linux-musl.so +0 -0
  32. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pxd +3 -0
  33. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pyx +331 -0
  34. sage/algebras/fusion_rings/fusion_double.py +899 -0
  35. sage/algebras/fusion_rings/fusion_ring.py +1580 -0
  36. sage/algebras/fusion_rings/poly_tup_engine.cpython-314-x86_64-linux-musl.so +0 -0
  37. sage/algebras/fusion_rings/poly_tup_engine.pxd +24 -0
  38. sage/algebras/fusion_rings/poly_tup_engine.pyx +579 -0
  39. sage/algebras/fusion_rings/shm_managers.cpython-314-x86_64-linux-musl.so +0 -0
  40. sage/algebras/fusion_rings/shm_managers.pxd +24 -0
  41. sage/algebras/fusion_rings/shm_managers.pyx +780 -0
  42. sage/algebras/letterplace/all.py +1 -0
  43. sage/algebras/letterplace/free_algebra_element_letterplace.cpython-314-x86_64-linux-musl.so +0 -0
  44. sage/algebras/letterplace/free_algebra_element_letterplace.pxd +18 -0
  45. sage/algebras/letterplace/free_algebra_element_letterplace.pyx +755 -0
  46. sage/algebras/letterplace/free_algebra_letterplace.cpython-314-x86_64-linux-musl.so +0 -0
  47. sage/algebras/letterplace/free_algebra_letterplace.pxd +35 -0
  48. sage/algebras/letterplace/free_algebra_letterplace.pyx +914 -0
  49. sage/algebras/letterplace/letterplace_ideal.cpython-314-x86_64-linux-musl.so +0 -0
  50. sage/algebras/letterplace/letterplace_ideal.pyx +408 -0
  51. sage/algebras/quatalg/all.py +2 -0
  52. sage/algebras/quatalg/quaternion_algebra.py +4778 -0
  53. sage/algebras/quatalg/quaternion_algebra_cython.cpython-314-x86_64-linux-musl.so +0 -0
  54. sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
  55. sage/algebras/quatalg/quaternion_algebra_element.cpython-314-x86_64-linux-musl.so +0 -0
  56. sage/algebras/quatalg/quaternion_algebra_element.pxd +29 -0
  57. sage/algebras/quatalg/quaternion_algebra_element.pyx +2176 -0
  58. sage/all__sagemath_singular.py +11 -0
  59. sage/ext_data/all__sagemath_singular.py +1 -0
  60. sage/ext_data/singular/function_field/core.lib +98 -0
  61. sage/interfaces/all__sagemath_singular.py +1 -0
  62. sage/interfaces/singular.py +2835 -0
  63. sage/libs/all__sagemath_singular.py +1 -0
  64. sage/libs/singular/__init__.py +1 -0
  65. sage/libs/singular/decl.pxd +1168 -0
  66. sage/libs/singular/function.cpython-314-x86_64-linux-musl.so +0 -0
  67. sage/libs/singular/function.pxd +87 -0
  68. sage/libs/singular/function.pyx +1901 -0
  69. sage/libs/singular/function_factory.py +61 -0
  70. sage/libs/singular/groebner_strategy.cpython-314-x86_64-linux-musl.so +0 -0
  71. sage/libs/singular/groebner_strategy.pxd +22 -0
  72. sage/libs/singular/groebner_strategy.pyx +582 -0
  73. sage/libs/singular/option.cpython-314-x86_64-linux-musl.so +0 -0
  74. sage/libs/singular/option.pyx +671 -0
  75. sage/libs/singular/polynomial.cpython-314-x86_64-linux-musl.so +0 -0
  76. sage/libs/singular/polynomial.pxd +39 -0
  77. sage/libs/singular/polynomial.pyx +661 -0
  78. sage/libs/singular/ring.cpython-314-x86_64-linux-musl.so +0 -0
  79. sage/libs/singular/ring.pxd +58 -0
  80. sage/libs/singular/ring.pyx +893 -0
  81. sage/libs/singular/singular.cpython-314-x86_64-linux-musl.so +0 -0
  82. sage/libs/singular/singular.pxd +72 -0
  83. sage/libs/singular/singular.pyx +1944 -0
  84. sage/libs/singular/standard_options.py +145 -0
  85. sage/matrix/all__sagemath_singular.py +1 -0
  86. sage/matrix/matrix_mpolynomial_dense.cpython-314-x86_64-linux-musl.so +0 -0
  87. sage/matrix/matrix_mpolynomial_dense.pxd +7 -0
  88. sage/matrix/matrix_mpolynomial_dense.pyx +615 -0
  89. sage/rings/all__sagemath_singular.py +1 -0
  90. sage/rings/function_field/all__sagemath_singular.py +1 -0
  91. sage/rings/function_field/derivations_polymod.py +911 -0
  92. sage/rings/function_field/element_polymod.cpython-314-x86_64-linux-musl.so +0 -0
  93. sage/rings/function_field/element_polymod.pyx +406 -0
  94. sage/rings/function_field/function_field_polymod.py +2611 -0
  95. sage/rings/function_field/ideal_polymod.py +1775 -0
  96. sage/rings/function_field/order_polymod.py +1475 -0
  97. sage/rings/function_field/place_polymod.py +681 -0
  98. sage/rings/polynomial/all__sagemath_singular.py +1 -0
  99. sage/rings/polynomial/multi_polynomial_ideal_libsingular.cpython-314-x86_64-linux-musl.so +0 -0
  100. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pxd +5 -0
  101. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx +339 -0
  102. sage/rings/polynomial/multi_polynomial_libsingular.cpython-314-x86_64-linux-musl.so +0 -0
  103. sage/rings/polynomial/multi_polynomial_libsingular.pxd +30 -0
  104. sage/rings/polynomial/multi_polynomial_libsingular.pyx +6277 -0
  105. sage/rings/polynomial/plural.cpython-314-x86_64-linux-musl.so +0 -0
  106. sage/rings/polynomial/plural.pxd +48 -0
  107. sage/rings/polynomial/plural.pyx +3171 -0
  108. sage/symbolic/all__sagemath_singular.py +1 -0
  109. sage/symbolic/comparison_impl.pxi +428 -0
  110. sage/symbolic/constants_c_impl.pxi +178 -0
  111. sage/symbolic/expression.cpython-314-x86_64-linux-musl.so +0 -0
  112. sage/symbolic/expression.pxd +7 -0
  113. sage/symbolic/expression.pyx +14200 -0
  114. sage/symbolic/getitem_impl.pxi +202 -0
  115. sage/symbolic/pynac.pxi +572 -0
  116. sage/symbolic/pynac_constant_impl.pxi +133 -0
  117. sage/symbolic/pynac_function_impl.pxi +206 -0
  118. sage/symbolic/pynac_impl.pxi +2576 -0
  119. sage/symbolic/pynac_wrap.h +124 -0
  120. sage/symbolic/series_impl.pxi +272 -0
  121. sage/symbolic/substitution_map_impl.pxi +94 -0
  122. sage_wheels/bin/ESingular +0 -0
  123. sage_wheels/bin/Singular +0 -0
  124. sage_wheels/bin/TSingular +0 -0
  125. sage_wheels/lib/singular/MOD/cohomo.la +41 -0
  126. sage_wheels/lib/singular/MOD/cohomo.so +0 -0
  127. sage_wheels/lib/singular/MOD/customstd.la +41 -0
  128. sage_wheels/lib/singular/MOD/customstd.so +0 -0
  129. sage_wheels/lib/singular/MOD/freealgebra.la +41 -0
  130. sage_wheels/lib/singular/MOD/freealgebra.so +0 -0
  131. sage_wheels/lib/singular/MOD/gfanlib.la +41 -0
  132. sage_wheels/lib/singular/MOD/gfanlib.so +0 -0
  133. sage_wheels/lib/singular/MOD/gitfan.la +41 -0
  134. sage_wheels/lib/singular/MOD/gitfan.so +0 -0
  135. sage_wheels/lib/singular/MOD/interval.la +41 -0
  136. sage_wheels/lib/singular/MOD/interval.so +0 -0
  137. sage_wheels/lib/singular/MOD/loctriv.la +41 -0
  138. sage_wheels/lib/singular/MOD/loctriv.so +0 -0
  139. sage_wheels/lib/singular/MOD/machinelearning.la +41 -0
  140. sage_wheels/lib/singular/MOD/machinelearning.so +0 -0
  141. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.la +41 -0
  142. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.so +0 -0
  143. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.la +41 -0
  144. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.so +0 -0
  145. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.la +41 -0
  146. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.so +0 -0
  147. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.la +41 -0
  148. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.so +0 -0
  149. sage_wheels/lib/singular/MOD/partialgb.la +41 -0
  150. sage_wheels/lib/singular/MOD/partialgb.so +0 -0
  151. sage_wheels/lib/singular/MOD/pyobject.la +41 -0
  152. sage_wheels/lib/singular/MOD/pyobject.so +0 -0
  153. sage_wheels/lib/singular/MOD/singmathic.la +41 -0
  154. sage_wheels/lib/singular/MOD/singmathic.so +0 -0
  155. sage_wheels/lib/singular/MOD/sispasm.la +41 -0
  156. sage_wheels/lib/singular/MOD/sispasm.so +0 -0
  157. sage_wheels/lib/singular/MOD/subsets.la +41 -0
  158. sage_wheels/lib/singular/MOD/subsets.so +0 -0
  159. sage_wheels/lib/singular/MOD/systhreads.la +41 -0
  160. sage_wheels/lib/singular/MOD/systhreads.so +0 -0
  161. sage_wheels/lib/singular/MOD/syzextra.la +41 -0
  162. sage_wheels/lib/singular/MOD/syzextra.so +0 -0
  163. sage_wheels/libexec/singular/MOD/change_cost +0 -0
  164. sage_wheels/libexec/singular/MOD/singularsurf +11 -0
  165. sage_wheels/libexec/singular/MOD/singularsurf_jupyter +9 -0
  166. sage_wheels/libexec/singular/MOD/singularsurf_win +10 -0
  167. sage_wheels/libexec/singular/MOD/solve_IP +0 -0
  168. sage_wheels/libexec/singular/MOD/surfex +16 -0
  169. sage_wheels/libexec/singular/MOD/toric_ideal +0 -0
  170. sage_wheels/share/factory/gftables/10201 +342 -0
  171. sage_wheels/share/factory/gftables/1024 +37 -0
  172. sage_wheels/share/factory/gftables/10609 +356 -0
  173. sage_wheels/share/factory/gftables/11449 +384 -0
  174. sage_wheels/share/factory/gftables/11881 +398 -0
  175. sage_wheels/share/factory/gftables/121 +6 -0
  176. sage_wheels/share/factory/gftables/12167 +408 -0
  177. sage_wheels/share/factory/gftables/125 +7 -0
  178. sage_wheels/share/factory/gftables/12769 +428 -0
  179. sage_wheels/share/factory/gftables/128 +7 -0
  180. sage_wheels/share/factory/gftables/1331 +47 -0
  181. sage_wheels/share/factory/gftables/1369 +48 -0
  182. sage_wheels/share/factory/gftables/14641 +490 -0
  183. sage_wheels/share/factory/gftables/15625 +523 -0
  184. sage_wheels/share/factory/gftables/16 +3 -0
  185. sage_wheels/share/factory/gftables/16129 +540 -0
  186. sage_wheels/share/factory/gftables/16384 +549 -0
  187. sage_wheels/share/factory/gftables/16807 +563 -0
  188. sage_wheels/share/factory/gftables/1681 +58 -0
  189. sage_wheels/share/factory/gftables/169 +8 -0
  190. sage_wheels/share/factory/gftables/17161 +574 -0
  191. sage_wheels/share/factory/gftables/1849 +64 -0
  192. sage_wheels/share/factory/gftables/18769 +628 -0
  193. sage_wheels/share/factory/gftables/19321 +646 -0
  194. sage_wheels/share/factory/gftables/19683 +659 -0
  195. sage_wheels/share/factory/gftables/2048 +71 -0
  196. sage_wheels/share/factory/gftables/2187 +75 -0
  197. sage_wheels/share/factory/gftables/2197 +76 -0
  198. sage_wheels/share/factory/gftables/2209 +76 -0
  199. sage_wheels/share/factory/gftables/22201 +742 -0
  200. sage_wheels/share/factory/gftables/22801 +762 -0
  201. sage_wheels/share/factory/gftables/2401 +82 -0
  202. sage_wheels/share/factory/gftables/243 +11 -0
  203. sage_wheels/share/factory/gftables/24389 +815 -0
  204. sage_wheels/share/factory/gftables/24649 +824 -0
  205. sage_wheels/share/factory/gftables/25 +3 -0
  206. sage_wheels/share/factory/gftables/256 +11 -0
  207. sage_wheels/share/factory/gftables/26569 +888 -0
  208. sage_wheels/share/factory/gftables/27 +3 -0
  209. sage_wheels/share/factory/gftables/27889 +932 -0
  210. sage_wheels/share/factory/gftables/2809 +96 -0
  211. sage_wheels/share/factory/gftables/28561 +954 -0
  212. sage_wheels/share/factory/gftables/289 +12 -0
  213. sage_wheels/share/factory/gftables/29791 +995 -0
  214. sage_wheels/share/factory/gftables/29929 +1000 -0
  215. sage_wheels/share/factory/gftables/3125 +107 -0
  216. sage_wheels/share/factory/gftables/32 +4 -0
  217. sage_wheels/share/factory/gftables/32041 +1070 -0
  218. sage_wheels/share/factory/gftables/32761 +1094 -0
  219. sage_wheels/share/factory/gftables/32768 +1095 -0
  220. sage_wheels/share/factory/gftables/343 +14 -0
  221. sage_wheels/share/factory/gftables/3481 +118 -0
  222. sage_wheels/share/factory/gftables/361 +14 -0
  223. sage_wheels/share/factory/gftables/36481 +1218 -0
  224. sage_wheels/share/factory/gftables/3721 +126 -0
  225. sage_wheels/share/factory/gftables/37249 +1244 -0
  226. sage_wheels/share/factory/gftables/38809 +1296 -0
  227. sage_wheels/share/factory/gftables/39601 +1322 -0
  228. sage_wheels/share/factory/gftables/4 +3 -0
  229. sage_wheels/share/factory/gftables/4096 +139 -0
  230. sage_wheels/share/factory/gftables/44521 +1486 -0
  231. sage_wheels/share/factory/gftables/4489 +152 -0
  232. sage_wheels/share/factory/gftables/49 +4 -0
  233. sage_wheels/share/factory/gftables/4913 +166 -0
  234. sage_wheels/share/factory/gftables/49729 +1660 -0
  235. sage_wheels/share/factory/gftables/5041 +170 -0
  236. sage_wheels/share/factory/gftables/50653 +1691 -0
  237. sage_wheels/share/factory/gftables/512 +20 -0
  238. sage_wheels/share/factory/gftables/51529 +1720 -0
  239. sage_wheels/share/factory/gftables/52441 +1750 -0
  240. sage_wheels/share/factory/gftables/529 +20 -0
  241. sage_wheels/share/factory/gftables/5329 +180 -0
  242. sage_wheels/share/factory/gftables/54289 +1812 -0
  243. sage_wheels/share/factory/gftables/57121 +1906 -0
  244. sage_wheels/share/factory/gftables/58081 +1938 -0
  245. sage_wheels/share/factory/gftables/59049 +1971 -0
  246. sage_wheels/share/factory/gftables/6241 +210 -0
  247. sage_wheels/share/factory/gftables/625 +23 -0
  248. sage_wheels/share/factory/gftables/63001 +2102 -0
  249. sage_wheels/share/factory/gftables/64 +5 -0
  250. sage_wheels/share/factory/gftables/6561 +221 -0
  251. sage_wheels/share/factory/gftables/6859 +231 -0
  252. sage_wheels/share/factory/gftables/6889 +232 -0
  253. sage_wheels/share/factory/gftables/729 +27 -0
  254. sage_wheels/share/factory/gftables/7921 +266 -0
  255. sage_wheels/share/factory/gftables/8 +3 -0
  256. sage_wheels/share/factory/gftables/81 +5 -0
  257. sage_wheels/share/factory/gftables/8192 +276 -0
  258. sage_wheels/share/factory/gftables/841 +30 -0
  259. sage_wheels/share/factory/gftables/9 +3 -0
  260. sage_wheels/share/factory/gftables/9409 +316 -0
  261. sage_wheels/share/factory/gftables/961 +34 -0
  262. sage_wheels/share/info/singular.info +191898 -0
  263. sage_wheels/share/singular/LIB/GND.lib +1359 -0
  264. sage_wheels/share/singular/LIB/JMBTest.lib +976 -0
  265. sage_wheels/share/singular/LIB/JMSConst.lib +1363 -0
  266. sage_wheels/share/singular/LIB/KVequiv.lib +699 -0
  267. sage_wheels/share/singular/LIB/SingularityDBM.lib +491 -0
  268. sage_wheels/share/singular/LIB/VecField.lib +1542 -0
  269. sage_wheels/share/singular/LIB/absfact.lib +959 -0
  270. sage_wheels/share/singular/LIB/ainvar.lib +730 -0
  271. sage_wheels/share/singular/LIB/aksaka.lib +419 -0
  272. sage_wheels/share/singular/LIB/alexpoly.lib +2542 -0
  273. sage_wheels/share/singular/LIB/algebra.lib +1193 -0
  274. sage_wheels/share/singular/LIB/all.lib +136 -0
  275. sage_wheels/share/singular/LIB/arcpoint.lib +514 -0
  276. sage_wheels/share/singular/LIB/arnold.lib +4553 -0
  277. sage_wheels/share/singular/LIB/arnoldclassify.lib +2058 -0
  278. sage_wheels/share/singular/LIB/arr.lib +3486 -0
  279. sage_wheels/share/singular/LIB/assprimeszerodim.lib +755 -0
  280. sage_wheels/share/singular/LIB/autgradalg.lib +3361 -0
  281. sage_wheels/share/singular/LIB/bfun.lib +1964 -0
  282. sage_wheels/share/singular/LIB/bimodules.lib +774 -0
  283. sage_wheels/share/singular/LIB/brillnoether.lib +226 -0
  284. sage_wheels/share/singular/LIB/brnoeth.lib +5017 -0
  285. sage_wheels/share/singular/LIB/central.lib +2169 -0
  286. sage_wheels/share/singular/LIB/chern.lib +4162 -0
  287. sage_wheels/share/singular/LIB/cimonom.lib +571 -0
  288. sage_wheels/share/singular/LIB/cisimplicial.lib +1835 -0
  289. sage_wheels/share/singular/LIB/classify.lib +3239 -0
  290. sage_wheels/share/singular/LIB/classify2.lib +1462 -0
  291. sage_wheels/share/singular/LIB/classifyMapGerms.lib +1515 -0
  292. sage_wheels/share/singular/LIB/classify_aeq.lib +3253 -0
  293. sage_wheels/share/singular/LIB/classifyceq.lib +2092 -0
  294. sage_wheels/share/singular/LIB/classifyci.lib +1133 -0
  295. sage_wheels/share/singular/LIB/combinat.lib +91 -0
  296. sage_wheels/share/singular/LIB/compregb.lib +276 -0
  297. sage_wheels/share/singular/LIB/control.lib +1636 -0
  298. sage_wheels/share/singular/LIB/crypto.lib +3795 -0
  299. sage_wheels/share/singular/LIB/curveInv.lib +667 -0
  300. sage_wheels/share/singular/LIB/curvepar.lib +1817 -0
  301. sage_wheels/share/singular/LIB/customstd.lib +100 -0
  302. sage_wheels/share/singular/LIB/deRham.lib +5979 -0
  303. sage_wheels/share/singular/LIB/decodegb.lib +2134 -0
  304. sage_wheels/share/singular/LIB/decomp.lib +1655 -0
  305. sage_wheels/share/singular/LIB/deflation.lib +872 -0
  306. sage_wheels/share/singular/LIB/deform.lib +925 -0
  307. sage_wheels/share/singular/LIB/difform.lib +3055 -0
  308. sage_wheels/share/singular/LIB/divisors.lib +750 -0
  309. sage_wheels/share/singular/LIB/dmod.lib +5817 -0
  310. sage_wheels/share/singular/LIB/dmodapp.lib +3269 -0
  311. sage_wheels/share/singular/LIB/dmodideal.lib +1211 -0
  312. sage_wheels/share/singular/LIB/dmodloc.lib +2645 -0
  313. sage_wheels/share/singular/LIB/dmodvar.lib +818 -0
  314. sage_wheels/share/singular/LIB/dummy.lib +17 -0
  315. sage_wheels/share/singular/LIB/elim.lib +1009 -0
  316. sage_wheels/share/singular/LIB/ellipticcovers.lib +548 -0
  317. sage_wheels/share/singular/LIB/enumpoints.lib +146 -0
  318. sage_wheels/share/singular/LIB/equising.lib +2127 -0
  319. sage_wheels/share/singular/LIB/ffmodstd.lib +2384 -0
  320. sage_wheels/share/singular/LIB/ffsolve.lib +1289 -0
  321. sage_wheels/share/singular/LIB/findifs.lib +778 -0
  322. sage_wheels/share/singular/LIB/finitediff.lib +1768 -0
  323. sage_wheels/share/singular/LIB/finvar.lib +7989 -0
  324. sage_wheels/share/singular/LIB/fpadim.lib +2429 -0
  325. sage_wheels/share/singular/LIB/fpalgebras.lib +1666 -0
  326. sage_wheels/share/singular/LIB/fpaprops.lib +1462 -0
  327. sage_wheels/share/singular/LIB/freegb.lib +3853 -0
  328. sage_wheels/share/singular/LIB/general.lib +1350 -0
  329. sage_wheels/share/singular/LIB/gfan.lib +1768 -0
  330. sage_wheels/share/singular/LIB/gitfan.lib +3130 -0
  331. sage_wheels/share/singular/LIB/gkdim.lib +99 -0
  332. sage_wheels/share/singular/LIB/gmspoly.lib +589 -0
  333. sage_wheels/share/singular/LIB/gmssing.lib +1739 -0
  334. sage_wheels/share/singular/LIB/goettsche.lib +909 -0
  335. sage_wheels/share/singular/LIB/graal.lib +1366 -0
  336. sage_wheels/share/singular/LIB/gradedModules.lib +2541 -0
  337. sage_wheels/share/singular/LIB/graphics.lib +360 -0
  338. sage_wheels/share/singular/LIB/grobcov.lib +7706 -0
  339. sage_wheels/share/singular/LIB/groups.lib +1123 -0
  340. sage_wheels/share/singular/LIB/grwalk.lib +507 -0
  341. sage_wheels/share/singular/LIB/hdepth.lib +194 -0
  342. sage_wheels/share/singular/LIB/help.cnf +57 -0
  343. sage_wheels/share/singular/LIB/hess.lib +1946 -0
  344. sage_wheels/share/singular/LIB/hnoether.lib +4292 -0
  345. sage_wheels/share/singular/LIB/hodge.lib +400 -0
  346. sage_wheels/share/singular/LIB/homolog.lib +1965 -0
  347. sage_wheels/share/singular/LIB/hyperel.lib +975 -0
  348. sage_wheels/share/singular/LIB/inout.lib +679 -0
  349. sage_wheels/share/singular/LIB/integralbasis.lib +6224 -0
  350. sage_wheels/share/singular/LIB/interval.lib +1418 -0
  351. sage_wheels/share/singular/LIB/intprog.lib +778 -0
  352. sage_wheels/share/singular/LIB/invar.lib +443 -0
  353. sage_wheels/share/singular/LIB/involut.lib +980 -0
  354. sage_wheels/share/singular/LIB/jacobson.lib +1215 -0
  355. sage_wheels/share/singular/LIB/kskernel.lib +534 -0
  356. sage_wheels/share/singular/LIB/latex.lib +3146 -0
  357. sage_wheels/share/singular/LIB/lejeune.lib +651 -0
  358. sage_wheels/share/singular/LIB/linalg.lib +2040 -0
  359. sage_wheels/share/singular/LIB/locnormal.lib +212 -0
  360. sage_wheels/share/singular/LIB/lrcalc.lib +526 -0
  361. sage_wheels/share/singular/LIB/makedbm.lib +294 -0
  362. sage_wheels/share/singular/LIB/mathml.lib +813 -0
  363. sage_wheels/share/singular/LIB/matrix.lib +1372 -0
  364. sage_wheels/share/singular/LIB/maxlike.lib +1132 -0
  365. sage_wheels/share/singular/LIB/methods.lib +212 -0
  366. sage_wheels/share/singular/LIB/moddiq.lib +322 -0
  367. sage_wheels/share/singular/LIB/modfinduni.lib +181 -0
  368. sage_wheels/share/singular/LIB/modnormal.lib +218 -0
  369. sage_wheels/share/singular/LIB/modprimdec.lib +1278 -0
  370. sage_wheels/share/singular/LIB/modquotient.lib +269 -0
  371. sage_wheels/share/singular/LIB/modstd.lib +1024 -0
  372. sage_wheels/share/singular/LIB/modular.lib +545 -0
  373. sage_wheels/share/singular/LIB/modules.lib +2561 -0
  374. sage_wheels/share/singular/LIB/modwalk.lib +609 -0
  375. sage_wheels/share/singular/LIB/mondromy.lib +1016 -0
  376. sage_wheels/share/singular/LIB/monomialideal.lib +3851 -0
  377. sage_wheels/share/singular/LIB/mprimdec.lib +2353 -0
  378. sage_wheels/share/singular/LIB/mregular.lib +1863 -0
  379. sage_wheels/share/singular/LIB/multigrading.lib +5629 -0
  380. sage_wheels/share/singular/LIB/ncHilb.lib +777 -0
  381. sage_wheels/share/singular/LIB/ncModslimgb.lib +791 -0
  382. sage_wheels/share/singular/LIB/ncalg.lib +16311 -0
  383. sage_wheels/share/singular/LIB/ncall.lib +31 -0
  384. sage_wheels/share/singular/LIB/ncdecomp.lib +468 -0
  385. sage_wheels/share/singular/LIB/ncfactor.lib +13371 -0
  386. sage_wheels/share/singular/LIB/ncfrac.lib +1023 -0
  387. sage_wheels/share/singular/LIB/nchilbert.lib +448 -0
  388. sage_wheels/share/singular/LIB/nchomolog.lib +759 -0
  389. sage_wheels/share/singular/LIB/ncloc.lib +361 -0
  390. sage_wheels/share/singular/LIB/ncpreim.lib +795 -0
  391. sage_wheels/share/singular/LIB/ncrat.lib +2849 -0
  392. sage_wheels/share/singular/LIB/nctools.lib +1887 -0
  393. sage_wheels/share/singular/LIB/nets.lib +1456 -0
  394. sage_wheels/share/singular/LIB/nfmodstd.lib +1000 -0
  395. sage_wheels/share/singular/LIB/nfmodsyz.lib +732 -0
  396. sage_wheels/share/singular/LIB/noether.lib +1106 -0
  397. sage_wheels/share/singular/LIB/normal.lib +8700 -0
  398. sage_wheels/share/singular/LIB/normaliz.lib +2226 -0
  399. sage_wheels/share/singular/LIB/ntsolve.lib +362 -0
  400. sage_wheels/share/singular/LIB/numerAlg.lib +560 -0
  401. sage_wheels/share/singular/LIB/numerDecom.lib +2261 -0
  402. sage_wheels/share/singular/LIB/olga.lib +1933 -0
  403. sage_wheels/share/singular/LIB/orbitparam.lib +351 -0
  404. sage_wheels/share/singular/LIB/parallel.lib +319 -0
  405. sage_wheels/share/singular/LIB/paraplanecurves.lib +3110 -0
  406. sage_wheels/share/singular/LIB/perron.lib +202 -0
  407. sage_wheels/share/singular/LIB/pfd.lib +2223 -0
  408. sage_wheels/share/singular/LIB/phindex.lib +642 -0
  409. sage_wheels/share/singular/LIB/pointid.lib +673 -0
  410. sage_wheels/share/singular/LIB/polybori.lib +1430 -0
  411. sage_wheels/share/singular/LIB/polyclass.lib +525 -0
  412. sage_wheels/share/singular/LIB/polylib.lib +1174 -0
  413. sage_wheels/share/singular/LIB/polymake.lib +1902 -0
  414. sage_wheels/share/singular/LIB/presolve.lib +1533 -0
  415. sage_wheels/share/singular/LIB/primdec.lib +9576 -0
  416. sage_wheels/share/singular/LIB/primdecint.lib +1782 -0
  417. sage_wheels/share/singular/LIB/primitiv.lib +401 -0
  418. sage_wheels/share/singular/LIB/puiseuxexpansions.lib +1631 -0
  419. sage_wheels/share/singular/LIB/purityfiltration.lib +960 -0
  420. sage_wheels/share/singular/LIB/qhmoduli.lib +1561 -0
  421. sage_wheels/share/singular/LIB/qmatrix.lib +293 -0
  422. sage_wheels/share/singular/LIB/random.lib +455 -0
  423. sage_wheels/share/singular/LIB/ratgb.lib +489 -0
  424. sage_wheels/share/singular/LIB/realclassify.lib +5759 -0
  425. sage_wheels/share/singular/LIB/realizationMatroids.lib +772 -0
  426. sage_wheels/share/singular/LIB/realrad.lib +1197 -0
  427. sage_wheels/share/singular/LIB/recover.lib +2628 -0
  428. sage_wheels/share/singular/LIB/redcgs.lib +3984 -0
  429. sage_wheels/share/singular/LIB/reesclos.lib +465 -0
  430. sage_wheels/share/singular/LIB/resbinomial.lib +2802 -0
  431. sage_wheels/share/singular/LIB/resgraph.lib +789 -0
  432. sage_wheels/share/singular/LIB/resjung.lib +820 -0
  433. sage_wheels/share/singular/LIB/resolve.lib +5110 -0
  434. sage_wheels/share/singular/LIB/resources.lib +170 -0
  435. sage_wheels/share/singular/LIB/reszeta.lib +5473 -0
  436. sage_wheels/share/singular/LIB/ring.lib +1328 -0
  437. sage_wheels/share/singular/LIB/ringgb.lib +343 -0
  438. sage_wheels/share/singular/LIB/rinvar.lib +1153 -0
  439. sage_wheels/share/singular/LIB/rootisolation.lib +1481 -0
  440. sage_wheels/share/singular/LIB/rootsmr.lib +709 -0
  441. sage_wheels/share/singular/LIB/rootsur.lib +886 -0
  442. sage_wheels/share/singular/LIB/rstandard.lib +607 -0
  443. sage_wheels/share/singular/LIB/rwalk.lib +336 -0
  444. sage_wheels/share/singular/LIB/sagbi.lib +1353 -0
  445. sage_wheels/share/singular/LIB/sagbiNormaliz.lib +1622 -0
  446. sage_wheels/share/singular/LIB/sagbiNormaliz0.lib +1498 -0
  447. sage_wheels/share/singular/LIB/sagbigrob.lib +449 -0
  448. sage_wheels/share/singular/LIB/schreyer.lib +321 -0
  449. sage_wheels/share/singular/LIB/schubert.lib +2551 -0
  450. sage_wheels/share/singular/LIB/sets.lib +524 -0
  451. sage_wheels/share/singular/LIB/sheafcoh.lib +1663 -0
  452. sage_wheels/share/singular/LIB/signcond.lib +437 -0
  453. sage_wheels/share/singular/LIB/sing.lib +1094 -0
  454. sage_wheels/share/singular/LIB/sing4ti2.lib +419 -0
  455. sage_wheels/share/singular/LIB/solve.lib +2243 -0
  456. sage_wheels/share/singular/LIB/spcurve.lib +1077 -0
  457. sage_wheels/share/singular/LIB/spectrum.lib +62 -0
  458. sage_wheels/share/singular/LIB/sresext.lib +757 -0
  459. sage_wheels/share/singular/LIB/ssi.lib +143 -0
  460. sage_wheels/share/singular/LIB/standard.lib +2769 -0
  461. sage_wheels/share/singular/LIB/stanleyreisner.lib +473 -0
  462. sage_wheels/share/singular/LIB/stdmodule.lib +547 -0
  463. sage_wheels/share/singular/LIB/stratify.lib +1070 -0
  464. sage_wheels/share/singular/LIB/surf.lib +506 -0
  465. sage_wheels/share/singular/LIB/surf_jupyter.lib +223 -0
  466. sage_wheels/share/singular/LIB/surfacesignature.lib +522 -0
  467. sage_wheels/share/singular/LIB/surfex.lib +1462 -0
  468. sage_wheels/share/singular/LIB/swalk.lib +877 -0
  469. sage_wheels/share/singular/LIB/symodstd.lib +1570 -0
  470. sage_wheels/share/singular/LIB/systhreads.lib +74 -0
  471. sage_wheels/share/singular/LIB/tasks.lib +1324 -0
  472. sage_wheels/share/singular/LIB/tateProdCplxNegGrad.lib +2412 -0
  473. sage_wheels/share/singular/LIB/teachstd.lib +858 -0
  474. sage_wheels/share/singular/LIB/template.lib +116 -0
  475. sage_wheels/share/singular/LIB/toric.lib +1119 -0
  476. sage_wheels/share/singular/LIB/transformation.lib +116 -0
  477. sage_wheels/share/singular/LIB/triang.lib +1197 -0
  478. sage_wheels/share/singular/LIB/tropical.lib +8741 -0
  479. sage_wheels/share/singular/LIB/tropicalEllipticCovers.lib +2922 -0
  480. sage_wheels/share/singular/LIB/tropicalNewton.lib +1128 -0
  481. sage_wheels/share/singular/LIB/tst.lib +1108 -0
  482. sage_wheels/share/singular/LIB/weierstr.lib +241 -0
  483. sage_wheels/share/singular/LIB/zeroset.lib +1478 -0
  484. sage_wheels/share/singular/emacs/.emacs-general +184 -0
  485. sage_wheels/share/singular/emacs/.emacs-singular +234 -0
  486. sage_wheels/share/singular/emacs/COPYING +44 -0
  487. sage_wheels/share/singular/emacs/cmd-cmpl.el +241 -0
  488. sage_wheels/share/singular/emacs/ex-cmpl.el +1681 -0
  489. sage_wheels/share/singular/emacs/hlp-cmpl.el +4318 -0
  490. sage_wheels/share/singular/emacs/lib-cmpl.el +179 -0
  491. sage_wheels/share/singular/emacs/singular.el +4273 -0
  492. sage_wheels/share/singular/emacs/singular.xpm +39 -0
  493. sage_wheels/share/singular/singular.idx +5002 -0
@@ -0,0 +1,1768 @@
1
+ /////////////////////////////////////////////////////////////////////////////
2
+ version="version finitediff.lib 4.1.2.0 Feb_2019 "; // $Id: 9fc46c5f49d8cc06120953f1d4f651b280512da8 $
3
+ category="Teaching";
4
+ info="
5
+ LIBRARY: finitediff.lib procedures to compute finite difference schemes
6
+ for linear differential equations
7
+ AUTHOR: Christian Dingler
8
+
9
+ OVERVIEW:
10
+ @texinfo
11
+ Using @code{qepcad}/@code{qepcadsystem} from this
12
+ library requires the program @code{qepcad} to be installed.
13
+ You can download @code{qepcad} from
14
+ @uref{http://www.usna.edu/CS/qepcadweb/B/QEPCAD.html}
15
+ @end texinfo
16
+
17
+ PROCEDURES:
18
+ visualize(f); shows a scheme in index-notation
19
+ u(D[,#]); gives some vector; depends on @derivatives
20
+ scheme([v1,..,vn]); computes the finite difference scheme defined by v1,..,vn
21
+ laxfrT(Ut,U,space); Lax-Friedrich-approximation for the time-direction
22
+ laxfrX(Ux,U,space); Lax-Friedrich-approximation for the space-direction
23
+ forward(U1,U2,VAR); forward-approximation
24
+ backward(U1,U2,VAR); backward-approximation
25
+ central1st(U1,U2,VAR); central-approximation of first order
26
+ central2nd(U1,U2,VAR); central-approximation of second order
27
+ trapezoid(U1,U2,VAR); trapezoid-approximation
28
+ midpoint(U1,U2,VAR); midpoint-approximation
29
+ pyramid(U1,U2,VAR); pyramid-approximation
30
+ setinitials(variable,der[,#]); constructs and sets the basering for further computations
31
+ errormap(f); performs the Fouriertransformation of a poly
32
+ matrixsystem(M,A); gives the scheme of a pde-system as one matrix
33
+ timestep(M); gives the several timelevels of a scheme derived from a pde-system
34
+ fouriersystem(M,A); performs the Fouriertransformation of a matrix scheme
35
+ PartitionVar(f,n); partitions a poly into the var(n)-part and the rest
36
+ ComplexValue(f); computes the complex value of f, var(1) being the imaginary unit
37
+ VarToPar(f); substitute var(i) by par(i)
38
+ ParToVar(f); substitute par(i) by var(i)
39
+ qepcad(f); ask QEPCAD for equivalent constraints to f<1
40
+ qepcadsystem(l); ask QEPCAD for equivalent constraints to all eigenvals of some matrices being <1
41
+ ";
42
+
43
+ LIB "ring.lib";
44
+ LIB "general.lib";
45
+ LIB "standard.lib";
46
+ LIB "linalg.lib";
47
+ LIB "matrix.lib";
48
+ LIB "polylib.lib";
49
+ LIB "teachstd.lib";
50
+ LIB "qhmoduli.lib";
51
+ ///////////////////////////////////////////////////////////////////////
52
+ static proc getit(module M)
53
+ {
54
+ int nderiv=pos(U,@derivatives);
55
+ def M2=groebner(M);
56
+ module N1=gen(nderiv);
57
+ def N2=intersect(M2,N1);
58
+ def S=N2[1][nderiv];
59
+ return(S);
60
+ }
61
+ ///////////////////////////////////////////////////////////////////////
62
+ proc visualize(poly f)
63
+ "USAGE: visualize(f); f of type poly.
64
+ RETURN: type string; translates the polynomial form of a finite difference scheme into an indexed one as often seen in literature
65
+ EXAMPLE: example visualize; shows an example
66
+ "
67
+ {
68
+ def n=size(f);
69
+ string str;
70
+ intvec v;
71
+ if (n>0)
72
+ {
73
+ int i;
74
+ int j;
75
+ for(i=1;i<=n;i++)
76
+ {
77
+ intvec w=leadexp(f);
78
+ for(j=1;j<=size(@variables);j++)
79
+ {
80
+ v[j]=w[j+1];
81
+ }
82
+ if(i==1)
83
+ {
84
+ str=print(leadcoef(f),"%s")+"*"+"U("+print(v,"%s")+")";
85
+ }
86
+ else
87
+ {
88
+ str=str+"+"+print(leadcoef(f),"%s")+"*"+"U("+print(v,"%s")+")";
89
+ }
90
+ kill w;
91
+ f=f-lead(f);
92
+ }
93
+ }
94
+ return(str);
95
+ }
96
+ example
97
+ {
98
+ "EXAMPLE:";echo=2;
99
+ list D="Ux","Ut","U";
100
+ list P="a";
101
+ list V="t","x";
102
+ setinitials(V,D,P);
103
+ scheme(u(Ut)+a*u(Ux),trapezoid(Ux,U,x),backward(Ut,U,t));
104
+ visualize(_);
105
+ }
106
+
107
+ ///////////////////////////////////
108
+ static proc imageideal()
109
+ {
110
+
111
+ def n=size(@variables)-1;
112
+ ideal IDEAL=var(1),var(2);
113
+ int j;
114
+ for(j=1;j<=n;j++)
115
+ {
116
+ ideal II=var(2+j+n)+var(1)*var(2+2*n+j);
117
+ IDEAL=IDEAL+II;
118
+ kill II;
119
+ }
120
+ return(IDEAL);
121
+ }
122
+ /////////////////////////////////////
123
+ proc u(string D,list #)
124
+ "USAGE: u(D[,#]); D a string that occurs in the list of @derivatives, # an optional list of integers.
125
+ RETURN: type vector; gives the vector, that corresponds with gen(n)*m, where m is the monomial defined by #
126
+ EXAMPLE: example u; shows an example
127
+ "
128
+ {
129
+ def n=size(#);
130
+ def nv=nvars(basering)-1;
131
+ int nn;
132
+ if(nv<=n)
133
+ {
134
+ nn=nv;
135
+ }
136
+ else
137
+ {
138
+ nn=n;
139
+ }
140
+ int index=pos(D,@derivatives);
141
+ poly g=1;
142
+ if(nn>=1)
143
+ {
144
+ int j;
145
+ for(j=1;j<=nn;j++)
146
+ {
147
+ int nnn;
148
+ nnn=int(#[j]);
149
+ g=var(1+j)**nnn*g;
150
+ kill nnn;
151
+ }
152
+ return(gen(index)*g);
153
+ }
154
+ else
155
+ {
156
+ return(gen(index)*g);
157
+ }
158
+ }
159
+ example
160
+ {
161
+ "EXAMPLE:";echo=2;
162
+ list D="Ux","Uy","Ut","U";
163
+ list P="a","b";
164
+ list V="t","x","y";
165
+ setinitials(V,D,P);
166
+ u(Ux);
167
+ u(Ux,2,3,7);
168
+ u(Uy)+u(Ut)-u(Ux);
169
+ u(U)*234-dx*dt*dy*3*u(Uy);
170
+ }
171
+
172
+ /////////////////////////////////////////////////////////
173
+ static proc pos(string D,list L)
174
+ {
175
+ int j;
176
+ int index=-1;
177
+ def n=size(L);
178
+ for(j=1;j<=n;j++)
179
+ {
180
+ if(D==L[j])
181
+ {
182
+ index=j;
183
+ }
184
+ }
185
+ return(index);
186
+ }
187
+ ///////////////////////////////////
188
+ static proc re(list L)
189
+ {
190
+ def n=size(L);
191
+ int j; string s;
192
+ for(j=1;j<=n;j++)
193
+ {
194
+ s="string "+print(L[j],"%s")+"="+"nameof("+print(L[j],"%s")+")"+";";
195
+ execute(s);
196
+ exportto(Top,`L[j]`);
197
+ }
198
+ }
199
+ ///////////////////////////////////////////////
200
+ proc scheme(list #)
201
+ "USAGE: scheme([v1,..,vn]); v1,..,vn of type vector
202
+ RETURN: poly
203
+ PURPOSE: performs substitutions by the means of Groebner basis computation
204
+ of the submodule, generated by the input vectors, then intersects the
205
+ intermediate result with the suitable component in order to get a finite
206
+ difference scheme
207
+ NOTE: works only for a single PDE, for the case of a system use @code{matrixsystem}
208
+ EXAMPLE: example scheme; shows an example
209
+ "
210
+ {
211
+ def N=size(#);
212
+ if(N==0)
213
+ {
214
+ if(defined(M)==1)
215
+ {
216
+ kill M;
217
+ module M;
218
+ }
219
+ else
220
+ {
221
+ module M;
222
+ }
223
+ }
224
+ else
225
+ {
226
+ int j;
227
+ if(defined(M)==1)
228
+ {
229
+ kill M;
230
+ module M;
231
+ for(j=1;j<=N;j++)
232
+ {
233
+ M=M+#[j];
234
+ }
235
+ }
236
+ else
237
+ {
238
+ module M;
239
+ for(j=1;j<=N;j++)
240
+ {
241
+ M=M+#[j];
242
+ }
243
+ }
244
+ }
245
+ def S=getit(M);
246
+ matrix mat[1][1]=S;
247
+ list l=timestep(mat);
248
+ poly f=l[2][1,1];
249
+ return(f);
250
+ }
251
+ example
252
+ {
253
+ "EXAMPLE:";echo=2;
254
+ list D="Ux","Ut","U";
255
+ list P="a";
256
+ list V="t","x";
257
+ setinitials(V,D,P);
258
+ def s1=scheme(u(Ut)+a*u(Ux),backward(Ux,U,x),forward(Ut,U,t));
259
+ s1;
260
+ }
261
+ ////////////////////////
262
+ static proc diffpar(poly ff)
263
+ {
264
+ def gg=print(ff,"%s");
265
+ def str="d"+gg;
266
+ return(`str`);
267
+ }
268
+ ////////////////////////
269
+ proc laxfrT(string Ut, string U, poly space)
270
+ "USAGE: laxfrT(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
271
+ RETURN: type vector; gives a predefined approximation of the Lax-Friedrich-approximation for the derivation in the timevariable as often used in literature;
272
+ NOTE: see also laxfrX, setinitials, scheme; Warning: laxfrT is not to be interchanged with laxfrX
273
+ EXAMPLE: example laxfrT; shows an example
274
+ "
275
+ {
276
+ poly time=var(2);
277
+ poly dtime=diffpar(time);
278
+ poly dspace=diffpar(space);
279
+ def v=dtime*space*u(Ut)-time*space*u(U)+1/2*(space**2*u(U)+u(U));
280
+ return(v);
281
+ }
282
+ example
283
+ {
284
+ "EXAMPLE:";echo=2;
285
+ list D="Ux","Ut","U";
286
+ list P="a";
287
+ list V="t","x";
288
+ setinitials(V,D,P);
289
+ laxfrT(Ux,U,x);
290
+ }
291
+ ////////////////////////
292
+ proc laxfrX(string Ux, string U, poly space)
293
+ "USAGE: laxfrX(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
294
+ RETURN: type vector; gives a predefined approximation of the Lax-Friedrich-approximation for the derivation in one of the spatial variables as often used in literature;
295
+ NOTE: see also laxfrT, setinitials, scheme; Warning: laxfrX is not to be interchanged with laxfrT
296
+ EXAMPLE: example laxfrX; shows an example
297
+ "
298
+ {
299
+ poly dspace = diffpar(space);
300
+ def v=2*dspace*space*u(Ux)-(space**2-1)*u(U);
301
+ return(v);
302
+ }
303
+ example
304
+ {
305
+ "EXAMPLE:";echo=2;
306
+ list D="Ux","Ut","U";
307
+ list P="a";
308
+ list V="t","x";
309
+ setinitials(V,D,P);
310
+ laxfrX(Ux,U,x);
311
+ }
312
+ ////////////////////////
313
+ proc forward(string U1,string U2,poly VAR)
314
+ "USAGE: forward(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
315
+ RETURN: type vector; gives a predefined approximation of the forward approximation as often used in literature;
316
+ NOTE: see also laxfrT,setinitials,scheme;
317
+ EXAMPLE: example forward; shows an example
318
+ "
319
+ {
320
+ if(pos(U1,@derivatives)<pos(U2,@derivatives))
321
+ {
322
+ def V1=U1;
323
+ def V2=U2;
324
+ }
325
+ else
326
+ {
327
+ def V1=U2;
328
+ def V2=U1;
329
+ }
330
+ def v=diffpar(VAR)*u(V1)+u(V2)-VAR*u(V2);
331
+ return(v);
332
+ }
333
+ example
334
+ {
335
+ "EXAMPLE:";echo=2;
336
+ list D="Ut","Ux","Uy","U";
337
+ list V="t","x","y";
338
+ list P="a","b";
339
+ setinitials(V,D,P);
340
+ forward(Ux,U,x);
341
+ forward(Uy,U,y);
342
+ forward(Ut,U,t);
343
+ }
344
+ ///////////////////////
345
+ proc backward(string U1,string U2,poly VAR)
346
+ "USAGE: backward(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
347
+ RETURN: type vector; gives a predefined approximation of the backward approximation as often used in literature;
348
+ NOTE: see also forward,laxfrT,setinitials,scheme;
349
+ EXAMPLE: example backward; shows an example
350
+ "
351
+ {
352
+ if(pos(U1,@derivatives)<pos(U2,@derivatives))
353
+ {
354
+ def V1=U1;
355
+ def V2=U2;
356
+ }
357
+ else
358
+ {
359
+ def V1=U2;
360
+ def V2=U1;
361
+ }
362
+ def v=diffpar(VAR)*VAR*u(V1)+u(V2)-VAR*u(V2);
363
+ return(v);
364
+ }
365
+ example
366
+ {
367
+ "EXAMPLE:";echo=2;
368
+ list D="Ut","Ux","Uy","U";
369
+ list V="t","x","y";
370
+ list P="a","b";
371
+ setinitials(V,D,P);
372
+ backward(Ux,U,x);
373
+ backward(Uy,U,y);
374
+ backward(Ut,U,t);
375
+ }
376
+ /////////////////////////////
377
+ proc central1st(string U1,string U2,poly VAR)
378
+ "USAGE: central1st(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
379
+ RETURN: type vector; gives a predefined approximation of the first-order-central-approximation as often used in literature;
380
+ NOTE: see also forward,laxfrT,setinitials,scheme;
381
+ EXAMPLE: example central1st; shows an example
382
+ "
383
+ {
384
+ if(pos(U1,@derivatives)<pos(U2,@derivatives))
385
+ {
386
+ def V1=U1;
387
+ def V2=U2;
388
+ }
389
+ else
390
+ {
391
+ def V1=U2;
392
+ def V2=U1;
393
+ }
394
+ def v=2*diffpar(VAR)*VAR*u(V1)+u(V2)-VAR**2*u(V2);
395
+ return(v);
396
+ }
397
+ example
398
+ {
399
+ "EXAMPLE:";echo=2;
400
+ list D="Ut","Ux","Uy","U";
401
+ list V="t","x","y";
402
+ list P="a","b";
403
+ setinitials(V,D,P);
404
+ central1st(Ux,U,x);
405
+ central1st(Uy,U,y);
406
+ }
407
+ ////////////////////////////////
408
+ proc central2nd(string U1,string U2,poly VAR)
409
+ "USAGE: central2nd(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
410
+ RETURN: type vector; gives a predefined approximation of the second-order-central-approximation as often used in literature;
411
+ NOTE: see also forward,laxfrT,setinitials,scheme;
412
+ EXAMPLE: example central2nd; shows an example
413
+ "
414
+ {
415
+ if(pos(U1,@derivatives)<pos(U2,@derivatives))
416
+ {
417
+ def V1=U1;
418
+ def V2=U2;
419
+ }
420
+ else
421
+ {
422
+ def V1=U2;
423
+ def V2=U1;
424
+ }
425
+ def v=diffpar(VAR)**2*VAR*u(V1)-(VAR**2*u(V2)-2*VAR*u(V2)+u(V2));
426
+ return(v);
427
+ }
428
+ example
429
+ {
430
+ "EXAMPLE:";echo=2;
431
+ list D="Uxx","Ux","Utt","Ut","U";
432
+ list P="lambda";
433
+ list V="t","x";
434
+ setinitials(V,D,P);
435
+ central2nd(Uxx,U,x);
436
+ central2nd(Utt,U,t);
437
+ }
438
+ /////////////////////////////////
439
+ proc trapezoid(string U1,string U2,poly VAR)
440
+ "USAGE: trapezoid(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
441
+ RETURN: type vector; gives a predefined approximation of the trapezoid-approximation as often used in literature;
442
+ NOTE: see also forward,laxfrT,setinitials,scheme;
443
+ EXAMPLE: example trapezoid; shows an example
444
+ "
445
+ {
446
+ if(pos(U1,@derivatives)<pos(U2,@derivatives))
447
+ {
448
+ def V1=U1;
449
+ def V2=U2;
450
+ }
451
+ else
452
+ {
453
+ def V1=U2;
454
+ def V2=U1;
455
+ }
456
+ def v=1/2*diffpar(VAR)*(VAR+1)*u(V1)+(1-VAR)*u(V2);
457
+ return(v);
458
+ }
459
+ example
460
+ {
461
+ "EXAMPLE:";echo=2;
462
+ list D="Uxx","Ux","Utt","Ut","U";
463
+ list P="lambda";
464
+ list V="t","x";
465
+ setinitials(V,D,P);
466
+ trapezoid(Uxx,Ux,x);
467
+ trapezoid(Ux,U,x);
468
+ }
469
+ ///////////////////////////////////
470
+ proc midpoint(string U1,string U2,poly VAR)
471
+ "USAGE: midpoint(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
472
+ RETURN: type vector; gives a predefined approximation of the midpoint-approximation as often used in literature;
473
+ NOTE: see also forward,laxfrT,setinitials,scheme;
474
+ EXAMPLE: example midpoint; shows an example
475
+ "
476
+ {
477
+ if(pos(U1,@derivatives)<pos(U2,@derivatives))
478
+ {
479
+ def V1=U1;
480
+ def V2=U2;
481
+ }
482
+ else
483
+ {
484
+ def V1=U2;
485
+ def V2=U1;
486
+ }
487
+ def v=2*diffpar(VAR)*VAR*u(V1)+(1-VAR**2)*u(V2);
488
+ return(v);
489
+ }
490
+ example
491
+ {
492
+ "EXAMPLE:";echo=2;
493
+ list D="Uxx","Ux","Utt","Ut","U";
494
+ list P="lambda";
495
+ list V="t","x";
496
+ setinitials(V,D,P);
497
+ midpoint(Ux,U,x);
498
+ }
499
+ //////////////////////////////////////
500
+ proc pyramid(string U1,string U2,poly VAR)
501
+ "USAGE: pyramid(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
502
+ RETURN: type vector; gives a predefined approximation of the pyramid-approximation as often used in literature;
503
+ NOTE: see also forward,laxfrT,setinitials,scheme;
504
+ EXAMPLE: example pyramid; shows an example
505
+ "
506
+ {
507
+ if(pos(U1,@derivatives)<pos(U2,@derivatives))
508
+ {
509
+ def V1=U1;
510
+ def V2=U2;
511
+ }
512
+ else
513
+ {
514
+ def V1=U2;
515
+ def V2=U1;
516
+ }
517
+ def v=1/3*diffpar(VAR)*(VAR**2+VAR+1)*u(V1)+(VAR-VAR**3)*u(V2);
518
+ return(v);
519
+ }
520
+ example
521
+ {
522
+ "EXAMPLE:";echo=2;
523
+ list D="Uxx","Ux","Utt","Ut","U";
524
+ list P="lambda";
525
+ list V="t","x";
526
+ setinitials(V,D,P);
527
+ pyramid(Ux,U,x);
528
+ }
529
+ //////////////////////////////////////////////
530
+ proc setinitials(list variable, list der,list #)
531
+ "USAGE: setinitials(V,D[,P]); V,D,P are lists with strings as elements
532
+ RETURN: no return value: sets the dependence order of the occuring derivatives,
533
+ constructs the suitable ring to compute in containing user chosen parameters, sets new basering
534
+ NOTE: P is optional, used to introduce some additional parameters into the ring. The Sine and
535
+ Cosine values needed for the fourier transformation are symbolically introduced under the names
536
+ string(c)+nameof(variable), i.e. if x is any spatial variable then cx:=cosine(dx*ksi), when
537
+ regarding the fourier transform after ksi (for sine respectively). Artificial parameters I,T,Px,Py
538
+ are introduced for the later eigenvalue analysis. Variables can be transformed into parameters
539
+ of similar name
540
+ EXAMPLE: example setinitials; shows an example
541
+ "
542
+ {
543
+ def LV=variable;
544
+ def @variables=variable;
545
+ def @derivatives=der;
546
+ export(@variables);
547
+ export(@derivatives);
548
+ re(der);
549
+ int j;
550
+ string dvar="d"+print(LV[1],"%s");
551
+ dvar=dvar+","+"d"+print(LV[2],"%s");
552
+ string pvar="P"+print(LV[2],"%s");
553
+ string COS="C"+print(LV[2],"%s");
554
+ string SIN="S"+print(LV[2],"%s");
555
+ for(j=3;j<=size(LV);j++)
556
+ {
557
+ dvar=dvar+","+"d"+print(LV[j],"%s");
558
+ pvar=pvar+","+"P"+print(LV[j],"%s");
559
+ COS=COS+","+"C"+print(LV[j],"%s");
560
+ SIN=SIN+","+"S"+print(LV[j],"%s");
561
+ }
562
+ string scf="(0,"+"I,"+"T,"+pvar+","+COS+","+SIN+","+print(#,"%s")+","+dvar+")"; //coefficient_field
563
+ string svars="(i";
564
+ kill j;
565
+ int j;
566
+ for(j=1;j<=size(LV);j++)
567
+ {
568
+ svars=svars+","+print(LV[j],"%s");
569
+ }
570
+ string cosine;
571
+ string sine;
572
+ kill j;
573
+ int j;
574
+ cosine="c"+print(LV[2],"%s");
575
+ sine="s"+print(LV[2],"%s");
576
+ for(j=3;j<=size(LV);j++)
577
+ {
578
+ cosine=cosine+","+"c"+print(LV[j],"%s");
579
+ sine=sine+","+"s"+print(LV[j],"%s");
580
+ }
581
+ kill j;
582
+ string strvar=cosine+","+sine+")";
583
+ svars=svars+","+strvar; ////variables
584
+ string sord="(c,lp)"; ////ordering
585
+ ring Q = create_ring(scf, svars, sord);
586
+ ideal Id=i**2+1;
587
+ int j;
588
+ for(j=1;j<=size(LV)-1;j++)
589
+ {
590
+ ideal II=var(2+j+size(LV)-1)**2+var(2+j+2*(size(LV)-1))**2-1;
591
+ Id=Id+II;
592
+ kill II;
593
+ }
594
+ if(defined(basering)==1)
595
+ {
596
+ kill basering;
597
+ }
598
+ qring R=std(Id);
599
+ setring R;
600
+ // comment by VL: it's better to return this ring! causes many changes
601
+ // across the library
602
+ export(R);
603
+ }
604
+ example
605
+ {
606
+ "EXAMPLE:"; echo = 2;
607
+ list D="Ut","Ux","Uy","U";
608
+ list V="t","x","y";
609
+ list P="alpha","beta","gamma";
610
+ setinitials(V,D,P);////does not show the ring, since there is no output
611
+ basering;///does show the ring
612
+ }
613
+ ////////////////////////////
614
+ proc errormap(poly f)
615
+ "USAGE: errormap(f); f of type poly
616
+ RETURN: type poly; performs the fouriertransformation of a single polynomial
617
+ EXAMPLE: example errormap; shows an example
618
+ "
619
+ {
620
+ ideal Id=imageideal();
621
+ map phi=R,Id;
622
+ def g=phi(f);
623
+ g=reduce(g,std(0));
624
+ return(g);
625
+ }
626
+ example
627
+ {
628
+ "EXAMPLE";echo=2;
629
+ list D="Ux","Ut","U";
630
+ list P="a";
631
+ list V="t","x";
632
+ setinitials(V,D,P);
633
+ scheme(u(Ut)+a*u(Ux),central1st(Ux,U,x),backward(Ut,U,t));
634
+ errormap(_);
635
+ }
636
+ /////////////////////////////////////
637
+ static proc stepmatrix(int n, poly f)
638
+ {
639
+ int spavars=size(@variables)-1;
640
+ int range=n*spavars;
641
+ if(f==0)
642
+ {
643
+ return(unitmat(range));
644
+ }
645
+ matrix M[range][range];
646
+ int length=size(f);
647
+ intvec max=maxexp(f);
648
+ int i;
649
+ intvec shiftback;
650
+ intvec vzero;
651
+ intvec vmax;
652
+ intvec shiftforward;
653
+ for(i=1;i<=size(max);i++)
654
+ {
655
+ shiftback[i]=int(floor(max[i]/2));
656
+ vzero[i]=0;
657
+ vmax[i]=n-1;
658
+ shiftforward[i]=0;
659
+ }
660
+ kill i;
661
+ int i;
662
+ for(i=1;i<=range;i++)
663
+ {
664
+ poly g=f;
665
+ }
666
+ kill i;
667
+ }
668
+ //////////////////////////////////////
669
+ static proc floor(n)
670
+ {
671
+ number h1=numerator(n);
672
+ number h2=denominator(n);
673
+ return((h1- (h1 mod h2))/h2);
674
+ }
675
+ /////////////////////////////////////
676
+ static proc maxexp(poly f)
677
+ {
678
+ int length=size(f);
679
+ poly g=f;
680
+ intvec v;
681
+ int i;
682
+ for(i=1;i<size(@variables);i++)
683
+ {
684
+ v[i]=leadexp(g)[i+2];
685
+ }
686
+ while(g!=0)
687
+ {
688
+ int j;
689
+ for(j=1;j<size(@variables);j++)
690
+ {
691
+ v[j]=maximal(leadexp(g)[j+2],v[j]);
692
+ g=g-lead(g);
693
+ }
694
+ kill j;
695
+ }
696
+ return(v);
697
+ }
698
+ ////////////////////////////////////
699
+ static proc maximal(int n1,int n2)
700
+ {
701
+ if(n1>n2)
702
+ {
703
+ return(n1);
704
+ }
705
+ else
706
+ {
707
+ return(n2);
708
+ }
709
+ }
710
+ ////////////////////////////////////
711
+ static proc minimal(int n1, int n2)
712
+ {
713
+ return(-maximal(-n1,-n2));
714
+ }
715
+ ////////////////////////////////////
716
+ static proc MatrixEntry(int n, intvec v)
717
+ {
718
+ int j;
719
+ int entry;
720
+ int spavar=size(@variables)-1;
721
+ for(j=1;j<=spavar;j++)
722
+ {
723
+ entry=entry+v[j]*n**(spavar-j);
724
+ }
725
+ entry=entry+1;
726
+ return(entry);
727
+ }
728
+ //////////////////////////////////
729
+ static proc CompareVec(intvec ToTest, intvec Reference)//1 if ToTest>=Reference, 0 else
730
+ {
731
+ int i;
732
+ for(i=1;i<=size(@variables)-1;i++)
733
+ {
734
+ if(ToTest[i+2]<Reference[i])
735
+ {
736
+ return(0);
737
+ }
738
+ }
739
+ return(1);
740
+ }
741
+ /////////////////////////////////
742
+ static proc MaxVecZero(intvec ToTest, intvec Reference) //KGV, size=size(input)
743
+ {
744
+ int length=size(ToTest);
745
+ int i;
746
+ intvec Maximum;
747
+ for(i=1;i<=length;i++)
748
+ {
749
+ Maximum[i]=maximal(ToTest[i],Reference[i]);
750
+ }
751
+ return(Maximum);
752
+ }
753
+ //////////////////////////////////
754
+ proc matrixsystem(list Matrices,list Approx)
755
+ "USAGE: matrixsystem(M,A); where the M=Mt,M1,..,Mn is a list with square matrices of the same dimension as entries, and A=At,A1,..,An gives the corresponding approximations for the several variables (t,x1,..,xn) as vector. Intended to solve Mt*U_t + M1*U_x1+..+Mn*U_xn=0 as a linear sytem of partial differential equations numerically by a finite difference scheme;
756
+ RETURN: type matrix; gives back the matrices B1,B2 that represent the finite difference scheme, partitioned into different time levels in the form: B1*U(t=N)=B2*U(t<N), where N is the maximal occurring degree (timelevel) of t.
757
+ EXAMPLE: example matrixsystem; shows an example
758
+ "
759
+ {
760
+ if(size(Matrices)>size(@variables) or size(Matrices)!=size(Approx))
761
+ {
762
+ ERROR("Check number of variables: it must hold #(matrices)<= #(spatial variables)+1 !!! ");
763
+ }
764
+ if(size(Matrices)!=size(Approx))
765
+ {
766
+ ERROR("Every variable needs EXACTLY ONE approximation rule, i.e. #(first argument) =#(second argument) ! ");
767
+ }
768
+ ideal Mon=leadmonomial(Approx[1]);
769
+ int N=size(Matrices);
770
+ int i;
771
+ for(i=2;i<=N;i++)
772
+ {
773
+ Mon=Mon,leadmonomial(Approx[i]);
774
+ }
775
+ kill i;
776
+ poly LCM=lcm(Mon);
777
+ matrix M[nrows(Matrices[1])][ncols(Matrices[1])];
778
+ int i;
779
+ for(i=1;i<=size(Matrices);i++)
780
+ {
781
+ M=M+(LCM/leadmonomial(Approx[i]))*normalize(Approx[i])[size(@derivatives)]*Matrices[i];
782
+ }
783
+ kill i;
784
+ return(M);
785
+ }
786
+ example
787
+ {
788
+ "EXAMPLE:";echo=2;
789
+ list D="Ut","Ux","Uy","U";
790
+ list V="t","x","y";
791
+ list P="a","b";
792
+ setinitials(V,D,P);
793
+ list Mat=unitmat(2),unitmat(2);
794
+ list Appr=forward(Ut,U,t),forward(Ux,U,x);
795
+ matrixsystem(Mat,Appr);
796
+ }
797
+ //////////////////////////////////
798
+ proc timestep(matrix M)
799
+ "USAGE: timestep(M); M a square matrix with polynomials over the basering as entries;
800
+ RETURN: type list; gives two matrices M1,M2 that are the splitting of M with respect to the degree of the variable t in the entries, where the first list-entry M1 consists of the polynomials of the highest timelevel and M2 of the lower levels in the form: M=0 => M1=M2, i.e. M1-M2=M
801
+ NOTE: intended to be used for the finite-difference-scheme-construction and partition into the several time steps
802
+ EXAMPLE: example timestep; shows an example
803
+ "
804
+ {
805
+ int N=nrows(M);
806
+ int i;
807
+ int maxdegT;
808
+ for(i=1;i<=N;i++)
809
+ {
810
+ int j;
811
+ for(j=1;j<=N;j++)
812
+ {
813
+ poly f=M[i,j];
814
+ int k;
815
+ for(k=1;k<=size(f);k++)
816
+ {
817
+ if(leadexp(M[i,j])[2]>maxdegT)
818
+ {
819
+ maxdegT=leadexp(M[i,j])[2];
820
+ }
821
+ f=f-lead(f);
822
+ }
823
+ kill f;
824
+ kill k;
825
+ }
826
+ kill j;
827
+ }
828
+ kill i;
829
+ matrix highT[nrows(M)][nrows(M)];
830
+ vector leftside=0;
831
+ int GenIndex=0;
832
+ int i;
833
+ for(i=1;i<=N;i++)
834
+ {
835
+ int j;
836
+ for(j=1;j<=N;j++)
837
+ {
838
+ poly f=M[i,j];
839
+ int k;
840
+ for(k=1;k<=size(f)+1;k++)
841
+ {
842
+ if(leadexp(f)[2]==maxdegT)
843
+ {
844
+ GenIndex++;
845
+ highT[i,j]=highT[i,j]+lead(f);
846
+ leftside=leftside+highT[i,j]*gen(GenIndex);
847
+ }
848
+ f=f-lead(f);
849
+ }
850
+ kill k;
851
+ kill f;
852
+ }
853
+ kill j;
854
+ }
855
+ kill i;
856
+ matrix tUpper=highT;
857
+ matrix tLower=-1*(M-tUpper);
858
+ tUpper=tUpper/content(leftside);
859
+ tLower=tLower/content(leftside);
860
+ list L=tUpper,tLower;
861
+ return(L);
862
+ }
863
+ example
864
+ {
865
+ "EXAMPLE:"; echo=2;
866
+ list D="Ut","Ux","Uy","U";
867
+ list V="t","x","y";
868
+ list P="a","b";
869
+ setinitials(V,D,P);
870
+ list Mat=unitmat(2),unitmat(2);
871
+ list Apr=forward(Ut,U,t),forward(Ux,U,x);
872
+ matrixsystem(Mat,Apr);
873
+ timestep(_);
874
+ }
875
+ //////////////////////////////////
876
+ proc fouriersystem(list Matrices, list Approx)
877
+ "USAGE: fouriersystem(M,A); M a list of matrices, A a list of approximations;
878
+ RETURN: type list; each entry is some matrix obtained by performing the substitution of the single approximations into the system of pde's, partitioning the equation into the several timesteps and fouriertransforming these parts
879
+ EXAMPLE: example fouriersystem; shows an example
880
+ "
881
+ {
882
+ matrix M=matrixsystem(Matrices,Approx);
883
+ matrix T1=timestep(M)[1];
884
+ matrix T0=timestep(M)[2];
885
+ int i;
886
+ for(i=1;i<=nrows(M);i++)
887
+ {
888
+ int j;
889
+ for(j=1;j<=nrows(M);j++)
890
+ {
891
+ T1[i,j]=errormap(T1[i,j]);
892
+ T1[i,j]=VarToPar(T1[i,j]);
893
+ T0[i,j]=errormap(T0[i,j]);
894
+ T0[i,j]=VarToPar(T0[i,j]);
895
+ }
896
+ kill j;
897
+ }
898
+ kill i;
899
+ ideal EV1=eigenvals(T1)[1];
900
+ ideal EV0=eigenvals(T0)[1];
901
+ list L=list(T1,T0),list(EV1,EV0);
902
+ def N1=size(EV1);
903
+ def N0=size(EV0);
904
+ list CV1;
905
+ list CV0;
906
+ int i;
907
+ for(i=1;i<=N1;i++)
908
+ {
909
+ CV1[i]=VarToPar(EV1[i]);
910
+ if(content(CV1[i])==CV1[i])
911
+ {
912
+ CV1[i]=content(CV1[i]);
913
+ CV1[i]=VarToPar(ComplexValue(numerator(CV1[i])))/VarToPar(ComplexValue(denominator(CV1[i])));
914
+ }
915
+ }
916
+ kill i;
917
+ int i;
918
+ for(i=1;i<=N0;i++)
919
+ {
920
+ CV0[i]=VarToPar(EV0[i]);
921
+ if(content(CV0[i])==CV0[i])
922
+ {
923
+ CV0[i]=content(CV0[i]);
924
+ CV0[i]=VarToPar(ComplexValue(numerator(CV0[i])))/VarToPar(ComplexValue(denominator(CV0[i])));
925
+ }
926
+ }
927
+ kill i;
928
+ list CV=list(CV1,CV0);
929
+ L=L,CV;
930
+ return(L);
931
+ }
932
+ example
933
+ {
934
+ "EXAMPLE:"; echo = 2;
935
+ list D="Ut","Ux","Uy","U";
936
+ list V="t","x","y";
937
+ list P="a","b";
938
+ setinitials(V,D,P);
939
+ matrix M[2][2]=0,-a,-a,0;
940
+ list Mat=unitmat(2),M;
941
+ list Appr=forward(Ut,U,t),trapezoid(Ux,U,x);
942
+ def s=fouriersystem(Mat,Appr);s;
943
+ }
944
+ //////////////////////////////////
945
+ proc PartitionVar(poly f,int n)
946
+ "USAGE: PartitionVar(f); f a poly in the basering;
947
+ RETURN: type poly; gives back a list L=f1,f2 obtained by the partition of f into two parts f1,f2 with deg_var_n(f1) >0 deg_var_n(f2)=0
948
+ EXAMPLE: example PartitionVar; shows an example
949
+ "
950
+ {
951
+ if(n>=nvars(basering))
952
+ {
953
+ ERROR("this variable does not exist in the current basering");
954
+ }
955
+ int i;
956
+ poly partition=0;
957
+ poly g=f;
958
+ for(i=1;i<=size(f);i++)
959
+ {
960
+ if(leadexp(g)[n]!=0)
961
+ {
962
+ partition=partition+lead(g);
963
+ }
964
+ g=g-lead(g);
965
+ }
966
+ list L=partition,f-partition;
967
+ return(L);
968
+ }
969
+ example
970
+ {
971
+ "EXAMPLE:"; echo = 2;
972
+ list D="Ut","Ux","Uy","U";
973
+ list V="t","x","y";
974
+ list P="a","b";
975
+ setinitials(V,D,P);////does not show the ring, since there is no output
976
+ basering;///does show the ring
977
+ poly f=t**3*cx**2-cy**2*dt+i**3*sx;
978
+ PartitionVar(f,1); ////i is the first variable
979
+ }
980
+ //////////////////////////////////
981
+ proc ComplexValue(poly f)
982
+ "USAGE: ComplexValue(f); f a poly in the basering;
983
+ RETURN: type poly; gives back the formal complex-value of f, where var(1) is redarded as the imaginary unit. Does only make sense, if the proc <setinitials> is executed before -> nvars <= npars
984
+ EXAMPLE: example ComplexValue; shows an example
985
+ "
986
+ {
987
+ poly g=ParToVar(f);
988
+ def L=PartitionVar(g,1);
989
+ poly f1=subst(L[1],var(1),1);
990
+ poly f2=L[2];
991
+ poly result=reduce(f1**2+f2**2,std(0));
992
+ return(result);
993
+ }
994
+ example
995
+ {
996
+ "EXAMPLE:"; echo = 2;
997
+ list D="Ut","Ux","Uy","U";
998
+ list V="t","x","y";
999
+ list P="a","b";
1000
+ setinitials(V,D,P);////does not show the ring, as there is no output
1001
+ basering;///does show the ring
1002
+ poly f=t**3*cx**2-cy**2*dt+i**3*sx;
1003
+ f;
1004
+ ComplexValue(f);
1005
+ }
1006
+ //////////////////////////////////
1007
+ proc VarToPar(poly f)
1008
+ "USAGE: VarToPar(f); f a poly in the basering;
1009
+ RETURN: type poly; gives back the poly obtained by substituting var(i) by par(i), for all variables. Does only make sense, if the proc <setinitials> is executed before -> nvars <= npars;
1010
+ EXAMPLE: example VarToPar; shows an example
1011
+ "
1012
+ {
1013
+ int N=nvars(basering);
1014
+ int i;
1015
+ def g=f;
1016
+ for(i=1;i<=N;i++)
1017
+ {
1018
+ g=subst(g,var(i),par(i));
1019
+ }
1020
+ return(g);
1021
+ }
1022
+ example
1023
+ {
1024
+ "EXAMPLE:"; echo = 2;
1025
+ list D="Ut","Ux","Uy","U";
1026
+ list V="t","x","y";
1027
+ list P="a","b";
1028
+ setinitials(V,D,P);////does not show the ring, as there is no output
1029
+ basering;///does show the ring
1030
+ poly f=t**3*cx**2-cy**2*dt+i**3*sx;
1031
+ f;
1032
+ VarToPar(f);
1033
+ }
1034
+ /////////////////////////////////////
1035
+ proc ParToVar(poly f)
1036
+ "USAGE: ParToVar(f); f a poly in the basering;
1037
+ RETURN: type poly; gives back the poly obtained by substituting par(i) by var(i), for the first nvars(basering parameters. Does only make sense, if setinitials is executed before -> nvars <= npars. Is the opposite action to VarToPar, see example ParToVar;
1038
+ EXAMPLE: example ParToVar; shows an example
1039
+ "
1040
+ {
1041
+ int N=nvars(basering);
1042
+ int i;
1043
+ number g=number(VarToPar(f));
1044
+ number denom=denominator(g);
1045
+ g=denom*g;
1046
+ def gg=subst(g,par(1),var(1));
1047
+ for(i=2;i<=N;i++)
1048
+ {
1049
+ gg=subst(gg,par(i),var(i));
1050
+ }
1051
+ return(gg/denom);
1052
+ }
1053
+ example
1054
+ {
1055
+ "EXAMPLE:"; echo = 2;
1056
+ list D="Ut","Ux","Uy","U";
1057
+ list V="t","x","y";
1058
+ list P="a","b";
1059
+ setinitials(V,D,P);////does not show the ring, as there is no output
1060
+ basering;///does show the ring
1061
+ poly f=t**3*cx**2-cy**2*dt+i**3*sx/dt*dx;
1062
+ f;
1063
+ def g=VarToPar(f);
1064
+ g;
1065
+ def h=ParToVar(g);
1066
+ h==f;
1067
+ }
1068
+ /////////////////////////////////////////
1069
+ proc qepcad(poly f)
1070
+ "USAGE: qepcad(f); f a poly in the basering;
1071
+ RETURN: type list; gives back some constraints that are equivalent to f<1 (computed by QEPCAD);
1072
+ EXAMPLE: example qepcad; shows an example
1073
+ "
1074
+ {
1075
+ // how to test, whether QEPCAD is installed?
1076
+ createQCfilter(); // creates/overwrites qepcadfilter.pl
1077
+ system("sh","rm -f QEPCAD-out");
1078
+ system("sh","rm -f QEPCAD-in");
1079
+ if(denominator(content(f))==1)
1080
+ {
1081
+ poly g=f-1;
1082
+ }
1083
+ else
1084
+ {
1085
+ if(f==content(f))
1086
+ {
1087
+ poly g=f*denominator(content(f))-1*denominator(content(f));
1088
+ g=ParToVar(g);
1089
+ g=reduce(g,std(0));
1090
+ }
1091
+ else
1092
+ {
1093
+ poly g=cleardenom(f)-1/content(f);
1094
+ g=ParToVar(g);
1095
+ g=reduce(g,std(0));
1096
+ }
1097
+ }
1098
+ string in="QEPCAD-in";
1099
+ string out="QEPCAD-out";
1100
+ link l1=in;
1101
+ link l2=out;
1102
+ string s1="[trial]"; //description
1103
+ string s2=varlist(); //the variables
1104
+ string s3=nfreevars(); //number of free variables
1105
+ string s4=aquantor()+"["+writepoly(g)+rel()+"]."; //the input prenex formula
1106
+ string s5=projection();
1107
+ string s6=projection();
1108
+ string s7=choice();
1109
+ string s8=solution();
1110
+ write(l1,s1,s2,s3,s4,s5,s6,s7,s8);
1111
+ system("sh","qepcad < QEPCAD-in | qepcadfilter.pl > QEPCAD-out");
1112
+ string output=read(out);
1113
+ print(output,"%s");
1114
+ if(size(output)==0)
1115
+ {
1116
+ return("Try manually"); //maybe too few cells
1117
+ }
1118
+ if(find(output,"FALSE")!=0)
1119
+ {
1120
+ return("FALSE");
1121
+ }
1122
+ if(find(output,"WARNING")!=0)
1123
+ {
1124
+ return("WARNING! Try manually");
1125
+ }
1126
+ else
1127
+ {
1128
+ string strpolys=findthepoly(output);
1129
+ list lpolys=listpolynew(strpolys);
1130
+ return(lpolys);
1131
+ }
1132
+ system("sh","rm -f QEPCAD-out");
1133
+ system("sh","rm -f QEPCAD-in");
1134
+
1135
+ }
1136
+ example
1137
+ {
1138
+ "EXAMPLE:"; echo = 2;
1139
+ list D="Ux","Ut","U";
1140
+ list P="a";
1141
+ list V="t","x";
1142
+ setinitials(V,D,P);
1143
+ def s1=scheme(u(Ut)+a*u(Ux),laxfrX(Ux,U,x),laxfrT(Ut,U,x));
1144
+ s1;
1145
+ def s2=errormap(s1);
1146
+ s2;
1147
+ def s3=ComplexValue(s2);s3;
1148
+ qepcad(s3);
1149
+ }
1150
+ ///////////////////////////////////////////
1151
+ proc createQCfilter()
1152
+ {
1153
+ // writes the following to the file qepcadfilter.pl
1154
+ // is there already such a file? remove it!
1155
+ system("sh","rm -f qepcadfilter.pl");
1156
+ link l=":w qepcadfilter.pl";
1157
+ write(l, "#!/usr/bin/perl");
1158
+ write(l, "$flag = 0;");
1159
+ write(l, "$res = \"\";");
1160
+ write(l,"while(<>)");
1161
+ write(l,"{ if ($_ =~ /Warning|WARNING|warning|Error|error|ERROR/) { print $_; }");
1162
+ write(l,"elsif ($_ =~ /An\ equivalent/) { $flag = 1; }");
1163
+ write(l,"elsif ($flag == 1 && $_ ne \"\n\") { print $_; $flag = 0; } }");
1164
+ }
1165
+
1166
+ ///////////////////////////////////////////
1167
+ proc qepcadsystem(list l)
1168
+ "USAGE: qepcadsytem(f); l a list;
1169
+ RETURN: list
1170
+ PURPOSE: gives back some constraints that are equivalent to the
1171
+ eigenvalues of the matrices in the list l being < 1 (computed by QEPCAD)
1172
+ EXAMPLE: example qepcadsystem; shows an example
1173
+ "
1174
+ {
1175
+ // how to test, whether QEPCAD is installed?
1176
+ createQCfilter(); // creates/overwrites qepcadfilter.pl
1177
+ system("sh","rm -f QEPCAD-out");
1178
+ system("sh","rm -f QEPCAD-in");
1179
+ string in="QEPCAD-in";
1180
+ string out="QEPCAD-out";
1181
+ link l1=in;
1182
+ link l2=out;
1183
+ string s1="[trial]"; //description
1184
+ string s2=varlist(); //the variables
1185
+ string s3=nfreevars(); //number of free variables
1186
+ string thepolys;
1187
+ int n2=size(l[2]);
1188
+ int count;
1189
+ int i;
1190
+ list lpolys;
1191
+ int j;
1192
+ for(j=1;j<=n2;j++)
1193
+ {
1194
+ count++;
1195
+ poly g2=ParToVar(l[2][j]);
1196
+ if(denominator(content(g2))==1)
1197
+ {
1198
+ lpolys[count]=writepoly(ParToVar(reduce(g2-1,std(0))))+rel();
1199
+ }
1200
+ else
1201
+ {
1202
+ if(g2==content(g2))
1203
+ {
1204
+ g2=g2*denominator(content(g2))-1*denominator(content(g2));
1205
+ g2=ParToVar(g2);
1206
+ g2=reduce(g2,std(0));
1207
+ lpolys[count]=writepoly(g2)+rel();
1208
+ }
1209
+ else
1210
+ {
1211
+ lpolys[count]=writepoly(reduce(ParToVar(cleardenom(g2)-1/content(g2)),std(0)))+rel();
1212
+ }
1213
+ }
1214
+ kill g2;
1215
+ }
1216
+ kill j;
1217
+ int k;
1218
+ for(k=1;k<=size(lpolys);k++)
1219
+ {
1220
+ thepolys=thepolys+lpolys[k];
1221
+ if(k<size(lpolys))
1222
+ {
1223
+ thepolys=thepolys+print(" /","s%")+print("\\ ","s%");
1224
+ }
1225
+ }
1226
+ string s4=aquantor()+"["+thepolys+"]."; //the input prenex formula
1227
+ string s5=projection();
1228
+ string s6=projection();
1229
+ string s7=choice();
1230
+ string s8=solution();
1231
+ write(l1,s1,s2,s3,s4,s5,s6,s7,s8);
1232
+ system("sh","qepcad < QEPCAD-in | qepcadfilter.pl > QEPCAD-out");
1233
+ string output=read(out);
1234
+ print(output,"%s");
1235
+ if(size(output)==0)
1236
+ {
1237
+ ERROR("Try manually"); //maybe too few cells
1238
+ }
1239
+ if(find(output,"FALSE")!=0)
1240
+ {
1241
+ ERROR("FALSE");
1242
+ }
1243
+ if(find(output,"WARNING")!=0)
1244
+ {
1245
+ ERROR("WARNING! Try manually");
1246
+ }
1247
+ else
1248
+ {
1249
+ string strpolys=findthepoly(output);
1250
+ list llpolys=listpolynew(strpolys);
1251
+ return(llpolys);
1252
+ }
1253
+ system("sh","rm -f QEPCAD-out");
1254
+ system("sh","rm -f QEPCAD-in");
1255
+ }
1256
+ example
1257
+ {
1258
+ "EXAMPLE:"; echo = 2;
1259
+ list D="Ut","Ux","Uy","U";
1260
+ list V="t","x","y";
1261
+ list P="a","b";
1262
+ setinitials(V,D,P);
1263
+ matrix M[2][2]=0,-a,-a,0;
1264
+ list Mat=unitmat(2),M;
1265
+ list Appr=forward(Ut,U,t),forward(Ux,U,x);
1266
+ //matrixsystem(Mat,Appr);
1267
+ //timestep(_);
1268
+ fouriersystem(Mat,Appr);
1269
+ qepcadsystem(_[2]);
1270
+ }
1271
+ ///////////////////////////////////////////
1272
+ static proc substbracketstar(string s)
1273
+ {
1274
+ int i;
1275
+ int k;
1276
+ int index=1;
1277
+ string finish=s;
1278
+ for(k=1;k<=size(s);k++)
1279
+ {
1280
+ if(finish[1]=="(" or finish[1]=="*" or finish[1]==" ")
1281
+ {
1282
+ kill finish;
1283
+ index=index+1;
1284
+ string finish=s[index..size(s)];
1285
+ }
1286
+ }
1287
+ for(i=1;i<=size(finish);i++)
1288
+ {
1289
+ if(finish[i]=="*" or finish[i]=="(" or finish[i]== ")")
1290
+ {
1291
+ finish[i]=" ";
1292
+ }
1293
+ }
1294
+ return(finish);
1295
+ }
1296
+
1297
+ ////////////////////////////////////
1298
+ static proc distribution(string SUM, string MON)
1299
+ {
1300
+ string sum=substbracketstar(SUM);
1301
+ string mon=substbracketstar(MON);
1302
+ string result;
1303
+ list signs;
1304
+ list p;
1305
+ int i;
1306
+ int j;
1307
+ int init;
1308
+ for(i=2;i<=size(sum);i++)
1309
+ {
1310
+ if(sum[i]=="+" or sum[i]=="-")
1311
+ {
1312
+ j++;
1313
+ p[j]=i;
1314
+ }
1315
+ }
1316
+ if(j==0)
1317
+ {
1318
+ if(sum[1]!="-")
1319
+ {
1320
+ result=sum+" "+" "+mon;
1321
+ result="+"+" "+result;
1322
+ }
1323
+ else
1324
+ {
1325
+ result=sum+" "+mon;
1326
+ }
1327
+ }
1328
+ else
1329
+ {
1330
+ int l;
1331
+ int anfang;
1332
+ if(sum[1]=="-")
1333
+ {
1334
+ result="-"+" "+result;
1335
+ anfang=2;
1336
+ }
1337
+ else
1338
+ {
1339
+ result="+"+" "+result;
1340
+ if(sum[1]=="+")
1341
+ {
1342
+ anfang=2;
1343
+ }
1344
+ else
1345
+ {
1346
+ anfang=1;
1347
+ }
1348
+ }
1349
+ for(l=1;l<=j;l++)
1350
+ {
1351
+ string a;
1352
+ int k;
1353
+ for(k=anfang;k<=p[l]-1;k++)
1354
+ {
1355
+ a=a+sum[k];
1356
+ }
1357
+ result=result+" "+a+" "+mon+" "+sum[p[l]];
1358
+ anfang=p[l]+1;
1359
+ kill a;
1360
+ kill k;
1361
+ }
1362
+ if(p[j]<size(sum))
1363
+ {
1364
+ int kk;
1365
+ string aa;
1366
+ for(kk=anfang;kk<=size(sum);kk++)
1367
+ {
1368
+ aa=aa+sum[kk];
1369
+ }
1370
+ result=result+" "+aa+" "+mon;
1371
+ kill aa;
1372
+ kill kk;
1373
+ }
1374
+ else
1375
+ {
1376
+ int kkk;
1377
+ string aaa;
1378
+ for(kkk=anfang;kkk<size(sum);kkk++)
1379
+ {
1380
+ aaa=aaa+sum[kkk];
1381
+ }
1382
+ result=result+" "+aaa+" "+mon;
1383
+ kill aaa;
1384
+ kill kkk;
1385
+ }
1386
+ }
1387
+ return(result);
1388
+ }
1389
+ /////////////////////////////////////////////////////////////////
1390
+ static proc writepoly(poly f)
1391
+ {
1392
+ poly g=f;
1393
+ string lc;
1394
+ string lm;
1395
+ string strpoly;
1396
+ string intermediate;
1397
+ int n=size(f);
1398
+ int i;
1399
+ for(i=1;i<=n;i++)
1400
+ {
1401
+
1402
+ lc=substbracketstar(string(leadcoef(g)));
1403
+ lm=substbracketstar(string(leadmonom(g)));
1404
+ intermediate=distribution(lc,lm);
1405
+ strpoly=strpoly+" "+intermediate;
1406
+ g=g-lead(g);
1407
+ }
1408
+ return(strpoly);
1409
+ }
1410
+ ///////////////////////////////////////////////////////////////
1411
+ static proc varlist()
1412
+ {
1413
+ poly p1=par(2+size(@variables));
1414
+ p1=ParToVar(p1);
1415
+ string name=print(p1,"%s");
1416
+ string p="("+name+",";
1417
+ int i;
1418
+ for(i=3+size(@variables);i<=npars(basering);i++)
1419
+ {
1420
+ p1=ParToVar(par(i));
1421
+ name=substbracketstar(print(p1,"%s"));
1422
+ p=p+name+",";
1423
+ }
1424
+ p1=ParToVar(par(2));
1425
+ name=print(p1,"%s");
1426
+ p=p+name+")";
1427
+ return(p);
1428
+ }
1429
+ ///////////////////////////////////////////////////////
1430
+ static proc normalization()
1431
+ {
1432
+ int n1=npars(basering)-size(@variables);
1433
+ int n2=npars(basering)-n1;
1434
+ string assumption="assume["+" "+substbracketstar(print(par(n1+1),"%s"))+" >0";
1435
+ int i;
1436
+ for(i=2;i<=n2;i++)
1437
+ {
1438
+ string s=" /\\"+" "+substbracketstar(print(par(n1+i),"%s"))+" >0";
1439
+ assumption=assumption+" "+s;
1440
+ kill s;
1441
+ }
1442
+ assumption=assumption+" ]"+newline+"go";
1443
+ return(assumption);
1444
+ }
1445
+ ///////////////////////////////////////////////////////
1446
+ static proc projection()
1447
+ {
1448
+ string s="go";
1449
+ return(s);
1450
+ }
1451
+ ///////////////////////////////////////////////////////
1452
+ static proc choice()
1453
+ {
1454
+ string s="go";
1455
+ return(s);
1456
+ }
1457
+ ///////////////////////////////////////////////////////
1458
+ static proc solution()
1459
+ {
1460
+ string s="go";
1461
+ return(s);
1462
+ }
1463
+ ///////////////////////////////////////////////////////
1464
+ static proc nfreevars()
1465
+ {
1466
+ int n=npars(basering)-size(@variables)-1;
1467
+ string no=print(n,"%s");
1468
+ return(no);
1469
+ }
1470
+ /////////////////////////////////////////////////////////
1471
+ static proc aquantor()
1472
+ {
1473
+ string s="(A "+print(var(2),"%s")+")";
1474
+ return(s);
1475
+ }
1476
+ ////////////////////////////////////////////////////////
1477
+ static proc rel()
1478
+ {
1479
+ return("<0");
1480
+ }
1481
+ /////////////////////////////////////////////////////////
1482
+ static proc rm()
1483
+ {
1484
+ system("sh","rm -f dummy");
1485
+ system("sh","rm -f QEPCAD-in");
1486
+ }
1487
+ ////////////////////////////////////////////////////////
1488
+ static proc findthepoly(string word)
1489
+ {
1490
+ int init=1;
1491
+ int index=find(word,newline);
1492
+ if(index==size(word) or index== 0)
1493
+ {
1494
+ return(word);
1495
+ }
1496
+ else
1497
+ {
1498
+ while(index<size(word))
1499
+ {
1500
+ init=index;
1501
+ index=find(word,newline,index+1);
1502
+ }
1503
+ }
1504
+ string thepoly=word[(init+1)..(size(word)-1)];
1505
+ return(thepoly);
1506
+ }
1507
+ //////////////////////////////////////////////////
1508
+ static proc listpolynew(string thepoly)
1509
+ {
1510
+ string p=thepoly;
1511
+ intvec v;
1512
+ p=TestAndDelete(p,"[")[1];
1513
+ p=TestAndDelete(p,"]")[1]; //remove the brackets
1514
+ string AND="/"+"\\";
1515
+ string OR="\\"+"/";
1516
+ list thesigns=AND,OR,"~","<==>","==>","<==";///these can occur in QEPCAD
1517
+ int i;
1518
+ for(i=1;i<=size(thesigns);i++)
1519
+ {
1520
+ list l=TestAndDelete(p,thesigns[i]);
1521
+ p=l[1];
1522
+ v=addintvec(v,l[2]);
1523
+ kill l;
1524
+ }
1525
+ intvec w=rightorder(v);
1526
+ int N=size(v);
1527
+ list lstrings;
1528
+ if(size(w)==1 and w[1]==0)
1529
+ {
1530
+ N=0;
1531
+ lstrings[1]=p;
1532
+ }
1533
+ else
1534
+ {
1535
+ string s1=p[1..w[1]-1];
1536
+ lstrings[1]=s1;
1537
+ int j;
1538
+ for(j=1;j<N;j++)
1539
+ {
1540
+ string s2=p[w[j]..w[j+1]-1];
1541
+ lstrings[j+1]=s2;
1542
+ kill s2;
1543
+ }
1544
+ string s3=p[w[N]..size(p)];
1545
+ lstrings[N+1]=s3;
1546
+ }
1547
+ list cutstrings;
1548
+ int k;
1549
+ list Id;
1550
+ for(k=1;k<=N+1;k++)
1551
+ {
1552
+ cutstrings[k]=cutoffrel(lstrings[k]);
1553
+ Id[k]=translatenew(cutstrings[k]);
1554
+ }
1555
+ return(Id);
1556
+
1557
+
1558
+ }
1559
+ /////////////////////////////////////////////////
1560
+ static proc translatenew(string word)
1561
+ {
1562
+ int n=size(word);
1563
+ string subword=word[1..n];
1564
+ string strpoly="poly f=";
1565
+ list linterim;
1566
+ int i;
1567
+ for(i=1;i<=n;i++)
1568
+ {
1569
+ if(i<n and subword[i]==" " and subword[i+1]!="+" and subword[i+1]!="-" and subword[i+1]!=" " and subword[i-1]!="+" and subword[i-1]!="-" and subword[i-1]!=" " and i>1)
1570
+ {
1571
+ linterim[i]="*";
1572
+ }
1573
+ else
1574
+ {
1575
+ linterim[i]=word[i];
1576
+ }
1577
+ strpoly=strpoly+print(linterim[i],"%s");
1578
+ }
1579
+ strpoly=strpoly+";";
1580
+ execute(strpoly);
1581
+ return(f);
1582
+ }
1583
+ //////////////////////////////////////////////////
1584
+ static proc rightorder(intvec v)
1585
+ ////////////orders the entries of an intvec from small to bigger
1586
+ {
1587
+ list ldown=intveclist(v);
1588
+ list lup;
1589
+ intvec v1;
1590
+ int counter;
1591
+ int min;
1592
+ int i;
1593
+ for(i=1;i<=size(v);i++)
1594
+ {
1595
+ min=Min(listintvec(ldown));
1596
+ lup[i]=min;
1597
+ counter=listfind(ldown,min);
1598
+ ldown=delete(ldown,counter);
1599
+ }
1600
+ intvec result=listintvec(lup);
1601
+ return(result);
1602
+ }
1603
+ /////////////////////////////////////////////////
1604
+ static proc listfind(list l, int n)
1605
+ //////gives the position of n in l, 0 if not found
1606
+ {
1607
+ int i;
1608
+ intvec counter;
1609
+ int j=1;
1610
+ for(i=1;i<=size(l);i++)
1611
+ {
1612
+ if(n==l[i])
1613
+ {
1614
+ counter[j]=i;
1615
+ j++;
1616
+ }
1617
+ }
1618
+ int result=Min(counter);
1619
+ return(result);
1620
+ }
1621
+ //////////////////////////////////////////////////
1622
+ static proc cutoffrel(string str)
1623
+ /////////cut off the relations "/=,<= etc." from output-string
1624
+ {
1625
+ list rels="<=",">=","<",">","/=","="; //these are all of qepcad's relations
1626
+ int i;
1627
+ list l;
1628
+ for(i=1;i<=size(rels);i++)
1629
+ {
1630
+ l[i]=find(str,rels[i]);
1631
+ }
1632
+ intvec v=listintvec(l);
1633
+ v=addintvec(v,v);
1634
+ int position=Min(v);
1635
+ string result;
1636
+ if(position==0)
1637
+ {
1638
+ result=str;
1639
+ }
1640
+ else
1641
+ {
1642
+ result=str[1..position-1];
1643
+ }
1644
+ return(result);
1645
+ }
1646
+ //////////////////////////////////////////////////
1647
+ static proc addintvec(intvec v1, intvec v2)
1648
+ ///////concatenates two intvecs and deletes occurring zeroentries, output intvec
1649
+ {
1650
+ list lresult;
1651
+ int i;
1652
+ list l1;
1653
+ list l2;
1654
+ for(i=1;i<=size(v1);i++)
1655
+ {
1656
+ l1[i]=v1[i];
1657
+ }
1658
+ kill i;
1659
+ int k;
1660
+ for(k=1;k<=size(v2);k++)
1661
+ {
1662
+ l2[k]=v2[k];
1663
+ }
1664
+ lresult=l1+l2;
1665
+ intvec result;
1666
+ int j;
1667
+ int counter=1;
1668
+ for(j=1;j<=size(lresult);j++)
1669
+ {
1670
+ if(lresult[j]!=0)
1671
+ {
1672
+ result[counter]=lresult[j];
1673
+ counter++;
1674
+ }
1675
+ }
1676
+ return(result);
1677
+
1678
+ }
1679
+ /////////////////////////////////////////////////
1680
+ static proc intveclist(intvec v)
1681
+ //////returns the intvec as list
1682
+ {
1683
+ list l;
1684
+ int i;
1685
+ for(i=size(v);i>=1;i--)
1686
+ {
1687
+ l[i]=v[i];
1688
+ }
1689
+ return(l);
1690
+ }
1691
+ //////////////////////////////////////////////////
1692
+ static proc listintvec(list l)
1693
+ //////////returns the list as intvec: only integer-entries allowed
1694
+ {
1695
+ intvec v;
1696
+ int i;
1697
+ for(i=size(l);i>=1;i--)
1698
+ {
1699
+ v[i]=l[i];
1700
+ }
1701
+ return(v);
1702
+ }
1703
+ //////////////////////////////////////////////////
1704
+ static proc TestAndDelete(string str, string booleansign)
1705
+ {
1706
+ int decide=find(str,booleansign);
1707
+ intvec v;
1708
+ v[1]=decide;
1709
+ while(decide!=0 and decide<size(str))//if booleansign ist not contained in str
1710
+ {
1711
+ int n=size(v);
1712
+ decide=find(str,booleansign,decide+1);
1713
+ if(decide!=0)
1714
+ {
1715
+ v[n+1]=decide;
1716
+ }
1717
+ kill n;
1718
+ }
1719
+ if(size(v)==1 and v[1]==0)/////i.e. booleansign NOT in str
1720
+ {
1721
+ list result=str,v;
1722
+ return(result);
1723
+ }
1724
+ else
1725
+ {
1726
+ list l;
1727
+ string p;
1728
+ int i;
1729
+ int j;
1730
+ for(i=1;i<=size(str);i++)///copy the string str into l
1731
+ {
1732
+ l[i]=str[i];
1733
+ }
1734
+ kill i;
1735
+ for(j=1;j<=size(v);j++)///replace booleansign by empty char
1736
+ {
1737
+ int k;
1738
+ for(k=0;k<=size(booleansign)-1;k++)
1739
+ {
1740
+ l[v[j]+k]=" ";
1741
+ }
1742
+ kill k;
1743
+ }
1744
+ int s;
1745
+ for(s=1;s<=size(l);s++)///copy back
1746
+ {
1747
+ p=p+string(l[s]);
1748
+ }
1749
+ kill s;
1750
+ kill l;
1751
+ list result=p,v;
1752
+ return(result);
1753
+ }
1754
+ }
1755
+ //////////////////////////////////////////////////
1756
+ static proc nchoice(int n1,int n2)
1757
+ {
1758
+ int N2=maximal(n1,n2);
1759
+ int N1=minimal(n1,n2);
1760
+ if(N1==0)
1761
+ {
1762
+ return(N2);
1763
+ }
1764
+ else
1765
+ {
1766
+ return(N1);
1767
+ }
1768
+ }