OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.misc-tests/] [matrix1.c] - Blame information for rev 720

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 690 jeremybenn
/*       Matrix operations      */
2
 
3
#define BOUND 100
4
 
5
int a[BOUND][BOUND],b[BOUND][BOUND],c[BOUND][BOUND];
6
 
7
main()
8
{
9
int i,j,k;
10
 
11
 
12
 
13
        for (i=0; i<BOUND; i++)
14
        {
15
                for (j=0; j<BOUND; j++)
16
                {
17
                        a[i][j] = 1;
18
                        b[i][j] = 1;
19
                }
20
        }
21
        for (i=0; i<BOUND; i++)
22
        {
23
                for (j=0; j<BOUND; j++)
24
                {
25
                        c[i][j] = 0;
26
                        for (k=0; k<BOUND; k++)
27
                        {
28
                                c[i][j] = c[i][j] + a[i][k] * b[k][j];
29
                        }
30
                }
31
        }
32
        for (i=0; i<BOUND; i++)
33
        {
34
                for (j=0; j<BOUND; j++)
35
                {
36
                        if (c[i][j] != BOUND)
37
                        {
38
                                puts("ERROR");
39
                                return 0;
40
                        }
41
                }
42
        }
43
        i=5;
44
 
45
        return 0;
46
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.