[system] / trunk / pg / macros / contextLimitedPolynomial.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/contextLimitedPolynomial.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 3383 Revision 4121
49# 49#
50sub checkPowers { 50sub checkPowers {
51 my $self = shift; 51 my $self = shift;
52 my ($l,$r) = ($self->{lop},$self->{rop}); 52 my ($l,$r) = ($self->{lop},$self->{rop});
53 my $single = $self->{equation}{context}->flag('singlePowers'); 53 my $single = $self->{equation}{context}->flag('singlePowers');
54 $l->{powers} = {1=>1} if $l->class eq 'Variable';
55 $r->{powers} = {1=>1} if $r->class eq 'Variable';
54 $self->{isPoly} = 1; 56 $self->{isPoly} = 1;
55 $self->{powers} = $l->{powers}? {%{$l->{powers}}} : {}; 57 $self->{powers} = $l->{powers}? {%{$l->{powers}}} : {};
56 $r->{powers} = {1=>1} if $r->class eq 'Variable';
57 return 1 unless $r->{powers}; 58 return 1 unless $r->{powers};
58 foreach my $n (keys(%{$r->{powers}})) { 59 foreach my $n (keys(%{$r->{powers}})) {
59 $self->Error("Polynomials can have at most one term of each degree") 60 $self->Error("Polynomials can have at most one term of each degree")
60 if $self->{powers}{$n} && $single; 61 if $self->{powers}{$n} && $single;
61 $self->{powers}{$n} = 1; 62 $self->{powers}{$n} = 1;

Legend:
Removed from v.3383  
changed lines
  Added in v.4121

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9