Changeset 1a4c80b in git


Ignore:
Timestamp:
Jul 11, 2014, 12:30:51 PM (9 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
4e2cc188f9d61d04296ddb7df63d0eaccd719584
Parents:
3169ca78b60cbcbd96901fbd89cf164a5ed0b62d
git-author:
Martin Lee <martinlee84@web.de>2014-07-11 12:30:51+02:00
git-committer:
Martin Lee <martinlee84@web.de>2014-07-17 12:07:11+02:00
Message:
chg: added leftShift of CanonicalForms
chg: use leftShift in computation of cyclotomic polys
Location:
factory
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • factory/canonicalform.h

    r3169ca r1a4c80b  
    271271
    272272bool hasFirstAlgVar( const CanonicalForm & f, Variable & a);
     273
     274CanonicalForm leftShift (const CanonicalForm& F, int n);
    273275//}}}
    274276
  • factory/cf_cyclo.cc

    r3169ca r1a4c80b  
    131131  for (int i= 0; i < distinct_factors_length; i++)
    132132  {
    133     result= result (power (x, distinct_factors[i]), x)/result;
     133    result= leftShift (result, distinct_factors[i])/result;
    134134    prod *= distinct_factors[i];
    135135  }
    136   return result (power (x, n/prod), x);
     136  return leftShift (result, n/prod);
    137137}
    138138
  • factory/cf_ops.cc

    r3169ca r1a4c80b  
    677677  return false;
    678678}
     679
     680/** left shift the main variable of F by n
     681 *  @return if x is the main variable of F the result is F(x^n)
     682 **/
     683CanonicalForm leftShift (const CanonicalForm& F, int n)
     684{
     685  ASSERT (n >= 0, "cannot left shift by negative number");
     686  if (F.inBaseDomain())
     687    return F;
     688  if (n == 0)
     689    return F;
     690  Variable x=F.mvar();
     691  CanonicalForm result= 0;
     692  for (CFIterator i= F; i.hasTerms(); i++)
     693    result += i.coeff()*power (x, i.exp()*n);
     694  return result;
     695}
Note: See TracChangeset for help on using the changeset viewer.