Changeset de88371 in git


Ignore:
Timestamp:
Jul 18, 2012, 3:28:22 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '96ce329119711a2b80858c8365abd29f8460bbfa')
Children:
91ecf187772d8c5893550eabd5abde87d2f29b9c
Parents:
975db1808b2b0917d858a9096710abc55c256aec
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-07-18 15:28:22+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-07-18 15:41:07+02:00
Message:
Added stubs for putting the actual code (TODO!), where required (i.e. described) by Hans

chg: descriptions for the output number (n_ClearContent & n_ClearDenominators)
chg: publicly available default implementations ndClearContent & ndClearDenominators for fallback calls
Location:
libpolys
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/coeffs.h

    r975db18 rde88371  
    813813/// Computes the content and (inplace) divides it out on a collection
    814814/// of numbers
    815 /// NOTE/TODO: see the description by Hans
    816 /// TODO: what exactly is c?
     815/// number @em c is the content (i.e. the GCD of all the coeffs, which
     816/// we divide out inplace)
     817/// NOTE: it assumes all coefficient numbers to be integer!!!
     818/// NOTE/TODO: see also the description by Hans
     819/// TODO: rename into n_ClearIntegerContent
    817820static inline void n_ClearContent(ICoeffsEnumerator& numberCollectionEnumerator, number& c, const coeffs r)
    818821{
     
    822825
    823826/// (inplace) Clears denominators on a collection of numbers
    824 /// NOTE/TODO: see the description by Hans
    825 /// TODO: what exactly is d?
     827/// number @em d is the LCM of all the coefficient denominators (i.e. the number
     828/// with which all the number coeffs. were multiplied)
     829/// NOTE/TODO: see also the description by Hans
    826830static inline void n_ClearDenominators(ICoeffsEnumerator& numberCollectionEnumerator, number& d, const coeffs r)
    827831{
  • libpolys/coeffs/longrat.cc

    r975db18 rde88371  
    26382638}
    26392639
     2640static void nlClearContent(ICoeffsEnumerator& /*numberCollectionEnumerator*/, number& c, const coeffs cf)
     2641{
     2642  assume(cf != NULL);
     2643  assume(getCoeffType(cf) == ID);
     2644  // all coeffs are given by integers!!!
     2645
     2646  c = n_Init(1, cf);
     2647  assume(FALSE); // TODO: NOT YET IMPLEMENTED!!!
     2648
     2649//   numberCollectionEnumerator.Reset();
     2650//
     2651//   c = numberCollectionEnumerator.Current();
     2652//
     2653//   n_Normalize(c, r);
     2654//
     2655//   if (!n_IsOne(c, r))
     2656//   {   
     2657//     numberCollectionEnumerator.Current() = n_Init(1, r); // ???
     2658//
     2659//     number inv = n_Invers(c, r);
     2660//
     2661//     while( numberCollectionEnumerator.MoveNext() )
     2662//     {
     2663//       number &n = numberCollectionEnumerator.Current();
     2664//       n_Normalize(n, r); // ?
     2665//       n_InpMult(n, inv, r);
     2666//     }
     2667//
     2668//     n_Delete(&inv, r);
     2669//   }
     2670}
     2671
     2672static void nlClearDenominators(ICoeffsEnumerator& /*numberCollectionEnumerator*/, number& c, const coeffs cf)
     2673{
     2674  assume(cf != NULL);
     2675  assume(getCoeffType(cf) == ID);
     2676  // all coeffs are given by integers!!!
     2677
     2678  c = n_Init(1, cf);
     2679  assume(FALSE); // TODO: NOT YET IMPLEMENTED!!!
     2680}
     2681
    26402682BOOLEAN nlInitChar(coeffs r, void*)
    26412683{
     
    26952737  r->cfInit_bigint=nlCopyMap;
    26962738  r->cfCoeffWrite=nlCoeffWrite;
     2739
     2740  r->cfClearContent = nlClearContent;
     2741  r->cfClearDenominators = nlClearDenominators;
     2742 
    26972743#ifdef LDEBUG
    26982744  // debug stuff
  • libpolys/coeffs/numbers.cc

    r975db18 rde88371  
    124124int ndSize(number a, const coeffs r) { return (int)n_IsZero(a,r)==FALSE; }
    125125
    126 /// divide by the first (leading) number and return it, i.e. make monic
    127 static void ndClearContent(ICoeffsEnumerator& numberCollectionEnumerator, number& c, const coeffs r)
     126void ndClearContent(ICoeffsEnumerator& numberCollectionEnumerator, number& c, const coeffs r)
    128127{
    129128  assume(r != NULL);
     
    185184}
    186185
    187 /// does nothing (just returns a dummy one number)
    188 static void ndClearDenominators(ICoeffsEnumerator& /*numberCollectionEnumerator*/, number& d, const coeffs r)
     186void ndClearDenominators(ICoeffsEnumerator& /*numberCollectionEnumerator*/, number& d, const coeffs r)
    189187{
    190188  assume( r != NULL );
  • libpolys/coeffs/numbers.h

    r975db18 rde88371  
    9595n_coeffType nRegister(n_coeffType n, cfInitCharProc p);
    9696
     97/// divide by the first (leading) number and return it, i.e. make monic
     98void ndClearContent(ICoeffsEnumerator& numberCollectionEnumerator, number& c, const coeffs r);
     99
     100/// does nothing (just returns a dummy one number)
     101void ndClearDenominators(ICoeffsEnumerator& numberCollectionEnumerator, number& d, const coeffs r);
     102
    97103#endif
  • libpolys/polys/ext_fields/algext.cc

    r975db18 rde88371  
    831831}
    832832
     833static void naClearContent(ICoeffsEnumerator& /*numberCollectionEnumerator*/, number& c, const coeffs cf)
     834{
     835  assume(cf != NULL);
     836  assume(getCoeffType(cf) == ID);
     837  assume(nCoeff_is_Q_a(cf)); // only over Q[a]/m(a), while the default impl. is used over Zp[a]/m(a) !
     838  // all coeffs are given by integers!!!
     839
     840  c = n_Init(1, cf);
     841  assume(FALSE); // TODO: NOT YET IMPLEMENTED!!!
     842
     843//   numberCollectionEnumerator.Reset();
     844//
     845//   c = numberCollectionEnumerator.Current();
     846//
     847//   n_Normalize(c, r);
     848//
     849//   if (!n_IsOne(c, r))
     850//   {   
     851//     numberCollectionEnumerator.Current() = n_Init(1, r); // ???
     852//
     853//     number inv = n_Invers(c, r);
     854//
     855//     while( numberCollectionEnumerator.MoveNext() )
     856//     {
     857//       number &n = numberCollectionEnumerator.Current();
     858//       n_Normalize(n, r); // ?
     859//       n_InpMult(n, inv, r);
     860//     }
     861//
     862//     n_Delete(&inv, r);
     863//   }
     864}
     865
     866
    833867BOOLEAN naInitChar(coeffs cf, void * infoStruct)
    834868{
     
    914948  cf->cfParameter = naParameter;
    915949
     950  if( nCoeff_is_Q(R->cf) )
     951    cf->cfClearContent = naClearContent;
     952 
    916953  return FALSE;
    917954}
  • libpolys/polys/ext_fields/transext.cc

    r975db18 rde88371  
    14051405}
    14061406
     1407static void ntClearContent(ICoeffsEnumerator& /*numberCollectionEnumerator*/, number& c, const coeffs cf)
     1408{
     1409  assume(cf != NULL);
     1410  assume(getCoeffType(cf) == ID);
     1411  assume(nCoeff_is_Q_a(cf)); // only over Q(a), while the default impl. is used over Zp(a) !
     1412  // all coeffs are given by integers!!!
     1413
     1414  c = n_Init(1, cf);
     1415  assume(FALSE); // TODO: NOT YET IMPLEMENTED!!!
     1416
     1417//   numberCollectionEnumerator.Reset();
     1418//
     1419//   c = numberCollectionEnumerator.Current();
     1420//
     1421//   n_Normalize(c, r);
     1422//
     1423//   if (!n_IsOne(c, r))
     1424//   {   
     1425//     numberCollectionEnumerator.Current() = n_Init(1, r); // ???
     1426//
     1427//     number inv = n_Invers(c, r);
     1428//
     1429//     while( numberCollectionEnumerator.MoveNext() )
     1430//     {
     1431//       number &n = numberCollectionEnumerator.Current();
     1432//       n_Normalize(n, r); // ?
     1433//       n_InpMult(n, inv, r);
     1434//     }
     1435//
     1436//     n_Delete(&inv, r);
     1437//   }
     1438}
     1439
     1440static void ntClearDenominators(ICoeffsEnumerator& /*numberCollectionEnumerator*/, number& c, const coeffs cf)
     1441{
     1442  assume(cf != NULL);
     1443  assume(getCoeffType(cf) == ID); // both over Q(a) and Zp(a)!
     1444  // all coeffs are given by integers!!!
     1445
     1446  c = n_Init(1, cf);
     1447  assume(FALSE); // TODO: NOT YET IMPLEMENTED!!!
     1448}
     1449
    14071450BOOLEAN ntInitChar(coeffs cf, void * infoStruct)
    14081451{
     
    14871530  cf->cfParameter = ntParameter;
    14881531
     1532  if( nCoeff_is_Q(R->cf) )
     1533    cf->cfClearContent = ntClearContent;
     1534
     1535  cf->cfClearDenominators = ntClearDenominators;
    14891536
    14901537  return FALSE;
Note: See TracChangeset for help on using the changeset viewer.