Main Page   Compound List   File List   Compound Members   File Members  

matmult.c File Reference

#include "syscall.h"

Go to the source code of this file.

Defines

#define Dim   20

Functions

int main ()

Variables

int A [Dim][Dim]
int B [Dim][Dim]
int C [Dim][Dim]


Define Documentation

#define Dim   20
 

Definition at line 12 of file matmult.c.

Referenced by main.


Function Documentation

int main  
 

Definition at line 21 of file matmult.c.

References A, B, C, Dim, Exit, and j.

00022 {
00023     int i, j, k;
00024 
00025     for (i = 0; i < Dim; i++)           /* first initialize the matrices */
00026         for (j = 0; j < Dim; j++) {
00027              A[i][j] = i;
00028              B[i][j] = j;
00029              C[i][j] = 0;
00030         }
00031 
00032     for (i = 0; i < Dim; i++)           /* then multiply them together */
00033         for (j = 0; j < Dim; j++)
00034             for (k = 0; k < Dim; k++)
00035                  C[i][j] += A[i][k] * B[k][j];
00036 
00037     Exit(C[Dim-1][Dim-1]);              /* and then we're done */
00038 }


Variable Documentation

int A[Dim][Dim]
 

Definition at line 16 of file matmult.c.

Referenced by main.

int B[Dim][Dim]
 

Definition at line 17 of file matmult.c.

Referenced by main.

int C[Dim][Dim]
 

Definition at line 18 of file matmult.c.

Referenced by main.


Generated on Mon Feb 10 09:54:50 2003 for nachos by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees