Skip to content
Snippets Groups Projects
Commit 82ab455b authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Change CRSMatrixDescriptor constructors

- change parametrs to ease template deduction
- add a square matrix constructor (ie: number of columns is deduced
from the number of rows)
parent 4be628ec
No related branches found
No related tags found
1 merge request!107Change CRSMatrixDescriptor constructors
...@@ -248,9 +248,9 @@ class CRSMatrixDescriptor ...@@ -248,9 +248,9 @@ class CRSMatrixDescriptor
} }
} }
CRSMatrixDescriptor(const IndexType nb_rows, const IndexType nb_columns, const Array<IndexType>& non_zeros) CRSMatrixDescriptor(const size_t nb_rows, const size_t nb_columns, const Array<IndexType>& non_zeros)
: m_nb_rows{nb_rows}, : m_nb_rows(nb_rows),
m_nb_columns{nb_columns}, m_nb_columns(nb_columns),
m_row_map{this->_computeRowMap(non_zeros)}, m_row_map{this->_computeRowMap(non_zeros)},
m_values(m_row_map[m_row_map.size() - 1]), m_values(m_row_map[m_row_map.size() - 1]),
m_column_indices(m_row_map[m_row_map.size() - 1]), m_column_indices(m_row_map[m_row_map.size() - 1]),
...@@ -268,6 +268,10 @@ class CRSMatrixDescriptor ...@@ -268,6 +268,10 @@ class CRSMatrixDescriptor
} }
} }
CRSMatrixDescriptor(const size_t nb_rows, const Array<IndexType>& non_zeros)
: CRSMatrixDescriptor(nb_rows, nb_rows, non_zeros)
{}
~CRSMatrixDescriptor() = default; ~CRSMatrixDescriptor() = default;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment