Conjugate transpose: Difference between revisions
Content added Content deleted
m (→{{header|C}}) |
m (→{{header|C}}) |
||
Line 173: | Line 173: | ||
c.cols = b.cols; |
c.cols = b.cols; |
||
c.z = |
c.z = malloc (c.rows * (sizeof (complex *))); |
||
for (i = 0; i < c.rows; i++) |
for (i = 0; i < c.rows; i++) |
||
{ |
{ |
||
c.z[i] = |
c.z[i] = malloc (c.cols * sizeof (complex)); |
||
c.z[i][j] = 0 + 0 * I; |
c.z[i][j] = 0 + 0 * I; |
||
for (j = 0; j < b.cols; j++) |
for (j = 0; j < b.cols; j++) |
||
Line 246: | Line 246: | ||
scanf ("%d%d", &a.rows, &a.cols); |
scanf ("%d%d", &a.rows, &a.cols); |
||
a.z = |
a.z = malloc (a.rows * sizeof (complex *)); |
||
printf ("Randomly Generated Complex Matrix A is : "); |
printf ("Randomly Generated Complex Matrix A is : "); |
||
for (i = 0; i < a.rows; i++) |
for (i = 0; i < a.rows; i++) |
||
{ |
{ |
||
printf ("\n"); |
printf ("\n"); |
||
a.z[i] = |
a.z[i] = malloc (a.cols * sizeof (complex)); |
||
for (j = 0; j < a.cols; j++) |
for (j = 0; j < a.cols; j++) |
||
{ |
{ |
||
Line 265: | Line 265: | ||
{ |
{ |
||
printf ("\n"); |
printf ("\n"); |
||
aT.z[i] = |
aT.z[i] = malloc (aT.cols * sizeof (complex)); |
||
for (j = 0; j < aT.cols; j++) |
for (j = 0; j < aT.cols; j++) |
||
{ |
{ |