The following code is to illustrate the matrix multiplication method mentioned previously. For simplicity sake, I’m limiting the size of the matrices to 3.
const int cnSize = 3;
int[,] A = new int[cnSize, cnSize];
int[,] B = new int[cnSize, cnSize];
int[,] C = new int[cnSize, cnSize];
int[] x = new int[cnSize];
int[] y = new int[cnSize];
Random rand = new Random();
int i, j, k;
// fill matrix and vector with random values
for (i = 0; i < cnSize; ++i)
{
for (j = 0; j < cnSize; ++j)
{
A[i, j] = rand.Next(1, 10);
B[i, j] = rand.Next(1, 10);
}
x[i] = rand.Next(1, 10);
}
// matrix-vector multiplication
for (i = 0; i < cnSize; ++i)
{
y[i] = 0;
for (k = 0; k < cnSize; ++k)
{
y[i] += A[i, k] * x[k];
}
}
// matrix-matrix multiplication
for (i = 0; i < cnSize; ++i)
{
for (j = 0; j < cnSize; ++j)
{
C[i, j] = 0;
for (k =...
Content suppressed by ://URLFAN, for full article visit source
More posts from feeds.feedburner.com

Practical Programming (part 1)From: feeds.feedburner.com
Post Date: 2007-12-06 17:00:07
There are many factors affecting the success of a software project. Amongst them, we have
Skill level of individuals (from manager to coder)
Time involved
Tools involved
Project complexity
and probably many more you can add. So how can you successfully complete a project practically ? How can you balance customer satisfaction, code quality, time constraints and other factors in the most efficient and practical manner?
I was intrigued to explore this when one person asked how ca...
more 
Audio Player plugin settingsFrom: feeds.feedburner.com
Post Date: 2007-12-04 17:00:30
I was just playing around with the Audio Player plugin for my first podcast . On the day of the post, I was a bit nervous, because I’ve never done a podcast before, and I didn’t know how it would look in an RSS feed reader.
So I subscribed to my own feed to make sure. It was a good thing I did. At the appointed time, I awaited eagerly, earnestly, even ecstatically. No post in my feed reader. Oh no. Ok, maybe FeedBurner was a little slow. So I waited a little longer.
60 agonis...
more 
Can your program survive reruns?From: feeds.feedburner.com
Post Date: 2007-12-02 17:00:55
The ability to perform repetitive tasks in the exact same manner every time is one of the key advantages of a computer. Programs are written to behave in the exact same manner every time they’re run. Yet sometimes, they don’t.
So the question is, do you write code such that your program can survive rerunning itself?
What I mean is, if your program somehow fails, can it be rerun with minimal fuss on your part? The database equivalent is the transaction. Within a transaction, any ...
more 
Christmas office decorationFrom: feeds.feedburner.com
Post Date: 2007-12-02 16:45:21
It’s about 3 weeks till Christmas and decorations are going up. Shopping centres and malls are decorating. Orchard Road (a major stretch of shopping venues in Singapore) is being decorated. Why not offices?
So my colleague took it upon herself as master decorator and whipped out her secret stash of decorabilia, and enlisted the help of another colleague and myself to help deck our portion of office space.
So here’s the obligatory Christmas tree
She decided to spruce...
more