Changeset c3f34a in git for Singular/iparith.cc


Ignore:
Timestamp:
Feb 1, 2010, 6:53:05 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
4a1fb878bfdf0417563882a38427ef60ca87a5ce
Parents:
70395a0628894689bc48f60363faeb0a2166ff8a
Message:
type conversion in minor

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

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    r70395a rc3f34a  
    59885988       most. (Cached monomials are counted over all cached polynomials.)
    59895989  */
    5990   const matrix m = (const matrix)v->Data();
    5991   const int mk = (const int)(long)v->next->Data();
     5990  matrix m;
     5991  leftv u=v->next;
     5992  v->next=NULL;
     5993  if (v->Typ()==MATRIX_CMD)
     5994  {
     5995     m = (const matrix)v->Data();
     5996  }
     5997  else
     5998  {
     5999    // try to convert to MATRIX:
     6000    int ii=iiTestConvert(v->Typ(),MATRIX_CMD);
     6001    BOOLEAN bo;
     6002    sleftv tmp;
     6003    if (ii>0) bo=iiConvert(v->Typ(),MATRIX_CMD,ii,v,&tmp);
     6004    else bo=TRUE;
     6005    if (bo)
     6006    {
     6007      Werror("cannot convert %s to matrix",Tok2Cmdname(v->Typ()));
     6008      return TRUE;
     6009    }
     6010    m=(matrix)tmp.data;
     6011  }
     6012  const int mk = (const int)(long)u->Data();
    59926013  bool noIdeal = true; bool noK = true; bool noAlgorithm = true;
    59936014  bool noCacheMinors = true; bool noCacheMonomials = true;
     
    59956016 
    59966017  /* here come the different cases of correct argument sets */
    5997   if ((v->next->next != NULL) && (v->next->next->Typ() == IDEAL_CMD))
    5998   {
    5999     IasSB = (ideal)v->next->next->Data();
     6018  if ((u->next != NULL) && (u->next->Typ() == IDEAL_CMD))
     6019  {
     6020    IasSB = (ideal)u->next->Data();
    60006021    noIdeal = false;
    6001     if ((v->next->next->next != NULL) && (v->next->next->next->Typ() == INT_CMD))
    6002     {
    6003       k = (int)(long)v->next->next->next->Data();
     6022    if ((u->next->next != NULL) && (u->next->next->Typ() == INT_CMD))
     6023    {
     6024      k = (int)(long)u->next->next->Data();
    60046025      noK = false;
    60056026      assume(k != 0);
    6006       if ((v->next->next->next->next != NULL) && (v->next->next->next->next->Typ() == STRING_CMD))
    6007       {
    6008         algorithm = (char*)v->next->next->next->next->Data();
     6027      if ((u->next->next->next != NULL) && (u->next->next->next->Typ() == STRING_CMD))
     6028      {
     6029        algorithm = (char*)u->next->next->next->Data();
    60096030        noAlgorithm = false;
    6010         if ((v->next->next->next->next->next != NULL) && (v->next->next->next->next->next->Typ() == INT_CMD))
     6031        if ((u->next->next->next->next != NULL) && (u->next->next->next->next->Typ() == INT_CMD))
    60116032        {
    6012           cacheMinors = (int)(long)v->next->next->next->next->next->Data();
     6033          cacheMinors = (int)(long)u->next->next->next->next->Data();
    60136034          noCacheMinors = false;
    6014           if ((v->next->next->next->next->next->next != NULL) && (v->next->next->next->next->next->next->Typ() == INT_CMD))
     6035          if ((u->next->next->next->next->next != NULL) && (u->next->next->next->next->next->Typ() == INT_CMD))
    60156036          {
    6016             cacheMonomials = (int)(long)v->next->next->next->next->next->next->Data();
     6037            cacheMonomials = (int)(long)u->next->next->next->next->next->Data();
    60176038            noCacheMonomials = false;
    60186039          }
     
    60216042    }
    60226043  }
    6023   else if ((v->next->next != NULL) && (v->next->next->Typ() == INT_CMD))
    6024   {
    6025     k = (int)(long)v->next->next->Data();
     6044  else if ((u->next != NULL) && (u->next->Typ() == INT_CMD))
     6045  {
     6046    k = (int)(long)u->next->Data();
    60266047    noK = false;
    60276048    assume(k != 0);
    6028     if ((v->next->next->next != NULL) && (v->next->next->next->Typ() == STRING_CMD))
    6029     {
    6030       algorithm = (char*)v->next->next->next->Data();
     6049    if ((u->next->next != NULL) && (u->next->next->Typ() == STRING_CMD))
     6050    {
     6051      algorithm = (char*)u->next->next->Data();
    60316052      noAlgorithm = false;
    6032       if ((v->next->next->next->next != NULL) && (v->next->next->next->next->Typ() == INT_CMD))
    6033       {
    6034         cacheMinors = (int)(long)v->next->next->next->next->Data();
     6053      if ((u->next->next->next != NULL) && (u->next->next->next->Typ() == INT_CMD))
     6054      {
     6055        cacheMinors = (int)(long)u->next->next->next->Data();
    60356056        noCacheMinors = false;
    6036         if ((v->next->next->next->next->next != NULL) && (v->next->next->next->next->next->Typ() == INT_CMD))
     6057        if ((u->next->next->next->next != NULL) && (u->next->next->next->next->Typ() == INT_CMD))
    60376058        {
    6038           cacheMonomials = (int)(long)v->next->next->next->next->next->Data();
     6059          cacheMonomials = (int)(long)u->next->next->next->next->Data();
    60396060          noCacheMonomials = false;
    60406061        }
     
    60426063    }
    60436064  }
    6044   else if ((v->next->next != NULL) && (v->next->next->Typ() == STRING_CMD))
    6045   {
    6046     algorithm = (char*)v->next->next->Data();
     6065  else if ((u->next != NULL) && (u->next->Typ() == STRING_CMD))
     6066  {
     6067    algorithm = (char*)u->next->Data();
    60476068    noAlgorithm = false;
    6048     if ((v->next->next->next != NULL) && (v->next->next->next->Typ() == INT_CMD))
    6049     {
    6050       cacheMinors = (int)(long)v->next->next->next->Data();
     6069    if ((u->next->next != NULL) && (u->next->next->Typ() == INT_CMD))
     6070    {
     6071      cacheMinors = (int)(long)u->next->next->Data();
    60516072      noCacheMinors = false;
    6052       if ((v->next->next->next->next != NULL) && (v->next->next->next->next->Typ() == INT_CMD))
    6053       {
    6054         cacheMonomials = (int)(long)v->next->next->next->next->Data();
     6073      if ((u->next->next->next != NULL) && (u->next->next->next->Typ() == INT_CMD))
     6074      {
     6075        cacheMonomials = (int)(long)u->next->next->next->Data();
    60556076        noCacheMonomials = false;
    60566077      }
     
    60626083  {
    60636084    if (strcmp(algorithm, "bareiss") == 0)
    6064       algorithm = "Bareiss";
     6085      algorithm = (char*)"Bareiss";
    60656086    if (strcmp(algorithm, "laplace") == 0)
    6066       algorithm = "Laplace";
     6087      algorithm = (char*)"Laplace";
    60676088    if (strcmp(algorithm, "cache") == 0)
    6068       algorithm = "Cache";
    6069   }
    6070 
     6089      algorithm = (char*)"Cache";
     6090  }
     6091
     6092  v->next=u;
    60716093  /* here come some tests */
    6072   if ((!noIdeal) && (!hasFlag(v->next->next, FLAG_STD)))
    6073   {
    6074     WerrorS("Provided ideal is not a standard basis.");
    6075     return TRUE;
     6094  if (!noIdeal)
     6095  {
     6096    assumeStdFlag(u->next);
    60766097  }
    60776098  if ((!noK) && (k == 0))
Note: See TracChangeset for help on using the changeset viewer.