Changeset 9d0c2b in git


Ignore:
Timestamp:
Jul 8, 2008, 10:18:27 AM (15 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
77987005e6c432b32a83558af620b8a21ecaa8cc
Parents:
9d249b2bd6e53779def56a0139a8157d70ec75c1
Message:
*hannes: syntax


git-svn-id: file:///usr/local/Singular/svn/trunk@10843 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile.in

    r9d249b r9d0c2b  
    113113    prCopy.cc p_Mult_q.cc \
    114114    pDebug.cc pInline2.cc pInline1.cc pInline0.cc \
    115     pShallowCopyDelete.cc fast_mult.cc digitech.cc\
     115    pShallowCopyDelete.cc fast_mult.cc digitech.cc summator.cc\
    116116    tgb.cc tgbgauss.cc ringgb.cc f5gb.cc ratgring.cc shiftgb.cc
    117117
     
    167167        eigenval.h units.h mod_raw.h kbuckets.h sbuckets.h\
    168168        mpr_global.h mpr_inout.h mpr_base.h mpr_numeric.h \
    169         fegetopt.h distrib.h \
     169        fegetopt.h distrib.h summator.h\
    170170        ratgring.h shiftgb.h prCopy.h prCopyMacros.h \
    171171        p_MemAdd.h p_MemCopy.h p_MemCmp.h p_Numbers.h \
  • kernel/summator.cc

    r9d249b r9d0c2b  
    66 *  Purpose: simple Summator usecase implementation
    77 *  Author:  motsak
    8  *  Created: 
    9  *  Version: $Id: summator.cc,v 1.1 2008-07-04 14:19:38 motsak Exp $
     8 *  Created:
     9 *  Version: $Id: summator.cc,v 1.2 2008-07-08 08:18:27 Singular Exp $
    1010 *******************************************************************/
    1111
     
    2020
    2121#include "mod2.h"
    22 
     22#ifdef HAVE_PLURAL
    2323#include <summator.h> // for CPolynomialSummator class
    2424#include <ring.h>
     
    4141    m_temp.m_bucket = sBucketCreate(rBaseRing);
    4242  }
    43 };
     43}
    4444
    4545/*
     
    5050#ifdef PDEBUG
    5151  p_Test(pInitialSum, rBaseRing);
    52 #endif   
     52#endif
    5353
    5454  if(bUsePolynomial)
     
    7676#ifdef PDEBUG
    7777      p_Test(m_temp.m_poly, m_basering);
    78 #endif   
    79      
     78#endif
    8079      p_Delete(&m_temp.m_poly, m_basering);
    8180//      m_temp.m_poly = NULL;
     
    8786#ifdef PDEBUG
    8887  p_Test(pSummand, m_basering);
    89 #endif   
    90  
     88#endif
     89
    9190  if(m_bUsePolynomial)
    9291    m_temp.m_poly = p_Add_q(m_temp.m_poly, pSummand, m_basering);
     
    9998#ifdef PDEBUG
    10099  p_Test(pSummand, m_basering);
    101 #endif   
     100#endif
    102101
    103102  if(m_bUsePolynomial)
     
    110109{
    111110  poly out = NULL;
    112  
     111
    113112  if(m_bUsePolynomial)
    114113  {
    115114    out = m_temp.m_poly;
    116115    m_temp.m_poly = NULL;
    117   } else
     116  }
     117  else
    118118  {
    119119    int pLength;
     
    123123#ifdef PDEBUG
    124124  p_Test(out, m_basering);
    125 #endif   
    126  
     125#endif
     126
    127127  return out;
    128128}
     
    132132{
    133133  poly out = NULL;
    134  
     134
    135135  if(m_bUsePolynomial)
    136136  {
     
    138138    m_temp.m_poly = NULL;
    139139    *piLength = pLength(out);
    140   } else
     140  }
     141  else
    141142  {
    142143    *piLength = 0;
     
    147148  p_Test(out, m_basering);
    148149  assume(pLength(out) == *piLength);
    149 #endif   
    150  
     150#endif
     151
    151152  return out;
    152153}
     
    157158{
    158159  AddAndDelete(p_Copy(pSummand, m_basering), iLength);
    159 };
     160}
    160161
    161162void CPolynomialSummator::Add(poly pSummand)
    162163{
    163164  AddAndDelete(p_Copy(pSummand, m_basering));
    164 };
     165}
    165166
    166 
     167#endif
  • kernel/summator.h

    r9d249b r9d0c2b  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: summator.h,v 1.1 2008-07-04 14:19:38 motsak Exp $ */
     6/* $Id: summator.h,v 1.2 2008-07-08 08:18:27 Singular Exp $ */
    77
    88// #include <summator.h> // for CPolynomialSummator class
     
    1515// CPolynomialSummator: unifies bucket and polynomial summation as the
    1616// later is brocken in buckets :(
    17 
     17#ifdef HAVE_PLURAL
    1818class CPolynomialSummator
    1919{
     
    2121    ring m_basering;
    2222    bool m_bUsePolynomial;
    23     union {
     23    union
     24    {
    2425      sBucket_pt m_bucket;
    2526      poly       m_poly;
    26     } m_temp;   
     27    } m_temp;
    2728  public:
    2829    CPolynomialSummator(ring rBaseRing, bool bUsePolynomial = false);
     
    3334    void AddAndDelete(poly pSummand, int iLength);
    3435    void AddAndDelete(poly pSummand);
    35    
     36
    3637    inline void operator +=(poly pSummand){ AddAndDelete(pSummand); }
    3738
     
    4041    void Add(poly pSummand, int iLength);
    4142    void Add(poly pSummand);
    42    
     43
    4344    // get the final result and clear (set to zero) the summator
    4445    poly AddUpAndClear();
     
    4647
    4748    inline operator poly() { return AddUpAndClear(); }
    48    
     49
    4950  private: // no copies of this object at the moment!!!
    5051    CPolynomialSummator(const CPolynomialSummator& m);               // Copy constructor
    51     CPolynomialSummator& operator= (const CPolynomialSummator& m);   // Assignment operator   
     52    CPolynomialSummator& operator= (const CPolynomialSummator& m);   // Assignment operator
    5253};
    5354
     55#endif
    5456#endif // ifndef  SUMMATOR_H
    5557
    56 
    57 
    58 
    59 
    60 
Note: See TracChangeset for help on using the changeset viewer.