Changeset 9ebfb1b in git
- Timestamp:
- May 24, 1998, 11:04:13 AM (25 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 96b804631b095d8928ec2c241293ce9015190de7
- Parents:
- 4450163d09cf95a4bb144b396250a639a524f7a6
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/tst.lib
r445016 r9ebfb1b 1 // $Id: tst.lib,v 1. 6 1998-05-15 16:18:19obachman Exp $1 // $Id: tst.lib,v 1.7 1998-05-24 09:04:13 obachman Exp $ 2 2 //(obachman, last modified 2/13/98) 3 ///////////////////////////////////////////////////////////////////////////// //4 5 version="$Id: tst.lib,v 1. 6 1998-05-15 16:18:19obachman Exp $";3 ///////////////////////////////////////////////////////////////////////////// 4 5 version="$Id: tst.lib,v 1.7 1998-05-24 09:04:13 obachman Exp $"; 6 6 info=" 7 7 LIBRARY: tst.lib PROCEDURES FOR RUNNING AUTOMATIC TST TESTS 8 8 9 9 10 tst_system(s) returns string which is stdout of system(\"sh\", s) … … 12 13 tst_init() writes some identification data to stdout 13 14 with tst_ignore 15 tst_groebnerTest(ideal i) 16 tests groebner command 17 tst_stdEqual(ideal i1, ideal i2) 18 test whether two std's are \"equal\" 14 19 "; 15 20 16 ///////////////////////////////////////////////////////////////////////////// //21 ///////////////////////////////////////////////////////////////////////////// 17 22 18 23 proc tst_system(string s) … … 149 154 } 150 155 151 152 156 /////////////////////////////////////////////////////////////////////// 157 158 proc tst_groebnerTest(ideal i, list #) 159 "USAGE: tst_groebnerTesti,[v]) : ideal i, [int v] 160 RETURN: 1, if groebner command produced \"equal\" std as std command 161 0, otherwise 162 Two std's are \"equal\" here, if their redSB's are element-wise equal, 163 and if they reduce each other to zero, and if their leading ideals 164 are equal 165 On success, times of std - groebner is written with tst_ignore, and 166 times are added to global variables tst_std_time and 167 tst_groebner_time. If v given, and <= 0, short ideal 168 characteristic is print, if v > 0, ideals are printed. 169 On failure, Error message and ideals are printed. 170 EXAMPLE: example tst_groebner; shows an example 171 " 172 { 173 int st = timer; 174 ideal si = std(i); 175 st = timer - st; 176 177 int gt = timer; 178 ideal gi = groebner(i); 179 gt = timer - gt; 180 181 if (tst_stdEqual(si, gi)) 182 { 183 tst_ignore(string(st) + " - " + string(gt) + " == " + string(st - gt)); 184 if (! defined(tst_groebner_time)) 185 { 186 int tst_groebner_time; 187 int tst_std_time; 188 export tst_groebner_time, tst_std_time; 189 } 190 tst_std_time = tst_std_time + st; 191 tst_groebner_time = tst_groebner_time + gt; 192 if (size(#)) 193 { 194 if (typeof(#[1] == "int")) 195 { 196 if (#[1] <= 0) 197 { 198 idPrintShort(si, "si"); 199 idPrintShort(gi, "gi"); 200 } 201 else 202 { 203 si; 204 gi; 205 } 206 } 207 } 208 return (1); 209 } 210 return (0); 211 } 212 example 213 { 214 "EXAMPLE: "; echo = 2; 215 ring r = 0, (a,b,c,d), lp; 216 ideal i = a+b+c+d, ab+ad+bc+cd, abc+abd+acd+bcd, abcd-1; // cyclic 4 217 tst_groebnerTest(i); 218 tst_groebnerTest(i, 0); 219 tst_groebnerTest(i, 1); 220 } 221 222 223 // 224 // A routine which test for equality of "std-bases" 225 // 226 proc tst_stdEqual(ideal i1, ideal i2) 227 "USAGE: tst_stdEqual(i1, i2) ideal i1, i2 228 RETURN 1, if i1 \"equald\" i2 as a std bases 229 0, otherwise 230 Two std's are \"equal\" here, if their redSB's are element-wise equal, 231 and if they reduce each other to zero, and if their leading ideals 232 are equal 233 On failure, error message is printed. 234 EXAMPLE: example tst_stdEqual; shows an example 235 " 236 { 237 int i; 238 int back; 239 intvec opts = option(get); 240 option(redSB); 241 242 ideal ri1 = simplify(interred(i1), 1); 243 ideal ri2 = simplify(interred(i2), 1); 244 245 option(set, opts); 246 247 if (size(ri1) != size(ri2)) 248 { 249 "Error in tst_stdEqual: Reduced sizes differ"; 250 size(ri1); 251 size(ri2); 252 return(0); 253 } 254 255 for (i=1; i<=size(ri1); i++) 256 { 257 if (ri1[i] != ri2[i]) 258 { 259 "Error in tst_stdEqual: " + string(i) + " th poly differ"; 260 ri1[i]; 261 ri2[i]; 262 return(0); 263 } 264 } 265 266 // reduced SB are now equal 267 if (size(reduce(i1, i2, 1)) == 0) 268 { 269 if (size(reduce(i2, i1, 1)) == 0) 270 { 271 poly p1, p2; 272 273 ideal si1 = simplify(i1, 7); 274 ideal si2 = simplify(i2, 7); 275 276 if (size(si1) == size(si2)) 277 { 278 for (i=1; i<=size(si1); i++) 279 { 280 p1 = p1 + lead(si1[i]); 281 p2 = p2 + lead(si2[i]); 282 } 283 if (p1 != p2) 284 { 285 "Error in tst_stdEqual: Lead monoms differ:"; 286 p1; 287 p2; 288 return(0); 289 } 290 } 291 else 292 { 293 "Error in tst_stdEqual: size differs:"; 294 size(si1); 295 size(si2); 296 return(0); 297 } 298 } 299 else 300 { 301 "Error in tst_stdEqual: reduce(i2, i1) != 0"; 302 return(0); 303 } 304 } 305 else 306 { 307 back = 1; "Error in tst_stdEqual: reduce(i1, i2) != 0"; 308 return(0); 309 } 310 311 return (1); 312 } 313 example 314 { 315 "EXAMPLE: "; echo = 2; 316 ring r = 0, (a,b,c,d), lp; 317 ideal i = a+b+c+d, ab+ad+bc+cd, abc+abd+acd+bcd, abcd-1; // cyclic 4 318 tst_stdEqual(groebner(i), std(i)); 319 tst_stdEqual(std(i), i); 320 } 321 322 static proc idPrintShort(ideal id, string name) 323 { 324 "Summary of " + name + " (leading monoms and size of polys):"; 325 int i; 326 for (i = 1; i<=size(id); i++) 327 { 328 "[" + string(i) + "]: #" + string(size(id[i])) + ":" + string(lead(id[i])); 329 } 330 } 331 332 333 334 -
Singular/configure
r445016 r9ebfb1b 545 545 546 546 SINGULAR_MAJOR_VERSION=1 547 SINGULAR_MINOR_VERSION= 1548 SINGULAR_SUB_VERSION= 8549 VERSION_DATE=" April1998"547 SINGULAR_MINOR_VERSION=2 548 SINGULAR_SUB_VERSION=0 549 VERSION_DATE="May 1998" 550 550 551 551 -
Singular/configure.in
r445016 r9ebfb1b 7 7 dnl 8 8 SINGULAR_MAJOR_VERSION=1 9 SINGULAR_MINOR_VERSION= 110 SINGULAR_SUB_VERSION= 811 VERSION_DATE=" April1998"9 SINGULAR_MINOR_VERSION=2 10 SINGULAR_SUB_VERSION=0 11 VERSION_DATE="May 1998" 12 12 AC_SUBST(SINGULAR_MAJOR_VERSION) 13 13 AC_SUBST(SINGULAR_MINOR_VERSION) -
configure
r445016 r9ebfb1b 560 560 561 561 SINGULAR_MAJOR_VERSION=1 562 SINGULAR_MINOR_VERSION= 1563 SINGULAR_SUB_VERSION= 8564 VERSION_DATE=" April1998"562 SINGULAR_MINOR_VERSION=2 563 SINGULAR_SUB_VERSION=0 564 VERSION_DATE="May 1998" 565 565 566 566 -
configure.in
r445016 r9ebfb1b 7 7 dnl 8 8 SINGULAR_MAJOR_VERSION=1 9 SINGULAR_MINOR_VERSION= 110 SINGULAR_SUB_VERSION= 811 VERSION_DATE=" April1998"9 SINGULAR_MINOR_VERSION=2 10 SINGULAR_SUB_VERSION=0 11 VERSION_DATE="May 1998" 12 12 AC_SUBST(SINGULAR_MAJOR_VERSION) 13 13 AC_SUBST(SINGULAR_MINOR_VERSION)
Note: See TracChangeset
for help on using the changeset viewer.