matrix::length() is const

* matrix::length() is const and should be given as such