ring_lib.tex 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865
  1. @c ---content LibInfo---
  2. @comment This file was generated by doc2tex.pl from d2t_singular/ring_lib.doc
  3. @comment DO NOT EDIT DIRECTLY, BUT EDIT d2t_singular/ring_lib.doc INSTEAD
  4. @c library version: (1.17.2.1,2002/02/20)
  5. @c library file: ../Singular/LIB/ring.lib
  6. @cindex ring.lib
  7. @cindex ring_lib
  8. @table @asis
  9. @item @strong{Library:}
  10. ring.lib
  11. @item @strong{Purpose:}
  12. Manipulating Rings and Maps
  13. @end table
  14. @strong{Procedures:}
  15. @menu
  16. * changechar:: make a copy R of basering [ring r] with new char c
  17. * changeord:: make a copy R of basering [ring r] with new ord o
  18. * changevar:: make a copy R of basering [ring r] with new vars v
  19. * defring:: define a ring R in specified char c, n vars v, ord o
  20. * defrings:: define ring Sn in n vars, char 32003 [p], ord ds
  21. * defringp:: define ring Pn in n vars, char 32003 [p], ord dp
  22. * extendring:: extend given ring by n vars v, ord o and name it R
  23. * fetchall:: fetch all objects of ring R to basering
  24. * imapall:: imap all objects of ring R to basering
  25. * mapall:: map all objects of ring R via ideal i to basering
  26. * ord_test:: test whether ordering of R is global, local or mixed
  27. * ringtensor:: create ring R, tensor product of rings s,t,...
  28. * ringweights:: intvec of weights of ring variables of ring r
  29. @end menu
  30. @c ---end content LibInfo---
  31. @c ------------------- changechar -------------
  32. @node changechar, changeord,, ring_lib
  33. @subsubsection changechar
  34. @cindex changechar
  35. @c ---content changechar---
  36. Procedure from library @code{ring.lib} (@pxref{ring_lib}).
  37. @table @asis
  38. @item @strong{Usage:}
  39. changechar(newr,c[,r]); newr,c=strings, r=ring
  40. @item @strong{Create:}
  41. create a new ring with name `newr` and make it the basering if r is
  42. an existing ring [default: r=basering].
  43. @*The new ring differs from the old ring only in the characteristic.
  44. If, say, (newr,c) = ("R","0,A") and the ring r exists, the new
  45. basering will have name R, characteristic 0 and one parameter A.
  46. @item @strong{Return:}
  47. No return value
  48. @item @strong{Note:}
  49. Works for qrings if map from old_char to new_char is implemented
  50. This proc uses 'execute' or calls a procedure using 'execute'.
  51. If you use it in your own proc, let the local names of your proc
  52. start with @@.
  53. @end table
  54. @strong{Example:}
  55. @smallexample
  56. @c computed example changechar d2t_singular/ring_lib.doc:62
  57. LIB "ring.lib";
  58. ring r=0,(x,y,u,v),(dp(2),ds);
  59. changechar("R","2,A"); R;"";
  60. @expansion{} // basering is now R
  61. @expansion{} // characteristic : 2
  62. @expansion{} // 1 parameter : A
  63. @expansion{} // minpoly : 0
  64. @expansion{} // number of vars : 4
  65. @expansion{} // block 1 : ordering dp
  66. @expansion{} // : names x y
  67. @expansion{} // block 2 : ordering ds
  68. @expansion{} // : names u v
  69. @expansion{} // block 3 : ordering C
  70. @expansion{}
  71. changechar("R1","32003",R); R1;
  72. @expansion{} // basering is now R1
  73. @expansion{} // characteristic : 32003
  74. @expansion{} // number of vars : 4
  75. @expansion{} // block 1 : ordering dp
  76. @expansion{} // : names x y
  77. @expansion{} // block 2 : ordering ds
  78. @expansion{} // : names u v
  79. @expansion{} // block 3 : ordering C
  80. kill R,R1;
  81. if(system("with","Namespaces")) @{
  82. if( nameof(Current) == "Ring" ) @{
  83. kill Top::R,Top::R1;
  84. @} else @{
  85. kill Ring::R,Ring::R1;
  86. @}
  87. @}
  88. @c end example changechar d2t_singular/ring_lib.doc:62
  89. @end smallexample
  90. @c ---end content changechar---
  91. @c ------------------- changeord -------------
  92. @node changeord, changevar, changechar, ring_lib
  93. @subsubsection changeord
  94. @cindex changeord
  95. @c ---content changeord---
  96. Procedure from library @code{ring.lib} (@pxref{ring_lib}).
  97. @table @asis
  98. @item @strong{Usage:}
  99. changeord(newr,o[,r]); newr,o=strings, r=ring/qring
  100. @item @strong{Create:}
  101. create a new ring with name `newr` and make it the basering if r is
  102. an existing ring/qring [default: r=basering].
  103. @*The new ring differs from the old ring only in the ordering. If, say,
  104. (newr,o) = ("R","wp(2,3),dp") and the ring r exists and has >=3
  105. variables, the new basering will have name R and ordering wp(2,3),dp.
  106. @item @strong{Return:}
  107. No return value
  108. @item @strong{Note:}
  109. This proc uses 'execute' or calls a procedure using 'execute'.
  110. If you use it in your own proc, let the local names of your proc
  111. start with @@.
  112. @end table
  113. @strong{Example:}
  114. @smallexample
  115. @c computed example changeord d2t_singular/ring_lib.doc:108
  116. LIB "ring.lib";
  117. ring r=0,(x,y,u,v),(dp(2),ds);
  118. changeord("R","wp(2,3),dp"); R; "";
  119. @expansion{} // basering is now R
  120. @expansion{} // characteristic : 0
  121. @expansion{} // number of vars : 4
  122. @expansion{} // block 1 : ordering wp
  123. @expansion{} // : names x y
  124. @expansion{} // : weights 2 3
  125. @expansion{} // block 2 : ordering dp
  126. @expansion{} // : names u v
  127. @expansion{} // block 3 : ordering C
  128. @expansion{}
  129. ideal i = x^2,y^2-u^3,v;
  130. qring Q = std(i);
  131. changeord("Q'","lp",Q); Q';
  132. @expansion{} // basering is now Q'
  133. @expansion{} // characteristic : 0
  134. @expansion{} // number of vars : 4
  135. @expansion{} // block 1 : ordering lp
  136. @expansion{} // : names x y u v
  137. @expansion{} // block 2 : ordering C
  138. @expansion{} // quotient ring from ideal
  139. @expansion{} _[1]=v
  140. @expansion{} _[2]=x2
  141. @expansion{} _[3]=y2-u3
  142. kill R,Q,Q';
  143. if(system("with","Namespaces")) @{
  144. if( nameof(Current) == "Ring" ) @{
  145. kill Top::R,Top::Q';
  146. @} else @{
  147. kill Ring::R,Ring::Q';
  148. @}
  149. @}
  150. @c end example changeord d2t_singular/ring_lib.doc:108
  151. @end smallexample
  152. @c ---end content changeord---
  153. @c ------------------- changevar -------------
  154. @node changevar, defring, changeord, ring_lib
  155. @subsubsection changevar
  156. @cindex changevar
  157. @c ---content changevar---
  158. Procedure from library @code{ring.lib} (@pxref{ring_lib}).
  159. @table @asis
  160. @item @strong{Usage:}
  161. changevar(newr,vars[,r]); newr,vars=strings, r=ring/qring
  162. @item @strong{Create:}
  163. creates a new ring with name `newr` and makes it the basering if r
  164. is an existing ring/qring [default: r=basering].
  165. @*The new ring differs from the old ring only in the variables. If,
  166. say, (newr,vars) = ("R","t()") and the ring r exists and has n
  167. variables, the new basering will have name R and variables
  168. t(1),...,t(n).
  169. @*If vars = "a,b,c,d", the new ring will have the variables a,b,c,d.
  170. @item @strong{Return:}
  171. No return value
  172. @item @strong{Note:}
  173. This procedure is useful in connection with the procedure ringtensor,
  174. when a conflict between variable names must be avoided.
  175. This proc uses 'execute' or calls a procedure using 'execute'.
  176. If you use it in your own proc, let the local names of your proc
  177. start with @@.
  178. @end table
  179. @strong{Example:}
  180. @smallexample
  181. @c computed example changevar d2t_singular/ring_lib.doc:160
  182. LIB "ring.lib";
  183. ring r=0,(x,y,u,v),(dp(2),ds);
  184. ideal i = x^2,y^2-u^3,v;
  185. qring Q = std(i);
  186. setring(r);
  187. changevar("R","A()"); R; "";
  188. @expansion{} // basering is now R
  189. @expansion{} // characteristic : 0
  190. @expansion{} // number of vars : 4
  191. @expansion{} // block 1 : ordering dp
  192. @expansion{} // : names A(1) A(2)
  193. @expansion{} // block 2 : ordering ds
  194. @expansion{} // : names A(3) A(4)
  195. @expansion{} // block 3 : ordering C
  196. @expansion{}
  197. changevar("Q'","a,b,c,d",Q); Q';
  198. @expansion{} // basering is now Q'
  199. @expansion{} // characteristic : 0
  200. @expansion{} // number of vars : 4
  201. @expansion{} // block 1 : ordering dp
  202. @expansion{} // : names a b
  203. @expansion{} // block 2 : ordering ds
  204. @expansion{} // : names c d
  205. @expansion{} // block 3 : ordering C
  206. @expansion{} // quotient ring from ideal
  207. @expansion{} _[1]=d
  208. @expansion{} _[2]=a2
  209. @expansion{} _[3]=b2-c3
  210. kill R,Q,Q';
  211. if(system("with","Namespaces")) @{
  212. if( nameof(Current) == "Ring" ) @{
  213. kill Top::R,Top::Q';
  214. @} else @{
  215. kill Ring::R,Ring::Q';
  216. @}
  217. @}
  218. @c end example changevar d2t_singular/ring_lib.doc:160
  219. @end smallexample
  220. @c ---end content changevar---
  221. @c ------------------- defring -------------
  222. @node defring, defrings, changevar, ring_lib
  223. @subsubsection defring
  224. @cindex defring
  225. @c ---content defring---
  226. Procedure from library @code{ring.lib} (@pxref{ring_lib}).
  227. @table @asis
  228. @item @strong{Usage:}
  229. defring(s1,s2,n,s3,s4); s1..s4=strings, n=integer
  230. @item @strong{Create:}
  231. Define a ring with name 's1', characteristic 's2', ordering 's4' and
  232. n variables with names derived from s3 and make it the basering.
  233. If s3 is a single letter, say s3="a", and if n<=26 then a and the
  234. following n-1 letters from the alphabet (cyclic order) are taken as
  235. variables. If n>26 or if s3 is a single letter followed by (, say
  236. s3="T(", the variables are T(1),...,T(n).
  237. @item @strong{Return:}
  238. No return value
  239. @item @strong{Note:}
  240. This proc is useful for defining a ring in a procedure.
  241. This proc uses 'execute' or calls a procedure using 'execute'.
  242. If you use it in your own proc, let the local names of your proc
  243. start with @@.
  244. @end table
  245. @strong{Example:}
  246. @smallexample
  247. @c computed example defring d2t_singular/ring_lib.doc:211
  248. LIB "ring.lib";
  249. defring("r","0",5,"u","ls"); r; "";
  250. @expansion{} // basering is now: r
  251. @expansion{} // characteristic : 0
  252. @expansion{} // number of vars : 5
  253. @expansion{} // block 1 : ordering ls
  254. @expansion{} // : names u v w x y
  255. @expansion{} // block 2 : ordering C
  256. @expansion{}
  257. defring("R","2,A",10,"x(","dp(3),ws(1,2,3),ds"); R;
  258. @expansion{} // basering is now: R
  259. @expansion{} // characteristic : 2
  260. @expansion{} // 1 parameter : A
  261. @expansion{} // minpoly : 0
  262. @expansion{} // number of vars : 10
  263. @expansion{} // block 1 : ordering dp
  264. @expansion{} // : names x(1) x(2) x(3)
  265. @expansion{} // block 2 : ordering ws
  266. @expansion{} // : names x(4) x(5) x(6)
  267. @expansion{} // : weights 1 2 3
  268. @expansion{} // block 3 : ordering ds
  269. @expansion{} // : names x(7) x(8) x(9) x(10)
  270. @expansion{} // block 4 : ordering C
  271. kill r,R;
  272. if(system("with","Namespaces")) @{
  273. if( nameof(Current) == "Ring" ) @{
  274. kill Top::r,Top::R;
  275. @} else @{
  276. kill Ring::r,Ring::R;
  277. @}
  278. @}
  279. @c end example defring d2t_singular/ring_lib.doc:211
  280. @end smallexample
  281. @c ---end content defring---
  282. @c ------------------- defrings -------------
  283. @node defrings, defringp, defring, ring_lib
  284. @subsubsection defrings
  285. @cindex defrings
  286. @c ---content defrings---
  287. Procedure from library @code{ring.lib} (@pxref{ring_lib}).
  288. @table @asis
  289. @item @strong{Usage:}
  290. defrings(n,[p]); n,p integers
  291. @item @strong{Create:}
  292. Defines a ring with name Sn, characteristic p, ordering ds and n
  293. variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it
  294. the basering (default: p=32003)
  295. @item @strong{Return:}
  296. No return value
  297. @end table
  298. @strong{Example:}
  299. @smallexample
  300. @c computed example defrings d2t_singular/ring_lib.doc:249
  301. LIB "ring.lib";
  302. defrings(5,0); S5; "";
  303. @expansion{} // basering is now: ring S5=0,(x,y,z,a,b),ds;
  304. @expansion{} // characteristic : 0
  305. @expansion{} // number of vars : 5
  306. @expansion{} // block 1 : ordering ds
  307. @expansion{} // : names x y z a b
  308. @expansion{} // block 2 : ordering C
  309. @expansion{}
  310. defrings(30); S30;
  311. @expansion{} // basering is now: ring S30=32003,x(1..30),ds;
  312. @expansion{} // characteristic : 32003
  313. @expansion{} // number of vars : 30
  314. @expansion{} // block 1 : ordering ds
  315. @expansion{} // : names x(1) x(2) x(3) x(4) x(5) x(6) x(7) x(8) x(\
  316. 9) x(10) x(11) x(12) x(13) x(14) x(15) x(16) x(17) x(18) x(19) x(20) x(21\
  317. ) x(22) x(23) x(24) x(25) x(26) x(27) x(28) x(29) x(30)
  318. @expansion{} // block 2 : ordering C
  319. kill S5, S30;
  320. if(system("with","Namespaces")) @{
  321. if( nameof(Current) == "Ring" ) @{
  322. kill Top::S5,Top::S30;
  323. @} else @{
  324. kill Ring::S5,Ring::S30;
  325. @}
  326. @}
  327. @c end example defrings d2t_singular/ring_lib.doc:249
  328. @end smallexample
  329. @c ---end content defrings---
  330. @c ------------------- defringp -------------
  331. @node defringp, extendring, defrings, ring_lib
  332. @subsubsection defringp
  333. @cindex defringp
  334. @c ---content defringp---
  335. Procedure from library @code{ring.lib} (@pxref{ring_lib}).
  336. @table @asis
  337. @item @strong{Usage:}
  338. defringp(n,[p]); n,p=integers
  339. @item @strong{Create:}
  340. defines a ring with name Pn, characteristic p, ordering dp and n
  341. variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it
  342. the basering (default: p=32003)
  343. @item @strong{Return:}
  344. No return value
  345. @end table
  346. @strong{Example:}
  347. @smallexample
  348. @c computed example defringp d2t_singular/ring_lib.doc:287
  349. LIB "ring.lib";
  350. defringp(5,0); P5; "";
  351. @expansion{} // basering is now: ring P5=0,(x,y,z,a,b),dp;
  352. @expansion{} // characteristic : 0
  353. @expansion{} // number of vars : 5
  354. @expansion{} // block 1 : ordering dp
  355. @expansion{} // : names x y z a b
  356. @expansion{} // block 2 : ordering C
  357. @expansion{}
  358. defringp(30); P30;
  359. @expansion{} // basering is now: ring P30=32003,x(1..30),dp;
  360. @expansion{} // characteristic : 32003
  361. @expansion{} // number of vars : 30
  362. @expansion{} // block 1 : ordering dp
  363. @expansion{} // : names x(1) x(2) x(3) x(4) x(5) x(6) x(7) x(8) x(\
  364. 9) x(10) x(11) x(12) x(13) x(14) x(15) x(16) x(17) x(18) x(19) x(20) x(21\
  365. ) x(22) x(23) x(24) x(25) x(26) x(27) x(28) x(29) x(30)
  366. @expansion{} // block 2 : ordering C
  367. kill P5, P30;
  368. if(system("with","Namespaces")) @{
  369. if( nameof(Current) == "Ring" ) @{
  370. kill Top::P5,Top::P30;
  371. @} else @{
  372. kill Ring::P5,Ring::P30;
  373. @}
  374. @}
  375. @c end example defringp d2t_singular/ring_lib.doc:287
  376. @end smallexample
  377. @c ---end content defringp---
  378. @c ------------------- extendring -------------
  379. @node extendring, fetchall, defringp, ring_lib
  380. @subsubsection extendring
  381. @cindex extendring
  382. @c ---content extendring---
  383. Procedure from library @code{ring.lib} (@pxref{ring_lib}).
  384. @table @asis
  385. @item @strong{Usage:}
  386. extendring(na,n,va,o[iv,i,r]); na,va,o=strings,
  387. @*n,i=integers, r=ring, iv=intvec of positive integers or iv=0
  388. @item @strong{Create:}
  389. Define a ring with name `na` which extends the ring r by adding n new
  390. variables in front of [after, if i!=0] the old variables and make it
  391. the basering [default: (i,r)=(0,basering)].
  392. @* -- The characteristic is the characteristic of r.
  393. @* -- The new vars are derived from va. If va is a single letter, say
  394. va="T", and if n<=26 then T and the following n-1 letters from
  395. T..Z..T (resp. T(1..n) if n>26) are taken as additional variables.
  396. If va is a single letter followed by (, say va="x(", the new
  397. variables are x(1),...,x(n).
  398. @* -- The ordering is the product ordering between the ordering of r and
  399. an ordering derived from `o` [and iv].
  400. @* - If o contains a 'c' or a 'C' in front resp. at the end this is
  401. taken for the whole ordering in front resp. at the end. If o does
  402. not contain a 'c' or a 'C' the same rule applies to ordstr(r).
  403. @* - If no intvec iv is given, or if iv=0, o may be any allowed ordstr,
  404. like "ds" or "dp(2),wp(1,2,3),Ds(2)" or "ds(a),dp(b),ls" if
  405. a and b are globally (!) defined integers and if a+b+1<=n.
  406. If, however, a and b are local to a proc calling extendring, the
  407. intvec iv must be used to let extendring know the values of a and b
  408. @* - If an intvec iv !=0 is given, iv[1],iv[2],... is taken for the
  409. 1st, 2nd,... block of o, if o contains no substring "w" or "W"
  410. i.e. no weighted ordering (in the above case o="ds,dp,ls"
  411. and iv=a,b).
  412. @*If o contains a weighted ordering (only one (!) weighted block is
  413. allowed) iv[1] is taken as size for the weight-vector, the next
  414. iv[1] values of iv are taken as weights and the remaining values of
  415. iv as block-size for the remaining non-weighted blocks.
  416. e.g. o="dp,ws,Dp,ds", iv=3,2,3,4,2,5 creates the ordering
  417. dp(2),ws(2,3,4),Dp(5),ds
  418. @item @strong{Return:}
  419. No return value
  420. @item @strong{Note:}
  421. This proc is useful for adding deformation parameters.
  422. @*This proc uses 'execute' or calls a procedure using 'execute'.
  423. If you use it in your own proc, let the local names of your proc
  424. start with @@ (see the file HelpForProc)
  425. @end table
  426. @strong{Example:}
  427. @smallexample
  428. @c computed example extendring d2t_singular/ring_lib.doc:358
  429. LIB "ring.lib";
  430. ring r=0,(x,y,z),ds;
  431. show(r);"";
  432. @expansion{} // ring: (0),(x,y,z),(ds(3),C);
  433. @expansion{} // minpoly = 0
  434. @expansion{} // objects belonging to this ring:
  435. @expansion{}
  436. //blocksize is derived from no of vars:
  437. int t=5;
  438. extendring("R1",t,"a","dp"); //t global: "dp" -> "dp(5)"
  439. @expansion{} // basering is now R1
  440. show(R1); "";
  441. @expansion{} // ring: (0),(a,b,c,d,e,x,y,z),(dp(5),ds(3),C);
  442. @expansion{} // minpoly = 0
  443. @expansion{} // objects belonging to this ring:
  444. @expansion{}
  445. extendring("R2",4,"T(","c,dp",1,r); //"dp" -> "c,..,dp(4)"
  446. @expansion{} // basering is now R2
  447. show(R2);"";
  448. @expansion{} // ring: (0),(x,y,z,T(1),T(2),T(3),T(4)),(c,ds(3),dp(4));
  449. @expansion{} // minpoly = 0
  450. @expansion{} // objects belonging to this ring:
  451. @expansion{}
  452. //no intvec given, blocksize given: given blocksize is used:
  453. extendring("R3",4,"T(","dp(2)",0,r); // "dp(2)" -> "dp(2)"
  454. @expansion{} // basering is now R3
  455. show(R3);"";
  456. @expansion{} // ring: (0),(T(1),T(2),T(3),T(4),x,y,z),(dp(2),ds(5),C);
  457. @expansion{} // minpoly = 0
  458. @expansion{} // objects belonging to this ring:
  459. @expansion{}
  460. //intvec given: weights and blocksize is derived from given intvec
  461. //(no specification of a blocksize in the given ordstr is allowed!)
  462. //if intvec does not cover all given blocks, the last block is used
  463. //for the remaining variables, if intvec has too many components,
  464. //the last ones are ignored
  465. intvec v=3,2,3,4,1,3;
  466. extendring("R4",10,"A","ds,ws,Dp,dp",v,0,r);
  467. @expansion{} // basering is now R4
  468. //v covers 3 blocks: v[1] (=3) : no of components of ws
  469. //next v[1] values (=v[2..4]) give weights
  470. //remaining components of v are used for the remaining blocks
  471. show(R4);
  472. @expansion{} // ring: (0),(A,B,C,D,E,F,G,H,I,J,x,y,z),(ds(1),ws(2,3,4),Dp(3),dp(3),ds(\
  473. 3),C);
  474. @expansion{} // minpoly = 0
  475. @expansion{} // objects belonging to this ring:
  476. kill r,R1,R2,R3,R4;
  477. if(system("with","Namespaces")) @{
  478. if( nameof(Current) == "Ring" ) @{
  479. kill Top::R1,Top::R2,Top::R3,Top::R4;
  480. @} else @{
  481. kill Ring::R1,Ring::R2,Ring::R3,Ring::R4;
  482. @}
  483. @}
  484. @c end example extendring d2t_singular/ring_lib.doc:358
  485. @end smallexample
  486. @c ---end content extendring---
  487. @c ------------------- fetchall -------------
  488. @node fetchall, imapall, extendring, ring_lib
  489. @subsubsection fetchall
  490. @cindex fetchall
  491. @c ---content fetchall---
  492. Procedure from library @code{ring.lib} (@pxref{ring_lib}).
  493. @table @asis
  494. @item @strong{Usage:}
  495. fetchall(R[,s]); R=ring/qring, s=string
  496. @item @strong{Create:}
  497. fetch all objects of ring R (of type poly/ideal/vector/module/number/
  498. matrix) into the basering.
  499. @*If no 3rd argument is present, the names are the same as in R. If,
  500. say, f is a poly in R and the 3rd argument is the string "R", then f
  501. is mapped to f_R etc.
  502. @item @strong{Return:}
  503. no return value
  504. @item @strong{Note:}
  505. As fetch, this procedure maps the 1st, 2nd, ... variable of R to the
  506. 1st, 2nd, ... variable of the basering.
  507. @*The 3rd argument is useful in order to avoid conflicts of names, the
  508. empty string is allowed
  509. @item @strong{Caution:}
  510. fetchall does not work inside a procedure.
  511. @*It does not work if R contains a map.
  512. @end table
  513. @strong{Example:}
  514. @smallexample
  515. @c computed example fetchall d2t_singular/ring_lib.doc:428
  516. LIB "ring.lib";
  517. // The example is not shown since fetchall does not work in a procedure;
  518. // (and hence not in the example procedure). Try the following commands:
  519. // ring R=0,(x,y,z),dp;
  520. // ideal j=x,y2,z2;
  521. // matrix M[2][3]=1,2,3,x,y,z;
  522. // j; print(M);
  523. // ring S=0,(a,b,c),ds;
  524. // fetchall(R); //map from R to S: x->a, y->b, z->c;
  525. // names(S);
  526. // j; print(M);
  527. // fetchall(S,"1"); //identity map of S: copy objects, change names
  528. // names(S);
  529. // kill R,S;
  530. @c end example fetchall d2t_singular/ring_lib.doc:428
  531. @end smallexample
  532. @c ---end content fetchall---
  533. @c ------------------- imapall -------------
  534. @node imapall, mapall, fetchall, ring_lib
  535. @subsubsection imapall
  536. @cindex imapall
  537. @c ---content imapall---
  538. Procedure from library @code{ring.lib} (@pxref{ring_lib}).
  539. @table @asis
  540. @item @strong{Usage:}
  541. imapall(R[,s]); R=ring/qring, s=string
  542. @item @strong{Create:}
  543. map all objects of ring R (of type poly/ideal/vector/module/number/
  544. matrix) into the basering, by applying imap to all objects of R.
  545. If no 3rd argument is present, the names are the same as in R. If,
  546. say, f is a poly in R and the 3rd argument is the string "R", then f
  547. is mapped to f_R etc.
  548. @item @strong{Return:}
  549. no return value
  550. @item @strong{Note:}
  551. As imap, this procedure maps the variables of R to the variables with
  552. the same name in the basering, the other variables are mapped to 0.
  553. The 3rd argument is useful in order to avoid conflicts of names, the
  554. empty string is allowed
  555. @item @strong{Caution:}
  556. imapall does not work inside a procedure
  557. @*It does not work if R contains a map
  558. @end table
  559. @strong{Example:}
  560. @smallexample
  561. @c computed example imapall d2t_singular/ring_lib.doc:481
  562. LIB "ring.lib";
  563. // The example is not shown since imapall does not work in a procedure
  564. // (and hence not in the example procedure). Try the following commands:
  565. // ring R=0,(x,y,z,u),dp;
  566. // ideal j=x,y,z,u2+ux+z;
  567. // matrix M[2][3]=1,2,3,x,y,uz;
  568. // j; print(M);
  569. // ring S=0,(a,b,c,x,z,y),ds;
  570. // imapall(R); //map from R to S: x->x, y->y, z->z, u->0
  571. // names(S);
  572. // j; print(M);
  573. // imapall(S,"1"); //identity map of S: copy objects, change names
  574. // names(S);
  575. // kill R,S;
  576. @c end example imapall d2t_singular/ring_lib.doc:481
  577. @end smallexample
  578. @c ---end content imapall---
  579. @c ------------------- mapall -------------
  580. @node mapall, ord_test, imapall, ring_lib
  581. @subsubsection mapall
  582. @cindex mapall
  583. @c ---content mapall---
  584. Procedure from library @code{ring.lib} (@pxref{ring_lib}).
  585. @table @asis
  586. @item @strong{Usage:}
  587. mapall(R,i[,s]); R=ring/qring, i=ideal of basering, s=string
  588. @item @strong{Create:}
  589. map all objects of ring R (of type poly/ideal/vector/module/number/
  590. matrix, map) into the basering, by mapping the j-th variable of R to
  591. the j-th generator of the ideal i. If no 3rd argument is present, the
  592. names are the same as in R. If, say, f is a poly in R and the 3rd
  593. argument is the string "R", then f is mapped to f_R etc.
  594. @item @strong{Return:}
  595. no return value.
  596. @item @strong{Note:}
  597. This procedure has the same effect as defining a map, say psi, by
  598. map psi=R,i; and then applying psi to all objects of R. In particular,
  599. maps from R to some ring S are composed with psi, creating thus a map
  600. from the basering to S.
  601. @*mapall may be combined with copyring to change vars for all objects.
  602. The 3rd argument is useful in order to avoid conflicts of names, the
  603. empty string is allowed.
  604. @item @strong{Caution:}
  605. mapall does not work inside a procedure.
  606. @end table
  607. @strong{Example:}
  608. @smallexample
  609. @c computed example mapall d2t_singular/ring_lib.doc:536
  610. LIB "ring.lib";
  611. // The example is not shown since mapall does not work in a procedure
  612. // (and hence not in the example procedure). Try the following commands:
  613. // ring R=0,(x,y,z),dp;
  614. // ideal j=x,y,z;
  615. // matrix M[2][3]=1,2,3,x,y,z;
  616. // map phi=R,x2,y2,z2;
  617. // ring S=0,(a,b,c),ds;
  618. // ideal i=c,a,b;
  619. // mapall(R,i); //map from R to S: x->c, y->a, z->b
  620. // names(S);
  621. // j; print(M); phi; //phi maps R to S: x->c2, y->a2, z->b2
  622. // ideal i1=a2,a+b,1;
  623. // mapall(R,i1,""); //map from R to S: x->a2, y->a+b, z->1
  624. // names(S);
  625. // j_; print(M_); phi_;
  626. // changevar("T","x()",R); //change vars in R and call result T
  627. // mapall(R,maxideal(1)); //identity map from R to T
  628. // names(T);
  629. // j; print(M); phi;
  630. // kill R,S,T;
  631. @c end example mapall d2t_singular/ring_lib.doc:536
  632. @end smallexample
  633. @c ---end content mapall---
  634. @c ------------------- ord_test -------------
  635. @node ord_test, ringtensor, mapall, ring_lib
  636. @subsubsection ord_test
  637. @cindex ord_test
  638. @c ---content ord_test---
  639. Procedure from library @code{ring.lib} (@pxref{ring_lib}).
  640. @table @asis
  641. @item @strong{Usage:}
  642. ord_test(r); r ring
  643. @item @strong{Return:}
  644. int 1 (resp. -1, resp. 0) if ordering of r is global (resp. local,
  645. resp. mixed)
  646. @end table
  647. @strong{Example:}
  648. @smallexample
  649. @c computed example ord_test d2t_singular/ring_lib.doc:580
  650. LIB "ring.lib";
  651. ring R = 0,(x,y),dp;
  652. ring S = 0,(u,v),ls;
  653. ord_test(R);
  654. @expansion{} 1
  655. ord_test(S);
  656. @expansion{} -1
  657. ord_test(R+S);
  658. @expansion{} 0
  659. @c end example ord_test d2t_singular/ring_lib.doc:580
  660. @end smallexample
  661. @c ---end content ord_test---
  662. @c ------------------- ringtensor -------------
  663. @node ringtensor, ringweights, ord_test, ring_lib
  664. @subsubsection ringtensor
  665. @cindex ringtensor
  666. @c ---content ringtensor---
  667. Procedure from library @code{ring.lib} (@pxref{ring_lib}).
  668. @table @asis
  669. @item @strong{Usage:}
  670. ringtensor(s,r1,r2,...); s=string, r1,r2,...=rings
  671. @item @strong{Create:}
  672. A new base ring with name `s` if r1,r2,... are existing rings.
  673. If, say, s = "R" and the rings r1,r2,... exist, the new ring will
  674. have name R, variables from all rings r1,r2,... and as monomial
  675. ordering the block (product) ordering of r1,r2,... . Hence, R
  676. is the tensor product of the rings r1,r2,... with ordering matrix
  677. equal to the direct sum of the ordering matrices of r1,r2,...
  678. @item @strong{Return:}
  679. no return value
  680. @item @strong{Note:}
  681. The characteristic of the new ring will be that of r1. The names of
  682. variables in the rings r1,r2,... should differ (if a name, say x,
  683. occurs in r1 and r2, then, in the new ring r, x always refers to the
  684. variable with name x in r1, there is no access to x in r2).
  685. The procedure works also for quotient rings ri, if the characteristic
  686. of ri is compatible with the characteristic of r1 (i.e. if imap from
  687. ri to r1 is implemented)
  688. @*This proc uses 'execute' or calls a procedure using 'execute'.
  689. If you use it in your own proc, let the local names of your proc
  690. start with @@ (see the file HelpForProc)
  691. @end table
  692. @strong{Example:}
  693. @smallexample
  694. @c computed example ringtensor d2t_singular/ring_lib.doc:628
  695. LIB "ring.lib";
  696. ring r=32003,(x,y,u,v),dp;
  697. ring s=0,(a,b,c),wp(1,2,3);
  698. ring t=0,x(1..5),(c,ls);
  699. ringtensor("R",r,s,t);
  700. @expansion{} // basering is now R
  701. type R;
  702. @expansion{} // R [0] *ring
  703. @expansion{} // characteristic : 32003
  704. @expansion{} // number of vars : 12
  705. @expansion{} // block 1 : ordering dp
  706. @expansion{} // : names x y u v
  707. @expansion{} // block 2 : ordering wp
  708. @expansion{} // : names a b c
  709. @expansion{} // : weights 1 2 3
  710. @expansion{} // block 3 : ordering ls
  711. @expansion{} // : names x(1) x(2) x(3) x(4) x(5)
  712. @expansion{} // block 4 : ordering C
  713. setring s;
  714. ideal i = a2+b3+c5;
  715. changevar("S","x,y,z"); //change vars of sand make S the basering
  716. @expansion{} // basering is now S
  717. qring qS =std(fetch(s,i)); //create qring of S mod i (mapped to S)
  718. changevar("T","d,e,f,g,h",t); //change vars of t and make T the basering
  719. @expansion{} // basering is now T
  720. qring qT=std(d2+e2-f3); //create qring of T mod d2+e2-f3
  721. ringtensor("Q",s,qS,t,qT);
  722. @expansion{} // basering is now Q
  723. type Q;
  724. @expansion{} // Q [0] *qring
  725. @expansion{} // characteristic : 0
  726. @expansion{} // number of vars : 16
  727. @expansion{} // block 1 : ordering wp
  728. @expansion{} // : names a b c
  729. @expansion{} // : weights 1 2 3
  730. @expansion{} // block 2 : ordering wp
  731. @expansion{} // : names x y z
  732. @expansion{} // : weights 1 2 3
  733. @expansion{} // block 3 : ordering ls
  734. @expansion{} // : names x(1) x(2) x(3) x(4) x(5)
  735. @expansion{} // block 4 : ordering ls
  736. @expansion{} // : names d e f g h
  737. @expansion{} // block 5 : ordering C
  738. @expansion{} // quotient ring from ideal
  739. @expansion{} _[1]=f3-e2-d2
  740. @expansion{} _[2]=z5+y3+x2
  741. kill R,Q,S,T;
  742. if(system("with","Namespaces")) @{
  743. if( nameof(Current) == "Ring" ) @{
  744. kill Top::R,Top::Q,Top::S,Top::T;
  745. @} else @{
  746. kill Ring::R,Ring::Q,Ring::S,Ring::T;
  747. @}
  748. @}
  749. @c end example ringtensor d2t_singular/ring_lib.doc:628
  750. @end smallexample
  751. @c ---end content ringtensor---
  752. @c ------------------- ringweights -------------
  753. @node ringweights,, ringtensor, ring_lib
  754. @subsubsection ringweights
  755. @cindex ringweights
  756. @c ---content ringweights---
  757. Procedure from library @code{ring.lib} (@pxref{ring_lib}).
  758. @table @asis
  759. @item @strong{Usage:}
  760. ringweights(P); P=name of an existing ring (true name, not a string)
  761. @item @strong{Return:}
  762. intvec consisting of the weights of the variables of P, as they
  763. appear when typing P;.
  764. @item @strong{Note:}
  765. This is useful when enlarging P but keeping the weights of the old
  766. variables.
  767. @end table
  768. @strong{Example:}
  769. @smallexample
  770. @c computed example ringweights d2t_singular/ring_lib.doc:677
  771. LIB "ring.lib";
  772. ring r0 = 0,(x,y,z),dp;
  773. ringweights(r0);
  774. @expansion{} 1,1,1
  775. ring r1 = 0,x(1..5),(ds(3),wp(2,3));
  776. ringweights(r1);"";
  777. @expansion{} 1,1,1,2,3
  778. @expansion{}
  779. // an example for enlarging the ring, keeping the first weights:
  780. intvec v = ringweights(r1),6,2,3,4,5;
  781. ring R = 0,x(1..10),(a(v),dp);
  782. ordstr(R);
  783. @expansion{} a(1,1,1,2,3,6,2,3,4,5),dp(10),C
  784. @c end example ringweights d2t_singular/ring_lib.doc:677
  785. @end smallexample
  786. @c ---end content ringweights---