R file for matrix inverse computation