https://github.com/cran/ltsa
Tip revision: 83deceb1d65445b7dcad78a48eaab0b732534fc5 authored by A.I. McLeod on 22 August 2015, 23:49:55 UTC
version 1.4.5
version 1.4.5
Tip revision: 83deceb
trenchInv.c
// Computing the inverse of a positive-definite Toeplitz matrix
// using the Trench algorithm
#include "trenchR.h"
int trenchInv(double *r,int n,double **b,double *v,double EPS)
{
double sigsq;
int fault;
VECTOR fi;
fi = Vector(n-1);
fault = durlev (r,n,fi,v,&sigsq,EPS);
if (fault != 0)
{
return fault;
free_vector(fi);
}
v = Vector(n);
upperWedge(fi,sigsq,n,b);
free_vector(fi);
return 0;
}