Changeset 9a4aed in git for libpolys/polys


Ignore:
Timestamp:
Oct 20, 2022, 3:22:05 PM (19 months ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
067348e6930401f2a0a341c37c3d316a5b3da586
Parents:
6469c282bedf5898b267f26f0af5ad47b00729aa
Message:
fix: debug stuff p_LmDivisble...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/pDebug.cc

    r6469c2 r9a4aed  
    359359#endif // PDEBUG
    360360
    361 #if defined(PDEBUG) || defined(PDIV_DEBUG)
    362 STATIC_VAR unsigned long pDivisibleBy_number = 1;
    363 STATIC_VAR unsigned long pDivisibleBy_FALSE = 1;
    364 STATIC_VAR unsigned long pDivisibleBy_ShortFalse = 1;
    365 
    366 BOOLEAN pDebugLmShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1,
    367                                poly p2, unsigned long not_sev_2, ring r_2)
    368 {
    369   _pPolyAssume(p_GetShortExpVector(p1, r_1) == sev_1, p1, r_1);
    370   _pPolyAssume(p_GetShortExpVector(p2, r_2) == ~ not_sev_2, p2, r_2);
    371 
    372   pDivisibleBy_number++;
    373   BOOLEAN ret;
    374   if (r_1 == r_2)
    375     ret = p_LmDivisibleBy(p1, p2, r_1);
    376   else
    377     ret = p_LmDivisibleBy(p1, r_1, p2, r_2);
    378 
    379   if (! ret) pDivisibleBy_FALSE++;
    380   if (sev_1 & not_sev_2)
    381   {
    382     pDivisibleBy_ShortFalse++;
    383     if (ret)
    384       dReportError("p1 divides p2, but sev's are wrong");
    385   }
    386   return ret;
    387 }
    388 
    389 BOOLEAN pDebugLmShortDivisibleByNoComp(poly p1, unsigned long sev_1, ring r_1,
    390                                        poly p2, unsigned long not_sev_2, ring r_2)
    391 {
    392 //  _pPolyAssume((p_GetComp(p1, r_1) == p_GetComp(p2, r_2)) || (p_GetComp(p1, r_1) == 0));
    393   _pPolyAssume(p_GetShortExpVector(p1, r_1) == sev_1, p1, r_1);
    394   _pPolyAssume(p_GetShortExpVector(p2, r_2) == ~ not_sev_2, p2, r_2);
    395 
    396   pDivisibleBy_number++;
    397   BOOLEAN ret;
    398   if (r_1 == r_2)
    399     ret = p_LmDivisibleByNoComp(p1, p2, r_1);
    400   else
    401     ret = p_LmDivisibleByNoComp(p1, r_1, p2, r_2);
    402 
    403   if (! ret) pDivisibleBy_FALSE++;
    404   if (sev_1 & not_sev_2)
    405   {
    406     pDivisibleBy_ShortFalse++;
    407     if (ret)
    408       dReportError("p1 divides p2, but sev's are wrong");
    409   }
    410   return ret;
    411 }
    412 
    413 void pPrintDivisbleByStat()
    414 {
    415   Print("#Tests: %ld; #FALSE %ld(%ld); #SHORT %ld(%ld)\n",
    416         pDivisibleBy_number,
    417         pDivisibleBy_FALSE, (unsigned long) ((double)pDivisibleBy_FALSE*((double) 100)/(double)pDivisibleBy_number),
    418         pDivisibleBy_ShortFalse, (unsigned long) ((double)pDivisibleBy_ShortFalse*((double)100)/(double)pDivisibleBy_FALSE));
    419 }
    420 
    421 #endif // PDEBUG
    422 
    423361#endif // PDEBUG_CC
Note: See TracChangeset for help on using the changeset viewer.