[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 5550 Revision 5551
1=head1 NAME
2
3contextLimitedPolynomial.pl - Allow only entry of polynomials.
4
5=head1 DESCRIPTION
6
7Implements a context in which students can only enter (expanded)
8polynomials (i.e., sums of multiples of powers of x).
9
10Select the context using:
11
12 Context("LimitedPolynomial");
13
14If you set the "singlePowers" flag, then only one monomial of each
15degree can be included in the polynomial:
16
17 Context("LimitedPolynomial")->flags->set(singlePowers=>1);
18
19There is also a strict limited context that does not allow
20operations even within the coefficients. Select it using:
21
22 Context("LimitedPolynomial-Strict");
23
24In addition to disallowing operations within the coefficients,
25this context does not reduce constant operations (since they are
26not allowed), and sets the singlePowers flag automatically. In
27addition, it disables all the functions, though they can be
28re-enabled, if needed.
29
30=cut
1 31
2loadMacros("MathObjects.pl"); 32loadMacros("MathObjects.pl");
3 33
4sub _contextLimitedPolynomial_init {LimitedPolynomial::Init()}; # don't load it again 34sub _contextLimitedPolynomial_init {LimitedPolynomial::Init()}; # don't load it again
5
6=head3 Context("LimitedPolynomial")
7
8 ##########################################################
9 #
10 # Implements a context in which students can only enter (expanded)
11 # polynomials (i.e., sums of multiples of powers of x).
12 #
13 # Select the context using:
14 #
15 # Context("LimitedPolynomial");
16 #
17 # If you set the "singlePowers" flag, then only one monomial of each
18 # degree can be included in the polynomial:
19 #
20 # Context("LimitedPolynomial")->flags->set(singlePowers=>1);
21 #
22 # There is also a strict limited context that does not allow
23 # operations even within the coefficients. Select it using:
24 #
25 # Context("LimitedPolynomial-Strict");
26 #
27 # In addition to disallowing operations within the coefficients,
28 # this context does not reduce constant operations (since they are
29 # not allowed), and sets the singlePowers flag automatically. In
30 # addition, it disables all the functions, though they can be
31 # re-enabled, if needed.
32 #
33
34=cut
35 35
36################################################## 36##################################################
37# 37#
38# Handle common checking for BOPs 38# Handle common checking for BOPs
39# 39#

Legend:
Removed from v.5550  
changed lines
  Added in v.5551

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9