CPSC 212
(Data Structures and Algorithms)

Assignment 2

Objectives:
To create a simple 2D matrix class, find eigenvalues/eigenvectors.

Due date:
09/14/06

What to hand in:
Code "tarball" (e.g., asg2.tar.gz) including:
  1. README file containing assignment and solution descriptions, e.g., program design, description of algorithm, etc., if appropriate.
  2. INSTALL file containing any specific compliation quirks peculiar to your program, e.g.,
    Compilation: make -f Makefile.xirtam.
  3. USAGE file containing any specific usage quirks peculiar to your program, e.g.,
    Usage: ./xirtam < points.in where ./xirtam is the executable and points.in is the input.
  4. src/ directory with source code.

Description:
  1. Implement a matrix class (generic m x n), with functionality suggested in the matrix.h interface.

    At this point you don't need to worry about the unary and binary operators (including (const matrix&, const matrix&), (const matrix&, scalar), (const scalar&, const matrix&)) and the clamp() member function.

    (Howerver, you'll probably need all of these sooner or later so if you have time, you might as well implement as many of them as you can now -- for matrix inversion, implemented by operator!, use the ludcmp(int *indx,T *d) and lubksb(int *indx,T *b) routines from Numerical Recipes but take care to notice that NR usually used C-style arrays indexed at 1, not at 0!).

    You are free to rewrite the class interface and declare your own matrix class, so long as it satisfies the required funcionality requirements.

  2. Use the same points.in input file as for asg1.
  3. Your class must be able to find the eigenvalues and eigenvalues of a 2 x 2 matrix, as suggested in the xirtam.cpp driver.

    Note that you have to fill in some code here!

  4. Sample output can be found here: xirtam.out.