You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
240 B

3 years ago
  1. #include <R.h>
  2. dyn.load("sum2.so")
  3. void sum2(double* mtrx, int* m, int* n, double* res)
  4. {
  5. *res = 0;
  6. for(int i=0; i < *n; i++)
  7. {
  8. for(int j=0; j < *m; j++) {
  9. *res += mtrx[j * (*n) + i];
  10. }
  11. }
  12. }