clustal-omega-1.2.4/src/squid/sre_math.c
/* Function: FMX2Multiply()
 * 
 * Purpose:  Matrix multiplication.
 *           Multiply an m x p matrix A by a p x n matrix B,
 *           giving an m x n matrix C.
 *           Matrix C must be a preallocated matrix of the right
 *           size.
 */


Matrix multiplication.
Multiply an m x p matrix A by a p x n matrix B,
giving an m x n matrix C.
Matrix C must be a preallocated matrix of the right
size.
Matrix multiplication . Multiply an m x p matrix A by a p x n matrix B giving an m x n matrix C . Matrix C must be a preallocated matrix of the right size .
void
FMX2Multiply(float **A, float **B, float **C, int m, int p, int n)
{
  int i, j, k;
  for (i = 0; i < m; i++)
    for (j = 0; j < n; j++)
      {
	C[i][j] = 0.;
	for (k = 0; k < p; k++)
	  C[i][j] += A[i][p] * B[p][j];
      }
}
void FMX2Multiply ( float * * A , float * * B , float * * C , int m , int p , int n ) { int i , j , k ; for ( i = 0 ; i < m ; i ++ ) for ( j = 0 ; j < n ; j ++ ) { C [ i ] [ j ] = 0. ; for ( k = 0 ; k < p ; k ++ ) C [ i ] [ j ] += A [ i ] [ p ] * B [ p ] [ j ] ; } }
Function: FMX2Multiply()
Function : FMX2Multiply ()