Commit 43106489 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Changing Matrix::[set,add]Element from bool to void with expcetion throwing.

parent 376b4bff
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -107,11 +107,11 @@ class Dense : public Matrix< Real, Device, Index >
      const Real& operator()( const IndexType row,
                              const IndexType column ) const;

      bool setElement( const IndexType row,
      void setElement( const IndexType row,
                       const IndexType column,
                       const RealType& value );

      bool addElement( const IndexType row,
      void addElement( const IndexType row,
                       const IndexType column,
                       const RealType& value,
                       const RealType& thisElementMultiplicator = 1.0 );
+11 −9
Original line number Diff line number Diff line
@@ -289,12 +289,13 @@ template< typename Real,
          typename Index,
          bool RowMajorOrder,
          typename RealAllocator >
bool Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::setElement( const IndexType row,
void
Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::
setElement( const IndexType row,
            const IndexType column,
            const RealType& value )
{
   this->values.setElement( this->getElementIndex( row, column ), value );
   return true;
}

template< typename Real,
@@ -302,7 +303,9 @@ template< typename Real,
          typename Index,
          bool RowMajorOrder,
          typename RealAllocator >
bool Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::addElement( const IndexType row,
void
Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::
addElement( const IndexType row,
            const IndexType column,
            const RealType& value,
            const RealType& thisElementMultiplicator )
@@ -314,7 +317,6 @@ bool Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::addElement( con
   else
      this->values.setElement( elementIndex,
                               thisElementMultiplicator * this->values.getElement( elementIndex ) + value );
   return true;
}

template< typename Real,
+2 −2
Original line number Diff line number Diff line
@@ -111,11 +111,11 @@ class DenseMatrixView : public MatrixView< Real, Device, Index >
      const Real& operator()( const IndexType row,
                              const IndexType column ) const;

      bool setElement( const IndexType row,
      void setElement( const IndexType row,
                       const IndexType column,
                       const RealType& value );

      bool addElement( const IndexType row,
      void addElement( const IndexType row,
                       const IndexType column,
                       const RealType& value,
                       const RealType& thisElementMultiplicator = 1.0 );
+11 −9
Original line number Diff line number Diff line
@@ -240,19 +240,22 @@ template< typename Real,
          typename Device,
          typename Index,
          bool RowMajorOrder >
bool DenseMatrixView< Real, Device, Index, RowMajorOrder >::setElement( const IndexType row,
void
DenseMatrixView< Real, Device, Index, RowMajorOrder >::
setElement( const IndexType row,
            const IndexType column,
            const RealType& value )
{
   this->values.setElement( this->getElementIndex( row, column ), value );
   return true;
}

template< typename Real,
          typename Device,
          typename Index,
          bool RowMajorOrder >
bool DenseMatrixView< Real, Device, Index, RowMajorOrder >::addElement( const IndexType row,
void
DenseMatrixView< Real, Device, Index, RowMajorOrder >::
addElement( const IndexType row,
            const IndexType column,
            const RealType& value,
            const RealType& thisElementMultiplicator )
@@ -264,7 +267,6 @@ bool DenseMatrixView< Real, Device, Index, RowMajorOrder >::addElement( const In
   else
      this->values.setElement( elementIndex,
                               thisElementMultiplicator * this->values.getElement( elementIndex ) + value );
   return true;
}

template< typename Real,
+2 −2
Original line number Diff line number Diff line
@@ -92,11 +92,11 @@ class SparseMatrixView : public MatrixView< Real, Device, Index >
      __cuda_callable__
      RowView getRow( const IndexType& rowIdx );

      bool setElement( const IndexType row,
      void setElement( const IndexType row,
                       const IndexType column,
                       const RealType& value );

      bool addElement( const IndexType row,
      void addElement( const IndexType row,
                       const IndexType column,
                       const RealType& value,
                       const RealType& thisElementMultiplicator = 1.0 );
Loading