|PGmorematrixmacros.pl||topic started 9/14/2004; 2:15:44 PM
last post 9/14/2004; 2:15:44 PM
|Michael Gage - PGmorematrixmacros.pl
9/14/2004; 2:15:44 PM (reads: 1274, responses: 0)
This method returns a random nxn diagonal matrix.
Compares a list of vectors by finding the change of coordinate matrix from the Prof's vectors to the students, and then taking the determinant of that to determine the existence of the change of coordinate matrix going the other way.
ANS( basis_cmp( vectors_as_array_ref_in_array_ref, options_hash ) );
1. a reference to an array of correct vectors
debug -- if set to 1, provides verbose listing of
help -- 'none' (default) (is quiet on all errors)
Returns an answer evaluator.
Made to keep the same format as num_cmp and fun_cmp.
This is a check_syntax type method (in fact I borrowed some of that method's code) for vector input. The student needs to enter vectors like: [1,0,0],[1,2,3],[0,9/sqrt(10),1/sqrt(10)] Each entry can contain functions and operations and the usual math constants (pi and e). The vectors, however can not be added or multiplied or scalar multiplied by the student. Most errors are handled well. Any error in an entry is caught by the PG_answer_eval like it is in num_cmp or fun_cmp. Right now the method basically ignores every thing outside the vectors. Also, an unmatched open parenthesis is caught, but a unmatched close parenthesis ends the vector, and since everything outside is ignored, no error is sent (other than the later when the length of the vectors is checked. In the end, the method returns an array of Matrix objects.
This filter was created to get, format, and evaluate each entry of the ans_array
File path = /ww/webwork/pg/macros/PGmorematrixmacros.pl