message: gen_matrix_coo: index_base_one support
diff: @@ -216,12 +216,13 @@ rocsparse_int gen_2d_laplacian(rocsparse_int ndim,
  /* ============================================================================================ */
  /*! \brief Generate a random sparse matrix in COO format */
  template <typename T>
  -rocsparse_int gen_matrix_coo(rocsparse_int m,
  +void gen_matrix_coo(rocsparse_int m,
  rocsparse_int n,
  rocsparse_int nnz,
  std::vector<rocsparse_int> &row_ind,
  std::vector<rocsparse_int> &col_ind,
  - std::vector<T> &val)
  + std::vector<T> &val,
  + rocsparse_index_base idx_base)
  {
  if (row_ind.size() != nnz)
  {
  @@ -260,10 +261,15 @@ rocsparse_int gen_matrix_coo(rocsparse_int m,
  while (idx < i)
  {
  // Normal distribution around the diagonal
  - rocsparse_int rng = row_ind[begin] + (i - begin)
  + rocsparse_int rng = (i - begin)
  * sqrt(-2.0 * log((double) rand() / RAND_MAX))
  * cos(2.0 * M_PI * (double) rand() / RAND_MAX);
  + if (m <= n)
  + {
  + rng += row_ind[begin];
  + }
  +
  // Repeat if running out of bounds
  if (rng < 0 || rng > n-1)
  continue;
  @@ -285,6 +291,16 @@ rocsparse_int gen_matrix_coo(rocsparse_int m,
  std::sort(&col_ind[begin], &col_ind[i]);
  }
  + // Correct index base accordingly
  + if (idx_base == rocsparse_index_base_one)
  + {
  + for (rocsparse_int i=0; i<nnz; ++i)
  + {
  + ++row_ind[i];
  + ++col_ind[i];
  + }
  + }
  +
  // Sample random values
  for (rocsparse_int i=0; i<nnz; ++i)
  {
  @@ -538,7 +554,7 @@ class Arguments
  double beta = 0.0;
  rocsparse_operation trans = rocsparse_operation_none;
  - rocsparse_index_base idxBase = rocsparse_index_base_zero;
  + rocsparse_index_base idx_base = rocsparse_index_base_zero;
  rocsparse_int norm_check = 0;
  rocsparse_int unit_check = 1;
  @@ -558,7 +574,7 @@ class Arguments
  beta = rhs.beta;
  trans = rhs.trans;
  - idxBase = rhs.idxBase;
  + idx_base = rhs.idx_base;
  norm_check = rhs.norm_check;
  unit_check = rhs.unit_check;
  