Changeset cf29809 in git


Ignore:
Timestamp:
Jun 30, 1997, 2:31:44 PM (27 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
c404887f96dfef9cbd021add3ee8d350244f6087
Parents:
7adb5028d58cd523bb79d18cb12bbde01aa25097
Message:
* hannes: changes to manual suggested by Christian Gorzel
       (doc/singular.doc)
       added libs of Martin Lamm (LIB/HNPuiseux.lib LIB/primitiv.lib)
       det(intmat) yields an error if m is not a square matrix
       minor(m,i) yields an error if i<=0
       minor optimization in error checking code of det/minor
       (clapsing.cc ideals.cc iparith.cc)


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

Legend:

Unmodified
Added
Removed
  • Singular/clapsing.cc

    r7adb502 rcf29809  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 // $Id: clapsing.cc,v 1.8 1997-06-17 10:59:33 Singular Exp $
     5// $Id: clapsing.cc,v 1.9 1997-06-30 12:31:38 Singular Exp $
    66/*
    77* ABSTRACT: interface between Singular and factory
     
    599599poly singclap_det( const matrix m )
    600600{
     601  int r=m->rows();
     602  if (r!=m->cols())
     603  {
     604    Werror("det of %d x %d matrix",r,m->cols());
     605    return NULL;
     606  }
    601607  poly res=NULL;
    602608  if ( nGetChar() == 0 || nGetChar() > 1 )
    603609  {
    604610    setCharacteristic( nGetChar() );
    605     CFMatrix M(m->rows(),m->cols());
     611    CFMatrix M(r,r);
    606612    int i,j;
    607     for(i=1;i<=m->rows();i++)
    608     {
    609       for(j=1;j<=m->cols();j++)
     613    for(i=1;i<=r;i++)
     614    {
     615      for(j=1;j<=r;j++)
    610616      {
    611617        M(i,j)=convSingPClapP(MATELEM(m,i,j));
    612618      }
    613619    }
    614     res= convClapPSingP( determinant(M,m->rows())) ;
    615   }
    616   // and over Q(a) / Fp(a)
    617   else if (( nGetChar()==1 ) /* Q(a) */
    618   || (nGetChar() <-1))       /* Fp(a) */
    619   {
    620     if (nGetChar()==1) setCharacteristic( 0 );
    621     else               setCharacteristic( -nGetChar() );
    622     CFMatrix M(m->rows(),m->cols());
     620    res= convClapPSingP( determinant(M,r) ) ;
     621  }
     622  // and over Q(a) / Fp(a)
     623  else if (( nGetChar()==1 ) /* Q(a) */
     624  || (nGetChar() <-1))       /* Fp(a) */
     625  {
     626    if (nGetChar()==1) setCharacteristic( 0 );
     627    else               setCharacteristic( -nGetChar() );
     628    CFMatrix M(r,r);
    623629    poly res;
    624630    if (currRing->minpoly!=NULL)
     
    627633      Variable a=rootOf(mipo);
    628634      int i,j;
    629       for(i=1;i<=m->rows();i++)
    630       {
    631         for(j=1;j<=m->cols();j++)
     635      for(i=1;i<=r;i++)
     636      {
     637        for(j=1;j<=r;j++)
    632638        {
    633639          M(i,j)=convSingAPClapAP(MATELEM(m,i,j),a);
    634640        }
    635641      }
    636       res= convClapAPSingAP( determinant(M,m->rows())) ;
     642      res= convClapAPSingAP( determinant(M,r) ) ;
    637643    }
    638644    else
    639645    {
    640646      int i,j;
    641       for(i=1;i<=m->rows();i++)
    642       {
    643         for(j=1;j<=m->cols();j++)
     647      for(i=1;i<=r;i++)
     648      {
     649        for(j=1;j<=r;j++)
    644650        {
    645651          M(i,j)=convSingTrPClapP(MATELEM(m,i,j));
    646652        }
    647653      }
    648       res= convClapPSingTrP( determinant(M,m->rows()));
     654      res= convClapPSingTrP( determinant(M,r) );
    649655    }
    650656  }
  • Singular/ideals.cc

    r7adb502 rcf29809  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.9 1997-06-17 09:44:22 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.10 1997-06-30 12:31:40 Singular Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    19301930    ideal I=idInit(1,1);
    19311931    I->m[0]=pOne();
    1932     return I; 
     1932    return I;
    19331933  }
    19341934  if (deg == 1)
     
    21582158ideal idMinors(matrix a, int ar)
    21592159{
     2160  if(ar<=0)
     2161  {
     2162    Werror("%d-th minor ",ar);
     2163    return NULL;
     2164  }
    21602165  int     i,j,k,size;
    21612166  int *rowchoise,*colchoise;
     
    29402945    for (j=IDELEMS(res)-1;j>=0;j--)
    29412946    {
    2942       if ((res->m[j]!=NULL) && (pIsConstantComp(res->m[j])) && 
     2947      if ((res->m[j]!=NULL) && (pIsConstantComp(res->m[j])) &&
    29432948           (pNext(res->m[j])==NULL))
    29442949      {
  • Singular/iparith.cc

    r7adb502 rcf29809  
    22812281static BOOLEAN jjDET_I(leftv res, leftv v)
    22822282{
     2283  intvec * m=(intvec*)v->Data();
    22832284  int i,j;
    2284   intvec * m=(intvec*)v->Data();
    2285   res->data = (char *)singclap_det_i(m);
     2285  i=m->rows();j=m->cols();
     2286  if(i==j)
     2287    res->data = (char *)singclap_det_i(m);
     2288  else 
     2289  {
     2290    Werror("det of %d x %d intmat",i,j);
     2291    return TRUE;
     2292  } 
    22862293  return FALSE;
    22872294}
Note: See TracChangeset for help on using the changeset viewer.