Matrix operations library