matrix functions in C