Changeset 1879f2 in git


Ignore:
Timestamp:
Jan 31, 2011, 12:06:33 PM (13 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
8739c990363a65087886b6c74d02b55411b26d87
Parents:
1cb8799c71414b852de448405f32c1423c54601b
Message:
test for sensible sizes of minors (in interpreter code)

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

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    r1cb879 r1879f2  
    61556155      noK = false;
    61566156      assume(k != 0);
    6157       if ((u->next->next->next != NULL) && (u->next->next->next->Typ() == STRING_CMD))
     6157      if ((u->next->next->next != NULL) &&
     6158          (u->next->next->next->Typ() == STRING_CMD))
    61586159      {
    61596160        algorithm = (char*)u->next->next->next->Data();
    61606161        noAlgorithm = false;
    6161         if ((u->next->next->next->next != NULL) && (u->next->next->next->next->Typ() == INT_CMD))
     6162        if ((u->next->next->next->next != NULL) &&
     6163            (u->next->next->next->next->Typ() == INT_CMD))
    61626164        {
    61636165          cacheMinors = (int)(long)u->next->next->next->next->Data();
    61646166          noCacheMinors = false;
    6165           if ((u->next->next->next->next->next != NULL) && (u->next->next->next->next->next->Typ() == INT_CMD))
     6167          if ((u->next->next->next->next->next != NULL) &&
     6168              (u->next->next->next->next->next->Typ() == INT_CMD))
    61666169          {
    6167             cacheMonomials = (int)(long)u->next->next->next->next->next->Data();
     6170            cacheMonomials =
     6171               (int)(long)u->next->next->next->next->next->Data();
    61686172            noCacheMonomials = false;
    61696173          }
     
    61816185      algorithm = (char*)u->next->next->Data();
    61826186      noAlgorithm = false;
    6183       if ((u->next->next->next != NULL) && (u->next->next->next->Typ() == INT_CMD))
     6187      if ((u->next->next->next != NULL) &&
     6188          (u->next->next->next->Typ() == INT_CMD))
    61846189      {
    61856190        cacheMinors = (int)(long)u->next->next->next->Data();
    61866191        noCacheMinors = false;
    6187         if ((u->next->next->next->next != NULL) && (u->next->next->next->next->Typ() == INT_CMD))
     6192        if ((u->next->next->next->next != NULL) &&
     6193            (u->next->next->next->next->Typ() == INT_CMD))
    61886194        {
    61896195          cacheMonomials = (int)(long)u->next->next->next->next->Data();
     
    62016207      cacheMinors = (int)(long)u->next->next->Data();
    62026208      noCacheMinors = false;
    6203       if ((u->next->next->next != NULL) && (u->next->next->next->Typ() == INT_CMD))
     6209      if ((u->next->next->next != NULL) &&
     6210          (u->next->next->next->Typ() == INT_CMD))
    62046211      {
    62056212        cacheMonomials = (int)(long)u->next->next->next->Data();
     
    62326239  }
    62336240  if ((!noAlgorithm) && (strcmp(algorithm, "Bareiss") != 0)
    6234       && (strcmp(algorithm, "Laplace") != 0) && (strcmp(algorithm, "Cache") != 0))
     6241      && (strcmp(algorithm, "Laplace") != 0)
     6242      && (strcmp(algorithm, "Cache") != 0))
    62356243  {
    62366244    WerrorS("Expected as algorithm one of 'B/bareiss', 'L/laplace', or 'C/cache'.");
     
    62406248      && (!currRingIsOverIntegralDomain()))
    62416249  {
    6242     WerrorS("Bareiss algorithm not defined over coefficient rings with zero divisors.");
     6250    Werror("Bareiss algorithm not defined over coefficient rings %s",
     6251           "with zero divisors.");
     6252    return TRUE;
     6253  }
     6254  if ((mk < 1) || (mk > m->rows()) || (mk > m->cols()))
     6255  {
     6256    Werror("invalid size of minors: %d (matrix is (%d x %d))", mk,
     6257           m->rows(), m->cols());
    62436258    return TRUE;
    62446259  }
     
    62526267  /* here come the actual procedure calls */
    62536268  if (noAlgorithm)
    6254     res->data = getMinorIdealHeuristic(m, mk, (noK ? 0 : k), (noIdeal ? 0 : IasSB), false);
     6269    res->data = getMinorIdealHeuristic(m, mk, (noK ? 0 : k),
     6270                                       (noIdeal ? 0 : IasSB), false);
    62556271  else if (strcmp(algorithm, "Cache") == 0)
    6256     res->data = getMinorIdealCache(m, mk, (noK ? 0 : k), (noIdeal ? 0 : IasSB), 3, cacheMinors, cacheMonomials, false);
     6272    res->data = getMinorIdealCache(m, mk, (noK ? 0 : k),
     6273                                   (noIdeal ? 0 : IasSB), 3, cacheMinors,
     6274                                   cacheMonomials, false);
    62576275  else
    6258     res->data = getMinorIdeal(m, mk, (noK ? 0 : k), algorithm, (noIdeal ? 0 : IasSB), false);
     6276    res->data = getMinorIdeal(m, mk, (noK ? 0 : k), algorithm,
     6277                              (noIdeal ? 0 : IasSB), false);
    62596278  if (v_typ!=MATRIX_CMD) idDelete((ideal *)&m);
    62606279  res->rtyp = IDEAL_CMD;
Note: See TracChangeset for help on using the changeset viewer.