add matrix multiply and adjoint

add matrix multiply and adjoint to marine.py and a script to test it.