Changeset 2f573cc in git


Ignore:
Timestamp:
Oct 12, 2010, 11:45:58 AM (14 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
cd3dd1380fd4640bedd9c9aadf0c15e9113e7a9c
Parents:
e31d298046b3c48cd4d618071c9f63b60c561667
Message:
new system function "factoras" to factorize over multiple extensions


git-svn-id: file:///usr/local/Singular/svn/trunk@13456 2c84dea3-7e68-4137-9b89-c4e89433aadc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    re31d29 r2f573cc  
    127127#include <kernel/clapconv.h>
    128128#include <kernel/kstdfac.h>
     129#include <factor.h>
    129130#endif
    130131#include <kernel/clapsing.h>
     
    33703371      }
    33713372      else
     3373  /*================= factoras =========================*/
     3374      if (strcmp (sys_cmd, "factoras") == 0)
     3375      {
     3376        if (h!=NULL && (h->Typ()== POLY_CMD) && (h->next->Typ() == IDEAL_CMD))
     3377        {
     3378          CanonicalForm F( convSingTrPFactoryP((poly)(h->Data())));
     3379          h= h->next;
     3380          ideal I= ((ideal) h->Data());
     3381          int i= IDELEMS (I);
     3382          CFList as;
     3383          for (int j= 0; j < i; j++)
     3384            as.append (convSingTrPFactoryP (I->m[j]));
     3385          int success= 0;
     3386          CFFList libfacResult= newfactoras (F, as, success);
     3387          if (success >= 0)
     3388          {
     3389            //convert factors
     3390            ideal factors= idInit(libfacResult.length(),1);
     3391            CFFListIterator j= libfacResult;
     3392            i= 0;
     3393            intvec *mult= new intvec (libfacResult.length());
     3394            for ( ; j.hasItem(); j++,i++ )
     3395            {
     3396              factors->m[i]= convFactoryPSingTrP (j.getItem().factor());
     3397              (*mult)[i]= j.getItem().exp();
     3398            }
     3399            lists l= (lists)omAllocBin( slists_bin);
     3400            l->Init(2);
     3401            l->m[0].rtyp= IDEAL_CMD;
     3402            l->m[0].data= (char *) factors;
     3403            l->m[1].rtyp= INTVEC_CMD;
     3404            l->m[1].data= (char *) mult;
     3405            res->data= l;
     3406            res->rtyp= LIST_CMD;
     3407            if (success == 0)
     3408              WerrorS ("factorization maybe incomplete");
     3409            return FALSE;
     3410          }
     3411          else
     3412          {
     3413            WerrorS("problem in libfac");
     3414            return TRUE;
     3415          }
     3416        }
     3417        else
     3418        {
     3419          WerrorS("`system(\"factoras\",<poly>,<ideal>) expected");
     3420          return TRUE;
     3421        }
     3422      }
     3423      else
    33723424  #endif
    33733425  #ifdef ix86_Win
  • libfac/charset/alg_factor.cc

    re31d29 r2f573cc  
    811811
    812812CFFList
    813 newcfactor(const CanonicalForm & f, const CFList & as, int success ){
     813newcfactor(const CanonicalForm & f, const CFList & as, int & success ){
    814814  Off(SW_RATIONAL);
    815815  CFFList Output, output, Factors=Factorize(f); On(SW_RATIONAL);
  • libfac/charset/alg_factor.h

    re31d29 r2f573cc  
    2828
    2929CFFList newfactoras( const CanonicalForm & f, const CFList & as, int &success);
    30 CFFList newcfactor(const CanonicalForm & f, const CFList & as, int success );
    3130/*BEGINPUBLIC*/
     31CFFList newcfactor(const CanonicalForm & f, const CFList & as, int & success );
    3232/*ENDPUBLIC*/
    3333
  • libfac/factor.h

    re31d29 r2f573cc  
    2222CFFList Factorize2(CanonicalForm F, const CanonicalForm & minpoly );
    2323CFFList newfactoras( const CanonicalForm & f, const CFList & as, int &success);
     24CFFList newcfactor( const CanonicalForm & f, const CFList & as, int &success);
    2425
    2526//// Note: InternalSqrFree does only the work needed for factorization.
Note: See TracChangeset for help on using the changeset viewer.