Changeset 43317d in git


Ignore:
Timestamp:
Nov 26, 2010, 6:26:04 PM (13 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
Children:
3050575d37a9363a66a9300aa56345da8ccd43d4
Parents:
92e2cd1822dc1be6a8ef69173615a30e5bd67d0e
Message:
creation of fans and insertion of cones therein

git-svn-id: file:///usr/local/Singular/svn/trunk@13679 2c84dea3-7e68-4137-9b89-c4e89433aadc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    r92e2cd r43317d  
    51115111}
    51125112#ifdef HAVE_FANS
     5113/* returns 1 iff all rows consist of entries 1..n,
     5114   where n is the number of columns of the provided
     5115   intmat; 0 otherwise */
     5116static gfan::IntMatrix permutationIntMatrix(const intvec* iv)
     5117{
     5118        int cc = iv->cols();
     5119        int rr = iv->rows();
     5120        intvec* ivCopy = new intvec(rr, cc, 0);
     5121        for (int r = 1; r <= rr; r++)
     5122          for (int c = 1; c <= cc; c++)
     5123            IMATELEM(*ivCopy, r, c) = IMATELEM(*iv, r, c) - 1;
     5124        gfan::ZMatrix zm = intmat2ZMatrix(ivCopy);
     5125        gfan::IntMatrix* im = new gfan::IntMatrix(gfan::ZToIntMatrix(zm));
     5126        return *im;
     5127}
    51135128static BOOLEAN jjFANEMPTY_I(leftv res, leftv v)
    51145129{
     
    51255140{
    51265141        intvec* permutations = (intvec*)v->Data();
    5127         // todo: check that permutations contains sensible elements of S_n
    51285142        int ambientDim = permutations->cols();
     5143        gfan::IntMatrix im = permutationIntMatrix(permutations);
     5144        if (!gfan::Permutation::arePermutations(im))
     5145        {
     5146                Werror("provided intmat contains invalid permutations of {1, ..., %d}", ambientDim);
     5147                return TRUE;
     5148        }
    51295149        gfan::SymmetryGroup sg = gfan::SymmetryGroup(ambientDim);
    5130         gfan::ZMatrix zm = intmat2ZMatrix(permutations);
    5131         gfan::IntMatrix im = gfan::ZToIntMatrix(zm);
    51325150        sg.computeClosure(im);
    51335151        res->data = (char*)(new gfan::ZFan(sg));
     
    51495167{
    51505168        intvec* permutations = (intvec*)v->Data();
    5151         // todo: check that permutations contains sensible elements of S_n
    51525169        int ambientDim = permutations->cols();
     5170        gfan::IntMatrix im = permutationIntMatrix(permutations);
     5171        if (!gfan::Permutation::arePermutations(im))
     5172        {
     5173                Werror("provided intmat contains invalid permutations of {1, ..., %d}", ambientDim);
     5174                return TRUE;
     5175        }
    51535176        gfan::SymmetryGroup sg = gfan::SymmetryGroup(ambientDim);
    5154         gfan::ZMatrix zm = intmat2ZMatrix(permutations);
    5155         gfan::IntMatrix im = gfan::ZToIntMatrix(zm);
    51565177        sg.computeClosure(im);
    51575178        gfan::ZFan* zf = new gfan::ZFan(gfan::ZFan::fullFan(sg));
  • Singular/table.h

    r92e2cd r43317d  
    880880  { "cone_via_normals",0,CONENORMALS_CMD, CMD_123},
    881881  { "fan_empty",   0, FANEMPTY_CMD,       CMD_1},
    882   { "fan_full",    0, FANEMPTY_CMD,       CMD_1},
     882  { "fan_full",    0, FANFULL_CMD,        CMD_1},
    883883  { "insert_cone", 0, INSERTCONE_CMD,     CMD_2},
    884884  { "cone_intersect",0,INTERSC_CMD,       CMD_2},
  • gfanlib/gfanlib_polyhedralfan.cpp

    r92e2cd r43317d  
    163163void PolyhedralFan::insert(ZCone const &c)
    164164{
    165   cones.insert(c);
     165  ZCone temp=c;
     166  temp.canonicalize();
     167  cones.insert(temp);
    166168}
    167169
  • gfanlib/gfanlib_symmetry.cpp

    r92e2cd r43317d  
    392392}
    393393
     394
     395bool Permutation::arePermutations(IntMatrix const &m)
     396{
     397  for(int i=0;i<m.getHeight();i++)if(!isPermutation(m[i]))return false;
     398  return true;
     399}
    394400
    395401int SymmetryGroup::orbitSize(ZVector const &stable)const
  • gfanlib/gfanlib_symmetry.h

    r92e2cd r43317d  
    2626   */
    2727  static bool isPermutation(IntVector const &a);
     28  /**
     29   * Returns true if all rows of the matrix are pemutations
     30   */
     31  static bool arePermutations(IntMatrix const &m);
    2832  /**
    2933   * Generates the identity permutation on n elements.
Note: See TracChangeset for help on using the changeset viewer.