trick/trick_source/trick_utils/math/src/matxtrans.c

28 lines
722 B
C
Raw Normal View History

/*
PURPOSE: (Matrix times Matrix transpose)
ASSUMPTIONS AND LIMITATIONS: ((Square matrix))
PROGRAMMERS: (((Les Quiocho) (NASA/JSC) (Jan 1993) (v1.0) (Init Release))) */
2015-02-26 15:02:31 +00:00
#include "../include/trick_math.h"
void matxtrans(double **prod, /* Out: product of the two matrices */
double **mat1, /* In: matrix 1 */
double **mat2, /* In: matrix 2 */
int n)
{ /* In: array size */
int i, j, k;
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
prod[i][j] = 0.0;
for (k = 0; k < n; k++) {
prod[i][j] += mat1[i][k] * mat2[j][k];
}
}
}
return;
}