virtual Teuchos::ArrayRCP< scalar_type > fetchNonConstView (multivector_type& A) const { using Teuchos::arcpFromArrayView; using Teuchos::arrayView; typedef Teuchos::ArrayView< scalar_type >::size_type size_type; const size_type nelts = fetchArrayLength (A); // The returned ArrayRCP does NOT own A.Values(). return arcpFromArrayView (arrayView (A.Values(), nelts)); }
virtual Teuchos::ArrayRCP< const scalar_type > fetchConstView (const multivector_type& A) const { using Teuchos::arcpFromArrayView; using Teuchos::arrayView; using Teuchos::ArrayView; typedef ArrayView< scalar_type >::size_type size_type; const size_type nelts = fetchArrayLength (A); const scalar_type* A_ptr = A.Values(); ArrayView< const scalar_type > A_view = arrayView (A_ptr, nelts); // The returned ArrayRCP does NOT own A.Values(). return arcpFromArrayView (A_view); }