Thread: looked at tutorial and still confused

1. okay when if its okay with u ill write post the instructions so it be clearer than me explaing\

By calling the function smatrix(A,x,n),with n=4,
which you will construct, determine the components of the matrix A_s=(A+A_t)/2, where
A_t stands for the transpose matrix of A, and the components of the
vector y=(A_s*x)/norm_x, where norm_x denotes the norm (length) of the vector x.
Print the components of the matrix A_s and the vector y in the main.
Free dinamically allocated memory

2. oh oops then its c sorry for the mistake, i guess i should have posted this in the other forum
i feel dumb now

3. Originally Posted by rafacnsoccer
oh oops then its c sorry for the mistake, i guess i should have posted this in the other forum
i feel dumb now
It doesn't matter that much, as long as you are sure which way you are suppose to go.

I don't know much about math, can you do this on paper? As for this bit:

Originally Posted by rafacnsoccer
Print the components of the matrix A_s and the vector y in the main.
Free dinamically allocated memory
That means smatrix will either return a **double (a new matrix), or else it could change A in place (if that is feasible). If you don't need to use the original A again, changing in place would be better (but it might be impossible depending on the details of the math part).

4. see i look online and all i find are programs using this type of transpose, which i dnt know if its the same
insert
Code:
```int main()
{
int i,j;
double a[4][5] = {{  1.00,  2.00,  3.00,  4.00,  5.00},
{  1.00,  4.00,  9.00, 16.00, 25.00},
{  1.00,  8.00, 27.00, 64.00,125.00},
{  1.00, 16.00, 81.00,256.00,625.00}};

double b[5][4];

transpose_matrix(&a[0][0], &b[0][0], 4, 5);
for(j=0;j<4;j++)
{
for(i=0;i<5;i++)
{
printf("%6.2lf ", a[j][i]);
}
printf("\n");
}
printf("--\n");
for(j=0;j<5;j++)
{
for(i=0;i<4;i++)
{
printf("%6.2lf ", b[j][i]);
}
printf("\n");
}
}```

5. yea so i am not too sure how to much on or how to translate this using the file pointer