Assignment 2 information

Announcements

Assignment information

whuang@cs.rpi.edu; email


Questions & Answers

Support code notes

Using SVL

As you can see in the example in the new assign2.cc, you should use the general matrix class for your computations for this assignment. SVL does provide other specific classes for 2x2, 3x3, and 4x4 matrices as well as 2, 3, 4, and arbitrary dimensional vectors. However, there are no methods that allow you to multiply two matrices and assign the result to a vector, even if that vector is the right size.

One somewhat unintuitive thing is that you must declare the size of the matrix. The constructor for the general matrix takes two integers as the first two arguments which specify the size. The remaining arguments are the elements of the matrix, given row by row, and they must not be integers. (So add a ".0" where needed.) You can access elements of matrices using regular C/C++ style array access (with brackets). The matrices are 0 indexed.

See the new assign2.cc file for some examples. You can also look at the documentation.

Support code update

The final 2/27 release of the support code contains a number of small changes in the support code:

Original release notes

Much of the support code is the same or similar to the support code for Assignment 1. Here are some of the notable changes:

Running under Linux

Let me emphasize that I am only officially supporting the CS department Solaris 2.8 environment. That said, the support code will compile and run under Linux. (There's no reason why it can't also be made to compile even under Windows.) Here's what I had to do to get the support code to compile and run under the Mandrake 8.1 distribution of Linux:

CGAL

Although CGAL said that it didn't support my compiler (GNU 2.96), it compiled and appears to work just fine. You can see where I set up the Makefile so that it would include the proper CGAL makefile on both systems. Depending on where you install it and which compiler you have, you'll probably have to change this.

OpenGL

There is a free open source graphics library called MESA which (mostly?) implements the OpenGL API. From the (more or less) default install of Mandrake Linux, I already had the package: I had to also install the packages: which were on the Mandrake installation CDs. I had to change the Makefile so that under Linux, the CUSTOM_LIBPATH variable also included the switch -L/usr/X11R6/lib. It turns out that the code will not run properly if this switch is included for linking under Solaris, so I set up the makefile so that it is only included under Linux.

Simple Vector Library (SVL)

According to the documentation, the only version of Linux this package only supports is Red Hat. It compiled fine under Mandrake, but then again Mandrake is similar to Red Hat.

The README file that comes with this package is not quite accurate about the install. Here are the commands I used to compile, install, and test the package:

make linux_RH                            ; to create configuration files
make                                     ; to compile the library
make DEST=/usr/local/svl install         ; after creating this directory, etc.
cd test
make test

Examples

Here are some example runs: