Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2006-06-19 05:58:16


Sorry, I mixed up something. Forget about my last post.

On Monday 19 June 2006 11:46, Gunter Winkler wrote:

> BOOST_UBLAS_INLINE
> matrix_slice &operator = (const matrix_slice &ms) {
> matrix_assign<scalar_assign> (*this, ms);
> return *this;
> }

matrix_slice _always_ assigns the data of the matrix. You can only create a
(sub-)slice of the slice or use a new name.

{
  matrix_slice ms( ... )
  do something
} // ms goes out of scope
{
  matrix_slice ms( ... )
  do something more
}
alternatively you can alway use
project( M, slice(...), slice(...) ) = project( M, slice(..), slice(...) );

> BOOST_UBLAS_INLINE
> matrix_slice &assign_temporary (matrix_slice &ms) {
> return *this = ms;
> }

this calls the above assignement operator and there copies some data of the
matrix.

mfg
Gunter