* rows and columns in the current object. In other words,
* the current object is not resized for this operation.
*/
- template <typename MatrixType>
+ template <typename MatrixType, typename index_type>
void extract_submatrix_from (const MatrixType &matrix,
- const std::vector<typename MatrixType::size_type> &row_index_set,
- const std::vector<typename MatrixType::size_type> &column_index_set);
+ const std::vector<index_type> &row_index_set,
+ const std::vector<index_type> &column_index_set);
/**
* Copy the elements of the current matrix object into a specified
* rows and columns in the current object. In other words,
* the current object is not resized for this operation.
*/
- template <typename MatrixType>
+ template <typename MatrixType, typename index_type>
void
- scatter_matrix_to (const std::vector<size_type> &row_index_set,
- const std::vector<size_type> &column_index_set,
+ scatter_matrix_to (const std::vector<index_type> &row_index_set,
+ const std::vector<index_type> &column_index_set,
MatrixType &matrix) const;
/**
template <typename number>
-template <typename MatrixType>
+template <typename MatrixType, typename index_type>
inline
void
FullMatrix<number>::extract_submatrix_from (const MatrixType &matrix,
- const std::vector<typename MatrixType::size_type> &row_index_set,
- const std::vector<typename MatrixType::size_type> &column_index_set)
+ const std::vector<index_type> &row_index_set,
+ const std::vector<index_type> &column_index_set)
{
AssertDimension(row_index_set.size(), this->n_rows());
AssertDimension(column_index_set.size(), this->n_cols());
template <typename number>
-template <typename MatrixType>
+template <typename MatrixType, typename index_type>
inline
void
-FullMatrix<number>::scatter_matrix_to (const std::vector<size_type> &row_index_set,
- const std::vector<size_type> &column_index_set,
+FullMatrix<number>::scatter_matrix_to (const std::vector<index_type> &row_index_set,
+ const std::vector<index_type> &column_index_set,
MatrixType &matrix) const
{
AssertDimension(row_index_set.size(), this->n_rows());
double average = 0;
size_type n_elements = 0;
for (size_type row=i*options.block_size;
- row < std::min(matrix.m(), (i+1)*options.block_size); ++row)
+ row < std::min(size_type(matrix.m()),
+ size_type((i+1)*options.block_size)); ++row)
for (size_type col=j*options.block_size;
- col < std::min(matrix.m(), (j+1)*options.block_size); ++col, ++n_elements)
+ col < std::min(size_type(matrix.m()),
+ size_type((j+1)*options.block_size)); ++col, ++n_elements)
if (options.show_absolute_values == true)
average += std::fabs(get_element (matrix, row, col));
else