Hints
- Homework 1. No comments.
- Note. As I mentioned in class you don't need to implement for P2 the directory
argument case. However if you want to peruse code that traverses directories iteratively,
here is a
link
to such source code.
- Homework 2. No comments.
- Homework 3. No comments.
- Homework 4. No comments.
- Homework 5. No comments.
- Homework Extra. If you want to test your code, make sure you
test it with a reasonably nonsingular matrix. There is a hint somewhere in the notes how
to deal with singularity. A matrix whose elements are reasonably small and i used once
to check LU decomposition code is the code/matrix given in the problem statement.
Alternatively, you can use the following "sample" matrix of dimension $n$.
Its inverse has lots of 1/2**k. (Note: indices for matrices start from 1 and grow to n).
Other examples include the Vandermode matrix (see textbook Lagrange chapter).
Linear Algebra books have examples of matrices with known inverses; you could use them
for testing as well.
- A[i][i] =1 if i is not equal to n.
- A[i][j] =0 if i < j < n.
- A[i][j] =(-1)**(i+j-1) if i > j or j is equal to n.
- Second example of a matrix (i,j=1...n) A[i][j] = |i-j|. This is the absolute value!
- Third example of a matrix (i,j=1...n) A[i][j] = n-|i-j|. And so is it!
- Fourth example of a matrix (i,j=1...n) A[i][j] = max(i,j).
- Fifth example of a matrix (i,j=1...n) A[i][i] = 1 and all non diagonals element
are 1/n.
- Sixth example of a matrix (i,j=1...n) A[i][j] = 2 min(i,j)-1.
are 1/n.