Microchip PIC18 matrix routines
Microchip themselves doesn't have any suitable libraries for the PIC18. Someone on the Microchip forums might have written some routines you can use, though.

I'd be inclined to use a 16-bit PIC, it would make things much easier.