fieker-DuValspielwiese
Last change
on this file since e5f2f7 was
866b07,
checked in by Olaf Bachmann <obachman@…>, 25 years ago
|
* string stuff
git-svn-id: file:///usr/local/Singular/svn/trunk@3002 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
1.6 KB
|
Rev | Line | |
---|
[04d56f] | 1 | LIB "tst.lib"; |
---|
| 2 | tst_init(); |
---|
| 3 | |
---|
[458bd6] | 4 | |
---|
| 5 | proc MyPrint(def what) |
---|
| 6 | { |
---|
| 7 | "what"; |
---|
| 8 | what; |
---|
| 9 | "print(what)"; |
---|
| 10 | print(what); |
---|
| 11 | "string(what)"; |
---|
| 12 | string(what); |
---|
| 13 | "print(what, \"%s\")"; |
---|
| 14 | print(what, "%s"); |
---|
| 15 | "print(what, \"%p\")"; |
---|
| 16 | print(what, "%p"); |
---|
[7604db] | 17 | "print(what, \"%l\")"; |
---|
| 18 | print(what, "%l"); |
---|
[458bd6] | 19 | "print(what, \"%;\")"; |
---|
| 20 | print(what, "%;"); |
---|
[7604db] | 21 | "print(what, \"%2s\")"; |
---|
| 22 | print(what, "%2s"); |
---|
| 23 | "print(what, \"%2l\")"; |
---|
| 24 | print(what, "%2l"); |
---|
| 25 | "print(what, \"%t\")"; |
---|
| 26 | print(what, "%t"); |
---|
[458bd6] | 27 | } |
---|
| 28 | |
---|
| 29 | list l = 1, 2; |
---|
| 30 | MyPrint(l); |
---|
| 31 | |
---|
| 32 | list ll; |
---|
| 33 | MyPrint(ll); |
---|
| 34 | |
---|
| 35 | l = l + ll; |
---|
| 36 | MyPrint(l); |
---|
| 37 | |
---|
[04d56f] | 38 | l = insert(l, ll); |
---|
[458bd6] | 39 | MyPrint(l); |
---|
| 40 | |
---|
[04d56f] | 41 | l[10] = 5; |
---|
[458bd6] | 42 | |
---|
[04d56f] | 43 | string(l); |
---|
[458bd6] | 44 | MyPrint(l); |
---|
| 45 | |
---|
[04d56f] | 46 | l[3] = intvec(1,2,3); |
---|
| 47 | l[4] = "hi"; |
---|
[458bd6] | 48 | MyPrint(l); |
---|
| 49 | |
---|
[04d56f] | 50 | l[6] = list("ho", "he"); |
---|
[458bd6] | 51 | MyPrint(l); |
---|
| 52 | |
---|
| 53 | l[8] = MyPrint; |
---|
| 54 | MyPrint(l); |
---|
| 55 | |
---|
[04d56f] | 56 | link li = "/tmp"; |
---|
[458bd6] | 57 | l[8] = li; |
---|
| 58 | MyPrint(l); |
---|
| 59 | |
---|
[04d56f] | 60 | ring r; |
---|
[458bd6] | 61 | MyPrint(r); |
---|
| 62 | |
---|
[04d56f] | 63 | ideal i; |
---|
[458bd6] | 64 | MyPrint(i); |
---|
[7604db] | 65 | |
---|
| 66 | number n = 12345; |
---|
| 67 | MyPrint(n); |
---|
| 68 | |
---|
| 69 | vector v = [x+1, y]; |
---|
| 70 | MyPrint(v); |
---|
| 71 | |
---|
| 72 | poly p = x2+y3+n; |
---|
| 73 | MyPrint(p); |
---|
[458bd6] | 74 | |
---|
[04d56f] | 75 | l[8] = r; |
---|
| 76 | l[9] = i; |
---|
[7604db] | 77 | l[7] = n; |
---|
| 78 | // l[1] = v; |
---|
| 79 | l[5] = p; |
---|
[458bd6] | 80 | MyPrint(l); |
---|
| 81 | |
---|
| 82 | matrix ma[2][2] = x,y,z,x2; |
---|
| 83 | MyPrint(ma); |
---|
| 84 | |
---|
| 85 | module m=[1,y],[0,x+z]; |
---|
| 86 | MyPrint(m); |
---|
| 87 | |
---|
| 88 | l[1]= list(ma, m); |
---|
| 89 | MyPrint(l); |
---|
| 90 | |
---|
| 91 | intmat M=betti(mres(m,0)); |
---|
| 92 | MyPrint(M); |
---|
| 93 | print(M,"betti"); |
---|
| 94 | print(M, "%b"); |
---|
| 95 | l[2] = M; |
---|
| 96 | MyPrint(l); |
---|
| 97 | |
---|
[04d56f] | 98 | ideal j = z2,x; |
---|
| 99 | resolution re = res(j,0); |
---|
[458bd6] | 100 | MyPrint(re); |
---|
[04d56f] | 101 | l[11] = re; |
---|
[458bd6] | 102 | MyPrint(re); |
---|
| 103 | |
---|
| 104 | matrix B(1..3); |
---|
| 105 | B(1)[1,1] = 1; |
---|
| 106 | B(2)[1,1] = 2; |
---|
| 107 | B(3)[1,1] = 3; |
---|
| 108 | |
---|
| 109 | B(1..3); |
---|
| 110 | print(B(1..3)); |
---|
| 111 | string(B(1..3)); |
---|
| 112 | |
---|
[04d56f] | 113 | qring qr = std(ideal(x,y)); |
---|
[458bd6] | 114 | MyPrint(qr); |
---|
| 115 | |
---|
[04d56f] | 116 | list l = 1, qr, list(2, qr); |
---|
[458bd6] | 117 | MyPrint(l); |
---|
| 118 | |
---|
[866b07] | 119 | |
---|
[7604db] | 120 | map phi = r, maxideal(2); |
---|
| 121 | MyPrint(phi); |
---|
| 122 | |
---|
| 123 | l[5] = phi; |
---|
| 124 | MyPrint(l); |
---|
[458bd6] | 125 | |
---|
[866b07] | 126 | example sprintf; |
---|
| 127 | example printf; |
---|
| 128 | example fprintf; |
---|
| 129 | |
---|
[04d56f] | 130 | tst_status(1);$ |
---|
[458bd6] | 131 | |
---|
Note: See
TracBrowser
for help on using the repository browser.