Changeset 6bef24 in git


Ignore:
Timestamp:
Jan 29, 2018, 11:28:57 PM (6 years ago)
Author:
Andreas Steenpass <steenpass@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
f4cb688bd460cad06792559a83e52103e9699d83
Parents:
c78b59f1964d52b7ab1abd2e0537f5007227690a
git-author:
Andreas Steenpass <steenpass@mathematik.uni-kl.de>2018-01-29 23:28:57+01:00
git-committer:
Andreas Steenpass <steenpass@mathematik.uni-kl.de>2018-02-02 11:16:48+01:00
Message:
add: introduce new option "single module" for fres()
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    rc78b59f r6bef24  
    22222222    if (strcmp(method, "complete") != 0
    22232223            && strcmp(method, "frame") != 0
    2224             && strcmp(method, "extended frame") != 0) {
     2224            && strcmp(method, "extended frame") != 0
     2225            && strcmp(method, "single module") != 0) {
    22252226        WerrorS("wrong optional argument for fres");
    22262227    }
  • kernel/GBEngine/syz4.cc

    rc78b59f r6bef24  
    552552}
    553553
     554static void delete_tails(resolvente res, const int index)
     555{
     556    const ring r = currRing;
     557    for (int i = 0; i < res[index]->ncols; i++) {
     558        if (res[index]->m[i] != NULL) {
     559            p_Delete(&(res[index]->m[i]->next), r);
     560        }
     561    }
     562}
     563
    554564/*
    555565 * for each step in the resolution, compute the corresponding module until
     
    557567 */
    558568static int computeResolution(resolvente res, const int max_index,
    559         syzHeadFunction *syzHead, const bool do_lifting)
     569        syzHeadFunction *syzHead, const bool do_lifting,
     570        const bool single_module)
    560571{
    561572    int index = 0;
     
    568579            if (do_lifting) {
    569580                computeLiftings(res, index, variables);
     581                if (single_module) {
     582                    delete_tails(res, index-1);
     583                }
    570584            }
    571585            if (index >= max_index) { break; }
     
    579593
    580594static void set_options(syzHeadFunction **syzHead_ptr, bool *do_lifting_ptr,
    581         const char *method)
     595        bool *single_module_ptr, const char *method)
    582596{
    583597    if (strcmp(method, "complete") == 0) {   // default
    584598        *syzHead_ptr = syzHeadExtFrame;
    585599        *do_lifting_ptr = true;
     600        *single_module_ptr = false;
    586601    }
    587602    else if (strcmp(method, "frame") == 0) {
    588603        *syzHead_ptr = syzHeadFrame;
    589604        *do_lifting_ptr = false;
     605        *single_module_ptr = false;
    590606    }
    591607    else if (strcmp(method, "extended frame") == 0) {
    592608        *syzHead_ptr = syzHeadExtFrame;
    593609        *do_lifting_ptr = false;
     610        *single_module_ptr = false;
     611    }
     612    else if (strcmp(method, "single module") == 0) {
     613        *syzHead_ptr = syzHeadExtFrame;
     614        *do_lifting_ptr = true;
     615        *single_module_ptr = true;
    594616    }
    595617    else {   // "linear strand" (not yet implemented)
    596618        *syzHead_ptr = syzHeadExtFrame;
    597619        *do_lifting_ptr = true;
     620        *single_module_ptr = false;
    598621    }
    599622}
     
    619642
    620643/*
    621  * for each poly in the resolution, insert the first two terms at their right
    622  * places
    623  */
    624 static void insert_ext_induced_LTs(const resolvente res, const int length)
     644 * For each poly in the resolution, insert the first two terms at their right
     645 * places. If single_module is true, then only consider the last module.
     646 */
     647static void insert_ext_induced_LTs(const resolvente res, const int length,
     648        const bool single_module)
    625649{
    626650    const ring R = currRing;
    627651    poly p, q;
    628     int index = 1;
     652    int index = (single_module ? length-1 : 1);
    629653    while (index < length && !idIs0(res[index])) {
    630654        for (int j = res[index]->ncols-1; j >= 0; j--) {
     
    651675    syzHeadFunction *syzHead;
    652676    bool do_lifting;
    653     set_options(&syzHead, &do_lifting, method);
    654     int new_length = computeResolution(res, length-1, syzHead, do_lifting);
     677    bool single_module;
     678    set_options(&syzHead, &do_lifting, &single_module, method);
     679    int new_length = computeResolution(res, length-1, syzHead, do_lifting,
     680            single_module);
    655681    if (new_length < length) {
    656682        res = (resolvente)omReallocSize(res, (length+1)*sizeof(ideal),
     
    658684    }
    659685    if (strcmp(method, "frame") != 0) {
    660         insert_ext_induced_LTs(res, new_length);
     686        insert_ext_induced_LTs(res, new_length, single_module);
    661687    }
    662688    result->fullres = res;
Note: See TracChangeset for help on using the changeset viewer.