Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- int strsv(const long n,const long p,const char trans,double **U,double **W,double *b,double *ws);
- int main(void) {
- //double U1[3][3] = {{1,0,0},{0,1,0},{0,0,1}};
- //double W1[3][3] = {{1,0,0},{0,1,0},{0,0,1}};
- double b1[3] = {1,2,3};
- double ws1[3] = {0,0,0};
- const long n = 3;
- const long p = 3;
- const char trans = 'N';
- //double **U = &U1[0][0];
- double arr1[] = {1, 2, 3};
- double arr2[] = {4, 5, 6};
- double arr3[] = {7, 8, 9};
- double *U[3] = {arr1, arr2, arr3};
- double arr4[] = {-1, -3, -104};
- double arr5[] = {22, 3, 2};
- double arr6[] = {3, 99, 1};
- double *W[3] = {arr4, arr5, arr6};
- //double **U = U1;
- //U = W1; //{{1,0,0},{0,1,0},{0,0,1}};
- //double **W = W1;
- //W = U1; //{{1,0,0},{0,1,0},{0,0,1}};
- double *b = &b1[0];
- double *ws = &ws1[0];
- int a = strsv(n,p,trans,U,W,b,ws);
- printf("Success code: %d \n",a);
- return 0;
- }
- for (int i=0; i < n; i++) {
- printf(" %.10f \n",b[i]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement