Exemple #1
0
void IISource::get(Monomial& x) {
#if 1
  x.setToOne();
  Variable v;
  int type = getType();
  if(type==GBInputNumbers::s_IOFUNCTION) {
    pair<bool,Alias<ISource> > pr(queryNamedFunction("NonCommutativeMultiply"));
    if(pr.first) {
      while(!pr.second.access().eoi()) {
        pr.second.access().get(v);
        x *= v;
      };
    } else {
      get(v);
      x *= v;
    };
  } else if(type==GBInputNumbers::s_IOINTEGER) {
    int i;
    ((ISource *)this)->get(i);
    if(i!=1) DBG();
  } else if(type==GBInputNumbers::s_IOSYMBOL) {
    get(v);
    x *= v;
  } else {
    TellHead(*this);
    DBG();
  };
#else
  DBG();
#endif
};
Exemple #2
0
void IISource::get(Field& x) {
  int type = getType();
  if(type==GBInputNumbers::s_IOINTEGER) {
    int i;
    ((ISource*)this)->get(i);
    x = Field(i);
  } else if(type==GBInputNumbers::s_IOFUNCTION) {
    int i,j;
    symbolGB y;
    Alias<ISource> iso(inputFunction(y));
    if(y=="Rational") {
      iso.access().get(i);
      iso.access().get(j);
      x = Field(i,j);
    } else {
      TellHead(iso.access());
      DBG(); // Why would the code be here?
    }
  } else {
    TellHead(*this);
    DBG(); // Why would the code be here?
  }
};
Exemple #3
0
inline void TellHead(ISource & x) {
  TellHead(x,true);
};