Skip to content
Snippets Groups Projects
Commit a7ac4578 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[ML] Replace deprecated throw() with noexcept.

parent 1769b044
No related branches found
No related tags found
No related merge requests found
...@@ -56,7 +56,7 @@ DenseMatrix<FP_TYPE, IDX_TYPE>::~DenseMatrix () ...@@ -56,7 +56,7 @@ DenseMatrix<FP_TYPE, IDX_TYPE>::~DenseMatrix ()
template <typename FP_TYPE, typename IDX_TYPE> template <typename FP_TYPE, typename IDX_TYPE>
DenseMatrix<FP_TYPE, IDX_TYPE>& DenseMatrix<FP_TYPE, IDX_TYPE>&
DenseMatrix<FP_TYPE, IDX_TYPE>::operator=(DenseMatrix<FP_TYPE, IDX_TYPE> const& rhs) DenseMatrix<FP_TYPE, IDX_TYPE>::operator=(DenseMatrix<FP_TYPE, IDX_TYPE> const& rhs)
throw (std::range_error) noexcept(false)
{ {
if (this == &rhs) if (this == &rhs)
return *this; return *this;
...@@ -140,7 +140,7 @@ V DenseMatrix<FP_TYPE, IDX_TYPE>::operator* (V const& x) const ...@@ -140,7 +140,7 @@ V DenseMatrix<FP_TYPE, IDX_TYPE>::operator* (V const& x) const
template<typename FP_TYPE, typename IDX_TYPE> template<typename FP_TYPE, typename IDX_TYPE>
DenseMatrix<FP_TYPE, IDX_TYPE>* DenseMatrix<FP_TYPE, IDX_TYPE>*
DenseMatrix<FP_TYPE, IDX_TYPE>::operator+(const DenseMatrix<FP_TYPE, IDX_TYPE>& mat) const DenseMatrix<FP_TYPE, IDX_TYPE>::operator+(const DenseMatrix<FP_TYPE, IDX_TYPE>& mat) const
throw (std::range_error) noexcept(false)
{ {
// make sure the two matrices have the same dimension. // make sure the two matrices have the same dimension.
if (_n_rows != mat.getNRows() || _n_cols != mat.getNCols()) if (_n_rows != mat.getNRows() || _n_cols != mat.getNCols())
...@@ -159,7 +159,7 @@ DenseMatrix<FP_TYPE, IDX_TYPE>::operator+(const DenseMatrix<FP_TYPE, IDX_TYPE>& ...@@ -159,7 +159,7 @@ DenseMatrix<FP_TYPE, IDX_TYPE>::operator+(const DenseMatrix<FP_TYPE, IDX_TYPE>&
template<typename FP_TYPE, typename IDX_TYPE> template<typename FP_TYPE, typename IDX_TYPE>
DenseMatrix<FP_TYPE, IDX_TYPE>* DenseMatrix<FP_TYPE, IDX_TYPE>*
DenseMatrix<FP_TYPE, IDX_TYPE>::operator-(const DenseMatrix<FP_TYPE, IDX_TYPE>& mat) const DenseMatrix<FP_TYPE, IDX_TYPE>::operator-(const DenseMatrix<FP_TYPE, IDX_TYPE>& mat) const
throw (std::range_error) noexcept(false)
{ {
// make sure the two matrices have the same dimension. // make sure the two matrices have the same dimension.
if (_n_rows != mat.getNRows() || _n_cols != mat.getNCols()) if (_n_rows != mat.getNRows() || _n_cols != mat.getNCols())
...@@ -178,7 +178,7 @@ DenseMatrix<FP_TYPE, IDX_TYPE>::operator-(const DenseMatrix<FP_TYPE, IDX_TYPE>& ...@@ -178,7 +178,7 @@ DenseMatrix<FP_TYPE, IDX_TYPE>::operator-(const DenseMatrix<FP_TYPE, IDX_TYPE>&
template<typename FP_TYPE, typename IDX_TYPE> template<typename FP_TYPE, typename IDX_TYPE>
DenseMatrix<FP_TYPE, IDX_TYPE>* DenseMatrix<FP_TYPE, IDX_TYPE>*
DenseMatrix<FP_TYPE, IDX_TYPE>::operator*(const DenseMatrix<FP_TYPE, IDX_TYPE>& mat) const DenseMatrix<FP_TYPE, IDX_TYPE>::operator*(const DenseMatrix<FP_TYPE, IDX_TYPE>& mat) const
throw (std::range_error) noexcept(false)
{ {
// make sure the two matrices have the same dimension. // make sure the two matrices have the same dimension.
if (_n_cols != mat.getNRows()) if (_n_cols != mat.getNRows())
...@@ -218,7 +218,7 @@ DenseMatrix<FP_TYPE, IDX_TYPE>* ...@@ -218,7 +218,7 @@ DenseMatrix<FP_TYPE, IDX_TYPE>*
DenseMatrix<FP_TYPE, IDX_TYPE>::getSubMatrix( DenseMatrix<FP_TYPE, IDX_TYPE>::getSubMatrix(
IDX_TYPE b_row, IDX_TYPE b_col, IDX_TYPE b_row, IDX_TYPE b_col,
IDX_TYPE e_row, IDX_TYPE e_col) const IDX_TYPE e_row, IDX_TYPE e_col) const
throw (std::range_error) noexcept(false)
{ {
if (b_row >= e_row | b_col >= e_col) if (b_row >= e_row | b_col >= e_col)
throw std::range_error("DenseMatrix::getSubMatrix() illegal sub matrix"); throw std::range_error("DenseMatrix::getSubMatrix() illegal sub matrix");
...@@ -239,7 +239,7 @@ template<typename FP_TYPE, typename IDX_TYPE> ...@@ -239,7 +239,7 @@ template<typename FP_TYPE, typename IDX_TYPE>
void void
DenseMatrix<FP_TYPE, IDX_TYPE>::setSubMatrix(IDX_TYPE b_row, IDX_TYPE b_col, DenseMatrix<FP_TYPE, IDX_TYPE>::setSubMatrix(IDX_TYPE b_row, IDX_TYPE b_col,
const DenseMatrix<FP_TYPE, IDX_TYPE>& sub_mat) const DenseMatrix<FP_TYPE, IDX_TYPE>& sub_mat)
throw (std::range_error) noexcept(false)
{ {
if (b_row + sub_mat.getNRows() > _n_rows | b_col + sub_mat.getNCols() > _n_cols) if (b_row + sub_mat.getNRows() > _n_rows | b_col + sub_mat.getNCols() > _n_cols)
throw std::range_error("DenseMatrix::setSubMatrix() sub matrix to big"); throw std::range_error("DenseMatrix::setSubMatrix() sub matrix to big");
...@@ -254,7 +254,7 @@ DenseMatrix<FP_TYPE, IDX_TYPE>::setSubMatrix(IDX_TYPE b_row, IDX_TYPE b_col, ...@@ -254,7 +254,7 @@ DenseMatrix<FP_TYPE, IDX_TYPE>::setSubMatrix(IDX_TYPE b_row, IDX_TYPE b_col,
template<typename FP_TYPE, typename IDX_TYPE> template<typename FP_TYPE, typename IDX_TYPE>
FP_TYPE& FP_TYPE&
DenseMatrix<FP_TYPE, IDX_TYPE>::operator() (IDX_TYPE row, IDX_TYPE col) DenseMatrix<FP_TYPE, IDX_TYPE>::operator() (IDX_TYPE row, IDX_TYPE col)
throw (std::range_error) noexcept(false)
{ {
if ((row >= _n_rows) | (col >= _n_cols)) if ((row >= _n_rows) | (col >= _n_cols))
throw std::range_error("DenseMatrix: op() const range error"); throw std::range_error("DenseMatrix: op() const range error");
...@@ -265,7 +265,7 @@ DenseMatrix<FP_TYPE, IDX_TYPE>::operator() (IDX_TYPE row, IDX_TYPE col) ...@@ -265,7 +265,7 @@ DenseMatrix<FP_TYPE, IDX_TYPE>::operator() (IDX_TYPE row, IDX_TYPE col)
template<typename FP_TYPE, typename IDX_TYPE> template<typename FP_TYPE, typename IDX_TYPE>
FP_TYPE const& FP_TYPE const&
DenseMatrix<FP_TYPE, IDX_TYPE>::operator() (IDX_TYPE row, IDX_TYPE col) const DenseMatrix<FP_TYPE, IDX_TYPE>::operator() (IDX_TYPE row, IDX_TYPE col) const
throw (std::range_error) noexcept(false)
{ {
if ((row >= _n_rows) | (col >= _n_cols)) if ((row >= _n_rows) | (col >= _n_cols))
throw std::range_error("DenseMatrix: op() const range error"); throw std::range_error("DenseMatrix: op() const range error");
......
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
* Assignment operator, makes a copy of the internal data of the object. * Assignment operator, makes a copy of the internal data of the object.
* @param rhs The DenseMatrix object to the right side of the assignment symbol. * @param rhs The DenseMatrix object to the right side of the assignment symbol.
*/ */
DenseMatrix& operator=(DenseMatrix const& rhs) throw (std::range_error); DenseMatrix& operator=(DenseMatrix const& rhs) noexcept(false);
/** /**
* This is the move assignment operator. * This is the move assignment operator.
...@@ -88,18 +88,18 @@ public: ...@@ -88,18 +88,18 @@ public:
/** /**
* DenseMatrix matrix addition. * DenseMatrix matrix addition.
*/ */
DenseMatrix* operator+ (const DenseMatrix& mat) const throw (std::range_error); DenseMatrix* operator+ (const DenseMatrix& mat) const noexcept(false);
/** /**
* DenseMatrix matrix subtraction * DenseMatrix matrix subtraction
*/ */
DenseMatrix* operator- (const DenseMatrix& mat) const throw (std::range_error); DenseMatrix* operator- (const DenseMatrix& mat) const noexcept(false);
/** /**
* DenseMatrix matrix multiplication \f$ C = A \cdot B\f$ * DenseMatrix matrix multiplication \f$ C = A \cdot B\f$
* @param mat the matrix \f$ B \f$ * @param mat the matrix \f$ B \f$
* @return the matrix \f$ C \f$ * @return the matrix \f$ C \f$
*/ */
DenseMatrix* operator* (const DenseMatrix& mat) const throw (std::range_error); DenseMatrix* operator* (const DenseMatrix& mat) const noexcept(false);
/** /**
* matrix transpose * matrix transpose
...@@ -107,7 +107,7 @@ public: ...@@ -107,7 +107,7 @@ public:
*/ */
DenseMatrix* transpose() const; // HB & ZC DenseMatrix* transpose() const; // HB & ZC
DenseMatrix* getSubMatrix (IDX_TYPE b_row, IDX_TYPE b_col, IDX_TYPE e_row, IDX_TYPE e_col) const throw (std::range_error); DenseMatrix* getSubMatrix (IDX_TYPE b_row, IDX_TYPE b_col, IDX_TYPE e_row, IDX_TYPE e_col) const noexcept(false);
/** /**
* overwrites values of the matrix with the given sub matrix * overwrites values of the matrix with the given sub matrix
...@@ -115,10 +115,10 @@ public: ...@@ -115,10 +115,10 @@ public:
* @param b_col the first column * @param b_col the first column
* @param sub_mat the sub matrix * @param sub_mat the sub matrix
*/ */
void setSubMatrix (IDX_TYPE b_row, IDX_TYPE b_col, const DenseMatrix& sub_mat) throw (std::range_error); void setSubMatrix (IDX_TYPE b_row, IDX_TYPE b_col, const DenseMatrix& sub_mat) noexcept(false);
inline FP_TYPE & operator() (IDX_TYPE row, IDX_TYPE col) throw (std::range_error); inline FP_TYPE & operator() (IDX_TYPE row, IDX_TYPE col) noexcept(false);
inline FP_TYPE const& operator() (IDX_TYPE row, IDX_TYPE col) const throw (std::range_error); inline FP_TYPE const& operator() (IDX_TYPE row, IDX_TYPE col) const noexcept(false);
/** /**
* writes the matrix entries into the output stream * writes the matrix entries into the output stream
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment