//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only.  Not for
// government, commercial, or other organizational use.
// File: sparse1.cpp
//
// MATLAB Coder version            : 5.3
// C/C++ source code generated on  : 12-May-2022 07:57:40
//

// Include Files
#include "sparse1.h"
#include "coder_array.h"

// Function Definitions
//
// Arguments    : const ::coder::array<int, 1U> &idx
//                ::coder::array<int, 1U> &y
// Return Type  : void
//
namespace coder {
void sparse::permuteVector(const ::coder::array<int, 1U> &idx,
                           ::coder::array<int, 1U> &y)
{
  array<int, 1U> t;
  int loop_ub;
  int ny;
  ny = y.size(0);
  t.set_size(y.size(0));
  loop_ub = y.size(0);
  for (int i{0}; i < loop_ub; i++) {
    t[i] = y[i];
  }
  for (loop_ub = 0; loop_ub < ny; loop_ub++) {
    y[loop_ub] = t[idx[loop_ub] - 1];
  }
}

//
// Arguments    : void
// Return Type  : sparse
//
sparse::sparse()
{
}

//
// Arguments    : void
// Return Type  : void
//
sparse::~sparse()
{
}

} // namespace coder

//
// File trailer for sparse1.cpp
//
// [EOF]
//
