modify: partial pivoting solver use block matrix
add function imin