Thursday, September 30, 2010

Matrix_Functions

Remember how I posted that the Matrix Multiplcation was probably the hardest, most annoying?  I take that back.  I now give that title to the Determinant.  That was probably the most annoying thing.  Now that I say this, the last few tests are going to be even more annoying.

Matrix_Unary and Matrix_Multiply

Possibly the easiest and least tedious of this assignment, Unary.  It was easy.

Possibly the hardest and most annoying part of this assignment, Multiply.  Matrix Multiplication on a 4x4 scale is SUPER time consuming and difficult.  I may have done a dirty way for doing operator*=, but at this point, I just want to NOT be doing this Matrix class anymore.

But I have no choice...

Matrix_AddSub and Matrix_Scale

Easy.  All of this is super easy because all I have to do is look back to my Vect class, and it's pretty much the same thing, just organized differently, and 4 times the size.

This is the most tedious thing I have ever done.

Matrix_Constructor and Matrix_Bracket

Very simple, as I already completed this in the Vect class, just need to re-implement into the Matrix class

...

I feel like I have become Satan's personal Data Entry Assistant, and he's using my love of math against me.

Two more groups down... I don't want to look at how many are left.  :'(

Vect_unary and Vect_Functions

Vect_unary + and - was seemingly simple.  Especially after going through the emails/discussion board.

Vect_Functions was a review of all the stuff I am learning in my GPH321 class, so I'm super glad to be taking that at the same time.  The only problem I have is that one of the checks didn't succeed.  More specifically that was check:

CHECK( eq(v1[y],0.534f,MATH_TOLERANCE) );

I stepped through it and it gave pretty accurate answer, but not accurate enough for the test, apparently.  Hopefully I'm right in my logic, but there's just something I'm missing to make it a teeny bit better.

For 39 tests in about 5 hours, I'm pretty proud of myself.  I imagine the disappointment that may be shrouded upon me for starting this late in the game, but I'm gonna make the best of it.

Now to open the second can of worms... Matricies.

Vect_Scale and Vect_Set

Vect_Scale was pretty easy aside from calling the operator* after a scaler instead of a vector.  Friend gave me a hand with that, hopefully I can figure it out exactly later.  Something to do with friend functions.

Vect_Set was super easy comparatively, as it seemed like it was just the constructors and copy constructor in a different form/suit.

Vect_Boolean - Done

I started this off with the first thing I thought of: if statements to check and see if all values were equal or zero.

After explaining how ugly this looked to my friend, he reminded me of the boolean operators &&, and that if one expression in the set of && wasn't true, it would return false.  After a quick do over, it looks a lot nicer and cleaner (and probably runs better) than what I had previous.

Next tests, ahoy.