Math 236  •  Spring 2001

About function invert

Version 1.0:  8 March 2001

⚠  Caution!!

Load the package LinearAlgebra`MatrixManipulation` before you evaluate the cell where your invert is defined!  Otherwise, you will get "shadowing" warning messages and your invert will not be able to access the function AppendRows from that package.

If you disregard this caution and get the shadowing message, do not despair.  Simply type and evaluate the expression
	Remove[AppendRows]
and then load the package and again evaluate the cell where your invert is defined.

Auxiliary function needed by invert

You will probably want to use the function AppendRows from the Standard Add-on package LinearAlgebra`MatrixManipulation`.  Get it by evaluating the following cell:

Needs["LinearAlgebra`MatrixManipulation`"]

Define your function invert

In a separate notebook—not this one—define your function invert and any other objects of your own that you might happen to need for it.

Example

Try out your own invert on the following two examples—and compare the results with those from the built-in function Inverse—before you attempt to run the validator!

a = {{1, 3}, {2, 5}};
invert[a]
Inverse[a]		(* compare! *)

b = {{1, 3}, {2, 6}};
invert[b]
Inverse[b]		(* compare! *)

Null === invert[b]

Get the validator package vdinvert.m

At any time before you are ready to validate your function invert, download my encoded package vdinvert.m in any one of the following three ways:

•  At UMASTR lab only: from the Math_236 directory on drive M: (labelled Math-Stat Files).  An icon for this drive is on the desktop of UMASTR PCs.

• Obtain the file vdinvert.zip from the Files page of the course web site http://www.math.umass.edu/Courses/Math_236.  Then extract the single file vdinvert.m from vdinvert.zip by using WinZip or another "unzip" program.  Be sure that the unzip program is configured so that it does not not change end-of-line characters (unless you are going to run the validator on a Mac or ona Linux PC)!

•  If you have an ftp client that does not change end-of-line characters (so not Netscape or Internet Explorer!), get the file vdinvert.m via anonymous ftp from:
	umastr.math.umass.edu
Set the initial remote directory to
 	/pub/lab/Math_236
and use binary mode (not text mode) to download the file vdinvert.m.  For network security reasons, such anonymous ftp access is limited to client compuers that are in the umass.edu domain.   This means that the ftp access must be made directly through a campus network-connected computer or via dial-up connection to OIT PPP ("UMAccess").

If you are using Mathematica on a Mac or under Linux

The latest information I have is that you need to change the end-of-line characters from the DOS convention of CR LF to the convention on your platform (just CR for Mac; just LF for Linux).  For example, under Linux, if you have downloaded vdinvert.zip as a binary file, give the command:
	unzip -a vdinvert.zip
This will extract vdinvert.m and, as it does so, convert the end-of-lines to the *nix LF.

Validating your function invert

A program of mine is going to generate a set of test matrices and evaluate your function invert in turn at each of these matrices.  The test matrices it uses for you are not necessarily the same as the test matrices it uses for others.  In fact, some of these matrices involve random numbers, and these random numbers depend in part on the digits in your student ID number.

Do the following four steps:

1.  Be sure that at this Mathematica session you have defined your invert and all the other objects it references directly or indirectly.  In particular, be sure you have already loaded the package LinearAlgebra`MatrixManipulation` so as to give you access to the function AppendRows from that package.

2.  Inside the double quotes in the next cell, type your  student ID number and then evaluate the cell.

myID = "";           
(* type your student ID number inside the quotes *)

Check that you correctly defined myID—evaluate the following cell now.  You should see your ID number as result.

myID

3.  Tell Mathematica where to look for my validator package vdinvert.m—edit the following cell so that its first line shows the correct path to the directory to which you downloaded or extracted vdinvert.m:

vdinvertpath  =  "c:/data";              
AppendTo[$Path,  vdinvertpath];

4.  Evaluate the preceding cell.  Check that the preceding cell was indeed evaluated—evaluate the following cell.  The result should include at its end the path to the directory holding the file vdinvert.m.

$Path

5.  Run the validator  that tests your function—evaluate the following cell now:

Needs["vdinvert`"]            (* run the validator *)

If you have forgotten to define myID correctly, then you can simply edit myID to make it correct—be sure your ID number is enclosed in double quotes—and then run the preceding cell with Needs["vdinvert`"] again.

If, however, at the current Mathematica session you forgot to define invert or some auxiliary function needed by it—in particular, if you forgot to load the package —, or if you need to fix up your invert to get it to work properly, then you should:
•  save your notebook containing your function definitions;
•  save this notebook Aboutinvert.nb with your myID and vdinvertpath defined;
•  quit Mathematica and start it again (or, if you know how, leave Mathematica open but quit the kernel and restart the kernel);
•  open your notebook with your function definitions and evaluate them all;
•  open this notebook Aboutinvert.nb, evaluate its cells defining my auxiliary functions and your myID and vdinvertpath; and
•  run the validator again by evaluating the cell Needs["vdinvert`"] .

What to turn in

Do not turn in a hardcopy of this entire notebook!  Rather, turn in only:

•  A listing of your invert and any other objects you defined for it.

•  The validation output that results from evaluating the cell Needs["vdinvert`"].