Beispiel #1
0
// Mostly used to make skew vars...
void varpower::var(int v, int e, intarray &result)
{
  if (e == 0)
    result.append(1);
  else
    {
      check_var(v,e); // Sets ERROR if a problem...
      result.append(3);
      result.append(v);
      result.append(e);
    }
}
Beispiel #2
0
void varpower::power(const int *a, int n, intarray &result)
{
  if (n == 0)
    {
      result.append(1);
      return;
    }
  int *result_vp = result.alloc(*a);
  *result_vp++ = *a;
  for (index_varpower i = a; i.valid(); ++i)
    {
      *result_vp++ = i.var();
      *result_vp++ = safe::mult(i.exponent(),n);
    }
}
Beispiel #3
0
// Used in 2 places
void varpower::one(intarray &result) { result.append(1); }