2015-03-23 21:03:14 +00:00
|
|
|
/*
|
2017-02-27 18:51:35 +00:00
|
|
|
PURPOSE: (Matrix times Matrix transpose)
|
|
|
|
ASSUMPTIONS AND LIMITATIONS: ((Square matrix))
|
|
|
|
PROGRAMMERS: (((Les Quiocho) (NASA/JSC) (Jan 1993) (v1.0) (Init Release))
|
|
|
|
((Robert McPhail) (CACI) (Feb 2017) (Updated algorithm))) */
|
2015-02-26 15:02:31 +00:00
|
|
|
|
2015-06-01 15:28:29 +00:00
|
|
|
#include "trick/trick_math.h"
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
void matxtrans(double **prod, /* Out: product of the two matrices */
|
|
|
|
double **mat1, /* In: matrix 1 */
|
|
|
|
double **mat2, /* In: matrix 2 */
|
2017-02-27 18:51:35 +00:00
|
|
|
int n) { /* In: array size */
|
2015-02-26 15:02:31 +00:00
|
|
|
|
2017-02-27 18:51:35 +00:00
|
|
|
int i, j, k;
|
|
|
|
double temp;
|
2015-02-26 15:02:31 +00:00
|
|
|
|
2017-02-27 18:51:35 +00:00
|
|
|
for (i = 0; i < n; i++) {
|
|
|
|
for (j = 0; j < n; j++) {
|
|
|
|
temp = 0.0;
|
|
|
|
for (k = 0; k < n; k++) {
|
|
|
|
temp += mat1[i][k] * mat2[j][k];
|
|
|
|
}
|
|
|
|
prod[i][j] = temp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
2015-02-26 15:02:31 +00:00
|
|
|
}
|