SHARE
TWEET

Untitled

a guest Nov 12th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include "matrix_io.h"
  4.  
  5. int main(int argc, char *argv[]) {
  6.  
  7.   if (argc != 4) {
  8.     fprintf(stderr,"Usage: %s A b x\n", argv[0]);
  9.     return EXIT_FAILURE;
  10.   }
  11.  
  12. char *A = argv[1];
  13. char *b = argv[2];
  14. char *x = argv[3];
  15.  
  16.   /* Insert your code here */
  17.  
  18. // Read input
  19. vector_t *b_ = read_vector(b);
  20. matrix_t *A_ = read_matrix(A);
  21.  
  22. /****************Koden virker hertil**************/
  23. // Call call_dgels
  24. double info, work = call_dgels(A_,b_);
  25.  
  26. // write output
  27. printf("%f",work);
  28.  
  29.  
  30. unsigned long n = b_->n;
  31.  
  32. struct vector *work_;
  33. work_->n = n;
  34. work_->v = &work_[0];
  35.  
  36. write_vector(x, work_);
  37.  
  38.   return EXIT_SUCCESS;
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top