Changeset 170190 in git for libpolys/coeffs/flintcf_Q.cc


Ignore:
Timestamp:
Jul 11, 2018, 3:13:33 PM (5 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'df6a8e29030ff93c6ad53051028727af7d339fa0')
Children:
5ae8037e422aeec41a17fdbdf8c5cb661013b286
Parents:
96694aac578fe7e8746e7a01df024dadc8770d81
Message:
fix: ssi for flintQ(...) polys
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/flintcf_Q.cc

    r96694a r170190  
    4545}
    4646
    47 static void CoeffWrite(const coeffs r, BOOLEAN details)
    48 {
    49   PrintS("flint fmpq_poly");
    50 }
    5147static BOOLEAN CoeffIsEqual(const coeffs r, n_coeffType n, void * parameter)
    5248{
     
    526522char * CoeffName(const coeffs r)
    527523{
    528   return (char*)"flint:Q[a]";
     524  static char CoeffName_flint_Q[20];
     525  sprintf(CoeffName_flint_Q,"flint:QQ[%s]",r->pParameterNames[0]);
     526  return (char*)CoeffName_flint_Q;
     527
    529528}
    530529static char* CoeffString(const coeffs r)
    531530{
    532   return omStrDup(CoeffName(r));
     531  char *buf=(char*)omAlloc(12+strlen(r->pParameterNames[0]));
     532  sprintf(buf,"flintQ(\"%s\")",r->pParameterNames[0]);
     533  return buf;
     534}
     535static void CoeffWrite(const coeffs r, BOOLEAN details)
     536{
     537  PrintS(CoeffName(r));
     538}
     539coeffs flintQInitCfByName(char *s,n_coeffType n)
     540{
     541  const char start[]="flint:QQ[";
     542  const int start_len=strlen(start);
     543  if (strncmp(s,start,start_len)==0)
     544  {
     545    s+=start_len;
     546    char st[10];
     547    int l=sscanf(s,"%s",st);
     548    if (l==1)
     549    {
     550      while (st[strlen(st)-1]==']') st[strlen(st)-1]='\0';
     551      return nInitChar(n,(void*)st);
     552    }
     553  }
     554  return NULL;
    533555}
    534556#ifdef LDEBUG
     
    540562BOOLEAN flintQ_InitChar(coeffs cf, void * infoStruct)
    541563{
     564  char *pp=(char*)infoStruct;
    542565  cf->cfCoeffString  = CoeffString;
    543566  cf->cfCoeffName    = CoeffName;
     
    605628  cf->iNumberOfParameters = 1;
    606629  char **pn=(char**)omAlloc0(sizeof(char*));
    607   pn[0]=(char*)omStrDup("a");
     630  pn[0]=omStrDup(pp);
    608631  cf->pParameterNames = (const char **)pn;
    609632  cf->has_simple_Inverse= FALSE;
Note: See TracChangeset for help on using the changeset viewer.