Changeset 022ef5 in git for kernel/structs.h


Ignore:
Timestamp:
Jun 26, 2008, 8:35:45 PM (16 years ago)
Author:
Motsak Oleksandr <motsak@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
a883a37dae9ce90a24c978095e70ce11d4466058
Parents:
953d428419b859c3c241b5c1708342cb31c96e5d
Message:
*motsak: bugfixes + redesign


git-svn-id: file:///usr/local/Singular/svn/trunk@10809 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/structs.h

    r953d42 r022ef5  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: structs.h,v 1.46 2008-06-10 15:43:08 Singular Exp $ */
     6/* $Id: structs.h,v 1.47 2008-06-26 18:35:45 motsak Exp $ */
    77/*
    88* ABSTRACT
     
    468468  nc_type type;
    469469  ring basering; // the ring C,D,.. live in
     470
     471  // initial data:
    470472  matrix C;
    471473  matrix D;
     474
     475  // computed data:
    472476  matrix *MT; // size 0.. (rVar()*rVar()-1)/2
    473477  matrix COM;
     
    479483
    480484  private:
    481     // treat variables from iAltVarsStart till iAltVarsEnd as alternating vars.
    482     // these variables should have odd degree, though that will not be checked
    483     // iAltVarsStart, iAltVarsEnd are only used together with nc_type=nc_exterior
    484     // 1 <= iAltVarsStart <= iAltVarsEnd <= r->N
    485     unsigned int iFirstAltVar, iLastAltVar; // = 0 by default
    486    
    487     // for factors of super-commutative algebras we need
    488     // the part of general quotient ideal modulo squares!   
    489     ideal idSCAQuotient; // = NULL by default.
     485    // internal data for different implementations
     486    // if dynamic => must be deallocated in destructor (nc_rKill!)
     487    union {
     488      struct {
     489        // treat variables from iAltVarsStart till iAltVarsEnd as alternating vars.
     490        // these variables should have odd degree, though that will not be checked
     491        // iAltVarsStart, iAltVarsEnd are only used together with nc_type=nc_exterior
     492        // 1 <= iAltVarsStart <= iAltVarsEnd <= r->N
     493        unsigned int iFirstAltVar, iLastAltVar; // = 0 by default
     494
     495        // for factors of super-commutative algebras we need
     496        // the part of general quotient ideal modulo squares!   
     497        ideal idSCAQuotient; // = NULL by default. // must be deleted in Kill!
     498      } sca;
     499    } data;
    490500
    491501  public:
    492     inline unsigned int& FirstAltVar() { return (iFirstAltVar); };
    493     inline unsigned int& LastAltVar () { return (iLastAltVar ); };
    494 
    495     inline unsigned int FirstAltVar() const { return (iFirstAltVar); };
    496     inline unsigned int LastAltVar () const { return (iLastAltVar ); };
    497 
    498     inline ideal& SCAQuotient() { return (idSCAQuotient); };
     502    inline nc_type& ncRingType() { return (type); };
     503    inline nc_type ncRingType() const { return (type); };
     504
     505    inline unsigned int& FirstAltVar()
     506        { assume(ncRingType() == nc_exterior); return (data.sca.iFirstAltVar); };
     507    inline unsigned int& LastAltVar ()
     508        { assume(ncRingType() == nc_exterior); return (data.sca.iLastAltVar ); };
     509
     510    inline unsigned int FirstAltVar() const
     511        { assume(ncRingType() == nc_exterior); return (data.sca.iFirstAltVar); };
     512    inline unsigned int LastAltVar () const
     513        { assume(ncRingType() == nc_exterior); return (data.sca.iLastAltVar ); };
     514
     515    inline ideal& SCAQuotient()
     516        { assume(ncRingType() == nc_exterior); return (data.sca.idSCAQuotient); };
    499517
    500518  public:
Note: See TracChangeset for help on using the changeset viewer.