[system] / trunk / pg / lib / Value / Point.pm Repository:
ViewVC logotype

Log of /trunk/pg/lib/Value/Point.pm

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 3716 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Oct 16 03:37:17 2005 UTC (14 years, 1 month ago) by dpvc
File length: 5197 byte(s)
Diff to previous 3470
In the past, when Value objects were inserted into strings, they would
automatically include parentheses so that if you had $f equal to 1+x
and $g equal to 1-x, then Formula("$f/$g") would mean (1+x)/(1-x)
rather than 1+(x/1)-x, which is what would happen as a straing string
substitution.

The problem is that this would also happen for real numbers, vectors,
and everything else, even when it wasn't necessary.  So if $x=Real(3),
then "Let x = $x" would be "Let x = (3)".

I have changed the behavior of the string concatenation for Value
objects so that parentheses are only added in a few cases: for
Formulas, Complex numbers, and Unions.  This makes the other Value
objects work more like regular variables in strings, but might cause
some problems with strings that are used as formulas.  For example, if
$a = Real(-3), then "x + 2 $a" will become "x + 2 -3", or "x-1" rather
than the expected "x - 6".  (The old approach would have made it "x +
2 (-3)" which would have worked properly).  For the most part, it is
easier to use something like "x + 2*$a" or even "x" + 2*$a in this
case, so the extra trouble of having to avoid parentheses when you
really meant to substitute the value into a string didn't seem worth
it.

Revision 3470 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 11 14:25:53 2005 UTC (14 years, 3 months ago) by dpvc
File length: 5189 byte(s)
Diff to previous 3370
Changes needed for new Set object, and moving of string, TeX and perl
methods to Value.pm

Revision 3370 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 12 22:29:53 2005 UTC (14 years, 4 months ago) by dpvc
File length: 6287 byte(s)
Diff to previous 3265
A first pass at making parser error messages localizable.  The
Context()->{error}{msg} hash can be used to specify translations of
the standard messages.  For example,

    Context()->{error}{msg}{'Division by zero'} = "Don't divide by zero, dude!";
    Context()->{error}{msg}{'Function '%s' has too many inputs'} =
        "You passed too many arguments to '%s'";

(I didn't translate into another language, here, but you could do
that, too.)

The msg hash could also be used within answer checkers to make certain
answer messages more appropriate for the given type of expected answer.

Revision 3265 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jun 5 23:22:20 2005 UTC (14 years, 6 months ago) by dpvc
File length: 6286 byte(s)
Diff to previous 3261
Better handling of open and close delimiters that are explicitly set.

Revision 3261 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Jun 4 13:50:41 2005 UTC (14 years, 6 months ago) by dpvc
File length: 6284 byte(s)
Diff to previous 3192
Avoid possible infinite loop with length and typeref calls.

Revision 3192 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 16 13:30:28 2005 UTC (14 years, 8 months ago) by dpvc
File length: 6363 byte(s)
Diff to previous 3171
Update the overloaded operators so that they can be overridden by
subclasses of the predefined object classes.  This involves calling
the objects method rather than using a hard reference to the routine
in the parent class.

Also, change the name of the string comparison routine to
compare_string to avoid conflicts with cmp that is used to produce the
answer checker for the class.

Finally, in Value.pm, promotePrecedence no longer has to do fancy
footwork to get "special" precedence to work (this was a hack to get
around the misfeature of the overloaded operators -- now that that is
being handled correctly, there is no need for it).

Revision 3171 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Feb 15 21:53:23 2005 UTC (14 years, 9 months ago) by dpvc
File length: 6216 byte(s)
Diff to previous 3166
Improved the Real(), Complex(), Point(), Vector(), Matrix() and
String() constructors so that they will process formulas passed to
them as strings rather than requiring perl objects for these.

For example, you can use Real("2/3") rather than Real(2/3) if you
want.  Also, Real("1+x") will return a formula returning a real
(essentially the same as Formula("1+x") in this case).

Revision 3166 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Feb 15 02:20:52 2005 UTC (14 years, 9 months ago) by dpvc
File length: 6172 byte(s)
Diff to previous 3165
Fixed an error with Matrix() that could cause it to loop infinitely
when bad data is passed to it.

Also, allow Matrix(), Point(), Vector(), and Real() to accept string
values that are evaluated to produce the value returned.

(Sorry, accidentally committed with a blank message.)

Revision 3165 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Feb 15 02:16:10 2005 UTC (14 years, 9 months ago) by dpvc
File length: 6132 byte(s)
Diff to previous 2625
*** empty log message ***

Revision 2625 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 16 18:35:12 2004 UTC (15 years, 3 months ago) by dpvc
File length: 6060 byte(s)
Diff to previous 2615
Added string comparison to all Value object classes (to compare the
string value of an object to another string).

Overloaded perl '.' operator to do dot product when the operands are
formulas returning vectors.  (Part of the auto-generation of
formulas).

A few improvements to real and complex class output results.

Made Union class slightly more robust and removed need for makeUnion
method other than in the Union itself.

Revision 2615 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Aug 14 21:27:45 2004 UTC (15 years, 3 months ago) by dpvc
File length: 6057 byte(s)
Diff to previous 2612
*** empty log message ***

Revision 2612 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Aug 14 19:29:42 2004 UTC (15 years, 3 months ago) by dpvc
File length: 6042 byte(s)
Diff to previous 2606
Fixed some bugs in the handle of the context in ->string and ->TeX
methods of Value objects.

Revision 2606 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Aug 14 11:25:47 2004 UTC (15 years, 3 months ago) by dpvc
File length: 6024 byte(s)
Diff to previous 2603
Can now specify that the objects stringify themselfs in their TeX
forms rather than their answer-string forms.  This makes it easier to
use the objects in the text of a problem (without having to call ->TeX
explicitly each reference).

Use

       Context()->texStrings

to start outputting TeX strings, and

      Context()->normalStrings

to switch back.

Revision 2603 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 13 23:01:07 2004 UTC (15 years, 3 months ago) by dpvc
File length: 6067 byte(s)
Diff to previous 2592
Added an Infinite object class for the Value package.  Still need to
add it to the Parser package.

Revision 2592 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 12 16:40:47 2004 UTC (15 years, 3 months ago) by dpvc
File length: 6110 byte(s)
Diff to previous 2579
A number of small fixes.  Most were to fix minor bugs in string and
TeX output, particulary for the various list-based objects (like
vectors, intervals, etc.).  There were also some bug fixes in the
comparison routines.  Some additional checks were added for valid
intervals when the coordinates are formulas.

Revision 2579 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 9 21:38:01 2004 UTC (15 years, 3 months ago) by dpvc
File length: 6025 byte(s)
Diff to previous 2558
Significant update to new parser.

New features include:

  Better control over format of vector output (you can now
    specify ijk-format rather than <...> format)

  "Fuzzy" reals, where the relations like == return true when the
    two values are "close enough".  (This is controlable using
    parameters similar to those used in NUM_CMP).

  The fuzzy reals are now used in vectors/points/matrices/complexes/intervals
    and so on so that their relations will also be fuzzy.  E.g.,
    (1E-13,2) == (0,3) will be true, and norm(Vector(0,1E-13)) will
    equal 0.

  The two main portions of the parser (the Parser and Value packages)
    now share a common context object for configuration purposes.

Revision 2558 - (view) (download) (as text) (annotate) - [select for diffs]
Added Wed Jul 28 20:32:33 2004 UTC (15 years, 4 months ago) by sh002i
File length: 5339 byte(s)
merged changes from rel-2-1-a1 -- stop using that branch.

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9