Commit 751fd22d authored by Tomáš Oberhuber's avatar Tomáš Oberhuber Committed by Tomáš Oberhuber
Browse files

Fixing method getView in VectorView.

parent 776af14a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ getView( const IndexType begin, IndexType end )
{
   if( end == -1 )
      end = this->getSize();
   return *this;
   return ViewType( &getData()[ begin ], end - begin );;
}

template< typename Value,
@@ -107,7 +107,7 @@ getConstView( const IndexType begin, IndexType end ) const
{
   if( end == -1 )
      end = this->getSize();
   return *this;
   return ConstViewType( &getData()[ begin ], end - begin );
}

// Copy-assignment does deep copy, just like regular array, but the sizes
+4 −4
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ public:
   // (works fine in nvcc 9.0)
   using ArrayView< Real, Device, Index >::ArrayView;
#endif
   using ArrayView< Real, Device, Index >::getData;
   
   /** Subscript operator is inherited from the class \ref Array. */
   using ArrayView< Real, Device, Index >::operator[];
@@ -71,18 +72,17 @@ public:
   __cuda_callable__
   VectorView( const Expressions::UnaryExpressionTemplate< T, Operation >& expression );


   /**
    * \brief Returns a modifiable view of the array view.
    */
   __cuda_callable__
   ViewType getView();
   ViewType getView( const IndexType begin = 0, IndexType end = -1 );

   /**
    * \brief Returns a non-modifiable view of the array view.
    */
   __cuda_callable__
   ConstViewType getConstView() const;
   ConstViewType getConstView( const IndexType begin = 0, IndexType end = -1 ) const;


   static String getType();
+8 −4
Original line number Diff line number Diff line
@@ -45,9 +45,11 @@ template< typename Real,
          typename Index >
typename VectorView< Real, Device, Index >::ViewType
VectorView< Real, Device, Index >::
getView()
getView( const IndexType begin, IndexType end )
{
   return *this;
   if( end == -1 )
      end = this->getSize();
   return ViewType( &getData()[ begin ], end - begin );;
}

template< typename Real,
@@ -55,9 +57,11 @@ template< typename Real,
          typename Index >
typename VectorView< Real, Device, Index >::ConstViewType
VectorView< Real, Device, Index >::
getConstView() const
getConstView( const IndexType begin, IndexType end ) const
{
   return *this;
   if( end == -1 )
      end = this->getSize();
   return ConstViewType( &getData()[ begin ], end - begin );;
}

template< typename Real,