update line matrix