Simple Example ToeplitzInverseUpdate

R Code

Please note:  Added a validity check.  e > 0

"ToeplitzInverseUpdate" <-
function( GI, r, rnew )
{   
    g <- rev(c(r,rnew)[-1])
    GIg <- c(crossprod(GI,g))
    e <- r[1]-sum(g*GIg)
    if (e<=0)
        stop("error: matrix not p.d.")
    e <- 1/e
    f <- -c(GIg*e)
    A <- GI + outer(GIg,GIg)*e
    rbind(cbind(A,matrix(f,ncol=1)),c(f,e))
}

Simple Example

> rTOT<-1/(1:6)
> rTOT
[1] 1.0000000 0.5000000 0.3333333 0.2500000 0.2000000 0.1666667
> r<-rTOT[1:5]
> rnew<-rTOT[6]

This is (Subscript[Γ, n])

> G<-toe(r)
> G
          [,1]      [,2]      [,3]      [,4]      [,5]
[1,] 1.0000000 0.5000000 0.3333333 0.2500000 0.2000000
[2,] 0.5000000 1.0000000 0.5000000 0.3333333 0.2500000
[3,] 0.3333333 0.5000000 1.0000000 0.5000000 0.3333333
[4,] 0.2500000 0.3333333 0.5000000 1.0000000 0.5000000
[5,] 0.2000000 0.2500000 0.3333333 0.5000000 1.0000000
> GI<-TrenchInverse(G)
> GI
            [,1]        [,2]       [,3]        [,4]        [,5]
[1,]  1.35778410 -0.59039647 -0.1083032 -0.05942302 -0.05814511
[2,] -0.59039647  1.61201240 -0.5458484 -0.08710265 -0.05942302
[3,] -0.10830325 -0.54584838  1.6180505 -0.54584838 -0.10830325
[4,] -0.05942302 -0.08710265 -0.5458484  1.61201240 -0.59039647
[5,] -0.05814511 -0.05942302 -0.1083032 -0.59039647  1.35778410

This is (Subscript[Γ, n + 1]^(-1))

> GIupdate<-ToeplitzInverseUpdate(GI,r,rnew)
> GIupdate
            [,1]        [,2]        [,3]        [,4]        [,5]        [,6]
[1,]  1.35919880 -0.58913379 -0.10649699 -0.05598721 -0.03913846 -0.04385049
[2,] -0.58913379  1.61313940 -0.54423621 -0.08403604 -0.04245877 -0.03913846
[3,] -0.10649699 -0.54423621  1.62035673 -0.54146162 -0.08403604 -0.05598721
[4,] -0.05598721 -0.08403604 -0.54146162  1.62035673 -0.54423621 -0.10649699
[5,] -0.03913846 -0.04245877 -0.08403604 -0.54423621  1.61313940 -0.58913379
[6,] -0.04385049 -0.03913846 -0.05598721 -0.10649699 -0.58913379  1.35919880

This is (Subscript[Γ, n + 1]^(-1)) computed directly

> TrenchInverse(toe(rTOT))
            [,1]        [,2]        [,3]        [,4]        [,5]        [,6]
[1,]  1.35919880 -0.58913379 -0.10649699 -0.05598721 -0.03913846 -0.04385049
[2,] -0.58913379  1.61313940 -0.54423621 -0.08403604 -0.04245877 -0.03913846
[3,] -0.10649699 -0.54423621  1.62035673 -0.54146162 -0.08403604 -0.05598721
[4,] -0.05598721 -0.08403604 -0.54146162  1.62035673 -0.54423621 -0.10649699
[5,] -0.03913846 -0.04245877 -0.08403604 -0.54423621  1.61313940 -0.58913379
[6,] -0.04385049 -0.03913846 -0.05598721 -0.10649699 -0.58913379  1.35919880

Suggested R Driver for DLL

> GetToeInvUp
function( GI, r, rnew )
{   
    n<-length(r)
    if (dim(GI) != n) 
        stop("error: invalid size")
    out<-.C("ToeInvUp", 
        GI = array(0, dim=c(length(r),length(r))), 
        as.double(r),
        as.double(rnew),
        GIUp = array(0, dim=c(n+1,n+1)),  
        fault = as.integer(1) 
    )
    if (out$fault != 0)
        stop("matrix not p.d.")
    GIUp
}

Note:  Can't test until I get DLL