https://github.com/cran/ltsa
Revision d1a312e52f8273b90b43b27e3e97d500010fb403 authored by A.I. McLeod on 30 October 2007, 16:55:48 UTC, committed by cran-robot on 30 October 2007, 16:55:48 UTC
0 parent
Raw File
Tip revision: d1a312e52f8273b90b43b27e3e97d500010fb403 authored by A.I. McLeod on 30 October 2007, 16:55:48 UTC
version 1.0
Tip revision: d1a312e
vecmat.c
// Matrix operations

#include "trenchR.h"

// Computation of dot product
double dot(int n,double* u,double* v)
{
   double t = 0.0;
   int i;
   
   for (i=0; i < n; i++)
      t += u[i] * v[i];
   
   return t;
}

// Vector - Matrix multiplication
void vecmat(int nc,double *v, double **m,double *u)
{
	int i,j;
	double nr;

	nr = nc; 
   
	for (i=0; i < nc; i++)
	{
	  double t = 0.0;
	  for (j = 0; j < nr; ++j)
		 t += v[j] * m[j][i];
	  u[i] = t;
	}

	return;
}
back to top