BOOST_UBLAS_INLINE typename M::const_pointer matrix_storage_const (const ublas::matrix_slice<M> &m) { return matrix_storage_const (m.data()) + m.start1() * matrix_stride1 (m.data ()) + m.start2() * matrix_stride2 (m.data ()); }
BOOST_UBLAS_INLINE typename M::pointer vector_storage (ublas::matrix_column<M> &v) { return matrix_storage (v.data()) + v.index() * matrix_stride2 (v.data()); }
BOOST_UBLAS_INLINE typename M::pointer matrix_storage (ublas::matrix_range<M> &m) { return matrix_storage (m.data()) + m.start1() * matrix_stride1 (m.data ()) + m.start2() * matrix_stride2 (m.data ()); }
BOOST_UBLAS_INLINE int vector_stride (const ublas::matrix_row<M> &v) { return matrix_stride2 (v.data()); }
BOOST_UBLAS_INLINE int matrix_stride2 (const ublas::matrix_slice<M> &m) { return (int) (m.stride2() * matrix_stride2 (m.data())); }
BOOST_UBLAS_INLINE int matrix_stride2 (const ublas::matrix_range<M> &m) { return matrix_stride2 (m.data()); }
BOOST_UBLAS_INLINE int matrix_stride2 (const ublas::matrix_reference<M> &m) { return matrix_stride2 (m.expression()); }
int leadingDimension(Mat const& m, blas::column_major_tag) { return (int) matrix_stride2(m); }