R/getNxNmatrix.R

Defines functions getNxNmatrix

Documented in getNxNmatrix

getNxNmatrix <- function(Cor, T1, t, N=2) {
  C1 <- matrix(0., nrow=N, ncol=N)
  C1[1,1] = Cor[t]
  C1[1,2] = Cor[(t+T1)]
  C1[2,1] = Cor[(t+2*T1)]
  C1[2,2] = Cor[(t+3*T1)]
  if(N > 2) {
    C1[1,3] = Cor[(t+20*T1)]
    C1[3,1] = C1[1,3]
    C1[1,4] = Cor[(t+21*T1)]
    C1[4,1] = C1[1,4]
    C1[2,3] = Cor[(t+22*T1)]
    C1[3,2] = C1[2,3]
    C1[2,4] = Cor[(t+23*T1)]
    C1[4,2] = C1[2,4]
    C1[3,3] = Cor[(t+16*T1)]
    C1[3,4] = Cor[(t+17*T1)]
    C1[4,3] = C1[3,4]
    C1[4,4] = Cor[(t+19*T1)]
  }
  if(N > 4) {
    C1[5,5] = Cor[(t+12*T1)]
    C1[5,6] = Cor[(t+13*T1)]
    C1[6,5] = C1[5,6]
    C1[6,6] = Cor[(t+15*T1)]
    C1[1,5] = Cor[(t+4*T1)]
    C1[5,1] = C1[1,5]
    C1[1,6] = Cor[(t+5*T1)]
    C1[6,1] = C1[1,6]
    C1[2,5] = Cor[(t+6*T1)]
    C1[5,2] = C1[2,5]
    C1[2,6] = Cor[(t+7*T1)]
    C1[6,2] = C1[2,6]
    C1[3,5] = Cor[(t+28*T1)]
    C1[5,3] = C1[3,5]
    C1[3,6] = Cor[(t+29*T1)]
    C1[6,3] = C1[3,6]
    C1[4,5] = Cor[(t+30*T1)]
    C1[5,4] = C1[4,5]
    C1[4,6] = Cor[(t+31*T1)]
    C1[6,4] = C1[4,6]
  }
  return(invisible(C1))
}
etmc/hadron documentation built on March 12, 2019, 8:43 p.m.