Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1.  
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. int strsv(const long n,const long p,const char trans,double **U,double **W,double *b,double *ws);
  5.  
  6.  
  7. int main(void) {
  8. //double U1[3][3] = {{1,0,0},{0,1,0},{0,0,1}};
  9. //double W1[3][3] = {{1,0,0},{0,1,0},{0,0,1}};
  10. double b1[3] = {1,2,3};
  11. double ws1[3] = {0,0,0};
  12. const long n = 3;
  13. const long p = 3;
  14. const char trans = 'N';
  15. //double **U = &U1[0][0];
  16. double arr1[] = {1, 2, 3};
  17. double arr2[] = {4, 5, 6};
  18. double arr3[] = {7, 8, 9};
  19. double *U[3] = {arr1, arr2, arr3};
  20. double arr4[] = {-1, -3, -104};
  21. double arr5[] = {22, 3, 2};
  22. double arr6[] = {3, 99, 1};
  23. double *W[3] = {arr4, arr5, arr6};
  24. //double **U = U1;
  25. //U = W1; //{{1,0,0},{0,1,0},{0,0,1}};
  26. //double **W = W1;
  27. //W = U1; //{{1,0,0},{0,1,0},{0,0,1}};
  28. double *b = &b1[0];
  29. double *ws = &ws1[0];
  30. int a = strsv(n,p,trans,U,W,b,ws);
  31. printf("Success code: %d \n",a);
  32. return 0;
  33. }
  34.  
  35.  
  36.  
  37. for (int i=0; i < n; i++) {
  38. printf(" %.10f \n",b[i]);
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement