[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 5578 Revision 5579
1################################################################################ 1################################################################################
2# WeBWorK Online Homework Delivery System 2# WeBWorK Online Homework Delivery System
3# Copyright 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/ 3# Copyright 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4# $CVSHeader: pg/macros/contextLimitedPolynomial.pl,v 1.18 2007/10/31 01:34:11 dpvc Exp $ 4# $CVSHeader: pg/macros/contextLimitedPolynomial.pl,v 1.19 2007/10/31 01:40:01 dpvc Exp $
5# 5#
6# This program is free software; you can redistribute it and/or modify it under 6# This program is free software; you can redistribute it and/or modify it under
7# the terms of either: (a) the GNU General Public License as published by the 7# the terms of either: (a) the GNU General Public License as published by the
8# Free Software Foundation; either version 2, or (at your option) any later 8# Free Software Foundation; either version 2, or (at your option) any later
9# version, or (b) the "Artistic License" which comes with this package. 9# version, or (b) the "Artistic License" which comes with this package.
148 my $vIndex = LimitedPolynomial::getVarIndex($self); 148 my $vIndex = LimitedPolynomial::getVarIndex($self);
149 $self->{index} = $vIndex->{$self->{name}}; 149 $self->{index} = $vIndex->{$self->{name}};
150 $self->{exponents} = [(0) x scalar(keys %{$vIndex})]; 150 $self->{exponents} = [(0) x scalar(keys %{$vIndex})];
151 $self->{exponents}[$self->{index}] = 1; 151 $self->{exponents}[$self->{index}] = 1;
152 } elsif ($self->class eq 'Number') { 152 } elsif ($self->class eq 'Number') {
153 $self->{exponents} = []; 153 my $vIndex = LimitedPolynomial::getVarIndex($self);
154 $self->{exponents} = [(0) x scalar(keys %{$vIndex})];
154 } 155 }
155 if ($self->{exponents}) { 156 if ($self->{exponents}) {
156 my $power = join(',',@{$self->{exponents}}); 157 my $power = join(',',@{$self->{exponents}});
157 $self->{powers}{$power} = 1; 158 $self->{powers}{$power} = 1;
158 } 159 }

Legend:
Removed from v.5578  
changed lines
  Added in v.5579

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9