Changeset 5116a21 in git


Ignore:
Timestamp:
Dec 12, 2011, 6:55:33 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ae3ad6cdf6204f707110d832cded7d76f5258ed2
Parents:
c360967d0dc4ef57f8ba249d247ddcd773bbba4d
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-12-12 18:55:33+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-12-12 19:09:38+01:00
Message:
test syzygy and all kinds of resolutions via make check

ADD: test syz + sres/lres/nres/mres on the kernel level!
ADD: print syStrategy
ADD: get length + Betti numbers
ADD: minimize resolutions

TODO: conversion to list of ideals?
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/test.cc

    rc36096 r5116a21  
    396396  rChangeCurrRing(R);
    397397
    398   ideal G = kStd(I, currQuotient, testHomog, NULL);
     398  {
     399    ideal G = kStd(I, currQuotient, testHomog, NULL);
    399400
    400401#ifdef PDEBUG
    401   PrintS("GB: ");
    402   idShow(G, R, R, 0);
     402    PrintS("GB: ");
     403    idShow(G, R, R, 0);
    403404#endif
    404405
    405   idDelete( &G, R);
    406 
    407   ideal SYZ;
    408 
    409   {
    410     intvec *ww=NULL;
    411     SYZ = idSyzygies(I, testHomog, &ww);
    412     if (ww!=NULL) delete ww;
    413   }
    414 
    415 
     406    idDelete( &G, R);
     407  }
     408
     409  {
     410    intvec *weights = NULL;
     411    ideal SYZ = idSyzygies(I, testHomog, &weights);
     412   
    416413#ifdef PDEBUG
    417   PrintS("SYZ: ");
    418   idShow(SYZ, R, R, 0);
     414    PrintS("SYZ: ");
     415    idShow(SYZ, R, R, 0);
    419416#endif
    420  
    421   idDelete( &SYZ, R);
    422   idDelete( &I, R);
    423 
     417
     418    idDelete(&SYZ, R);
     419    if (weights!=NULL) { PrintS("weights: "); weights->show(); delete weights; }
     420  }
     421
     422
     423  {
     424    PrintS("\n**********************************\n");
     425    PrintS("lres: \n");
     426    int dummy;
     427    syStrategy r = syLaScala3(I,&dummy);
     428
     429    intvec *b = syBettiOfComputation(r, FALSE);
     430    PrintS("non-min. betti: \n");    b->show();    PrintLn();
     431    delete b;
     432
     433    Print("length: %d\n", sySize(r));
     434
     435    syPrint(r, "R");
     436
     437    r =  syMinimize(r); // syzstr->references ++ ==> memory leak :(((
     438
     439    b = syBettiOfComputation(r, TRUE);
     440    PrintS("min. betti: \n");    b->show();    PrintLn();
     441    delete b;   
     442
     443    Print("length: %d\n", sySize(r));
     444
     445    syPrint(r, "R");
     446   
     447    syKillComputation(r, R);
     448  }
     449
     450  {
     451    PrintS("\n**********************************\n");
     452    PrintS("sres: \n");
     453    const int maxl = rVar(R)-1; // +2*(1);
     454
     455    syStrategy r = sySchreyer(I, rVar(R));
     456
     457    intvec *b = syBettiOfComputation(r, FALSE);
     458    PrintS("non-min. betti: \n");    b->show();    PrintLn();
     459    delete b;
     460
     461    Print("length: %d\n", sySize(r));
     462
     463    syPrint(r, "R");
     464
     465    r =  syMinimize(r); // syzstr->references ++ ==> memory leak :(((
     466
     467    b = syBettiOfComputation(r, TRUE);
     468    PrintS("min. betti: \n");    b->show();    PrintLn();
     469    delete b;   
     470
     471    Print("length: %d\n", sySize(r));
     472
     473    syPrint(r, "R");
     474
     475    syKillComputation(r, R);
     476  }
     477
     478   
     479
     480  {
     481    PrintS("\n**********************************\n");
     482    PrintS("nres: \n");
     483    intvec *weights=NULL;
     484//    const int maxl = rVar(R)-1 + 2*(1);
     485    syStrategy r = syResolution(I, rVar(R)-1, weights, FALSE/*iiOp==MRES_CMD*/);
     486
     487    intvec *b = syBettiOfComputation(r, FALSE);
     488    PrintS("non-min. betti: \n");    b->show();    PrintLn();
     489    delete b;
     490
     491    Print("length: %d\n", sySize(r));
     492
     493    syPrint(r, "R");
     494
     495    r =  syMinimize(r); // syzstr->references ++ ==> memory leak :(((
     496
     497    b = syBettiOfComputation(r, TRUE);
     498    PrintS("min. betti: \n");    b->show();    PrintLn();
     499    delete b;   
     500
     501    Print("length: %d\n", sySize(r));
     502
     503    syPrint(r, "R");
     504
     505    syKillComputation(r, R);
     506  }
     507 
     508
     509  {
     510    PrintS("\n**********************************\n");
     511    PrintS("mres: \n");
     512    intvec *weights=NULL;
     513//    const int maxl = rVar(R)-1 + 2*(1);
     514    syStrategy r = syResolution(I, rVar(R)+1, weights, TRUE/*iiOp==MRES_CMD*/);
     515
     516    intvec *b = syBettiOfComputation(r, FALSE);
     517    PrintS("non-min. betti: \n");    b->show();    PrintLn();
     518    delete b;
     519
     520    Print("length: %d\n", sySize(r));
     521
     522    syPrint(r, "R");
     523
     524    r =  syMinimize(r); // syzstr->references ++ ==> memory leak :(((
     525
     526    b = syBettiOfComputation(r, TRUE);
     527    PrintS("min. betti: \n");    b->show();    PrintLn();
     528    delete b;   
     529
     530    Print("length: %d\n", sySize(r));
     531
     532    syPrint(r, "R");
     533
     534    syKillComputation(r, R);
     535  }
     536 
     537
     538
     539 
     540  idDelete( &I, R); 
    424541  rDelete(R); // should cleanup every belonging polynomial, right!?
    425542   
Note: See TracChangeset for help on using the changeset viewer.