Function Utils::resizePatch(const arma::sp_mat&, const unsigned int, const unsigned int)

Function Documentation

arma::sp_mat Utils::resizePatch(const arma::sp_mat &mat, const unsigned int nR, const unsigned int nC)

Armadillo arma::sp_mat::resize() is not robust as it initializes garbage values to new columns. This fixes the problem by creating new columns with guaranteed zero values. For arma::sp_mat.

Parameters
  • mat – Input matrix

  • nR – Number of rows for the output

  • nC – Number of columns for the output

Returns

The resized mat