### R code from vignette source 'costMatrix.Rnw'