| [a0f0868] | 1 | /* FEVS: A Functional Equivalence Verification Suite for High-Performance
|
|---|
| 2 | * Scientific Computing
|
|---|
| 3 | *
|
|---|
| 4 | * Copyright (C) 2010, Stephen F. Siegel, Timothy K. Zirkel,
|
|---|
| 5 | * University of Delaware
|
|---|
| 6 | *
|
|---|
| 7 | * This program is free software; you can redistribute it and/or
|
|---|
| 8 | * modify it under the terms of the GNU General Public License as
|
|---|
| 9 | * published by the Free Software Foundation; either version 3 of the
|
|---|
| 10 | * License, or (at your option) any later version.
|
|---|
| 11 | *
|
|---|
| 12 | * This program is distributed in the hope that it will be useful, but
|
|---|
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|---|
| 15 | * General Public License for more details.
|
|---|
| 16 | *
|
|---|
| 17 | * You should have received a copy of the GNU General Public License
|
|---|
| 18 | * along with this program; if not, write to the Free Software
|
|---|
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|---|
| 20 | * 02110-1301 USA.
|
|---|
| 21 | */
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 | #include<stdio.h>
|
|---|
| 25 | #include<stdlib.h>
|
|---|
| 26 | #include<assert.h>
|
|---|
| 27 |
|
|---|
| 28 | int main(int argc, char* argv[]) {
|
|---|
| 29 | int i, j, k;
|
|---|
| 30 | int L = atoi(argv[1]);
|
|---|
| 31 | int M = atoi(argv[2]);
|
|---|
| 32 | int N = atoi(argv[3]);
|
|---|
| 33 | double A[L][M];
|
|---|
| 34 | double B[M][N];
|
|---|
| 35 | double C[L][N];
|
|---|
| 36 |
|
|---|
| 37 | FILE *fp =fopen("data", "r");
|
|---|
| 38 | for (i = 0; i < L; i++)
|
|---|
| 39 | for (j = 0; j < M; j++)
|
|---|
| 40 | fscanf(fp,"%lf", &A[i][j]);
|
|---|
| 41 | for (i = 0; i < M; i++)
|
|---|
| 42 | for (j = 0; j < N; j++)
|
|---|
| 43 | fscanf(fp,"%lf",&B[i][j]);
|
|---|
| 44 | for (i = 0; i < L; i++)
|
|---|
| 45 | for (j = 0; j < N; j++) {
|
|---|
| 46 | C[i][j] = 0.0;
|
|---|
| 47 | for (k = 0; k < M; k++)
|
|---|
| 48 | C[i][j] += A[i][k] * B[k][j];
|
|---|
| 49 | }
|
|---|
| 50 | for (i = 0; i < L; i++) {
|
|---|
| 51 | for (j = 0; j < N; j++)
|
|---|
| 52 | printf("%f ", C[i][j]);
|
|---|
| 53 | printf("\n");
|
|---|
| 54 | }
|
|---|
| 55 | printf("\n");
|
|---|
| 56 | fclose(fp);
|
|---|
| 57 | return 0;
|
|---|
| 58 | }
|
|---|