added function to convert lin ops to matrix blocks