#include <numeric.h> int main() { int m = 4; array double complex a[4][4] = { 0, 0, complex(1,1), 0, 0, 0, 0, complex(1,1), complex(11,1),complex(10,1), 0, 0, complex(10,1),complex(11,1), 0, 0}; int status; array double complex b[m][m]; array double d[m][m]; status = balance(a, b, d); if (status == 0) { printf("a =\n%4.2f\n", a); printf("b =\n%4.2f\n", b); printf("d =\n%4.2f\n", d); printf("inverse(d)*a*d -b =\n%4.2f\n", inverse(d)*a*d-b); } else printf("error: calculation error in balance().\n"); }
a = complex(0.00,0.00) complex(0.00,0.00) complex(1.00,1.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(1.00,1.00) complex(11.00,1.00) complex(10.00,1.00) complex(0.00,0.00) complex(0.00,0.00) complex(10.00,1.00) complex(11.00,1.00) complex(0.00,0.00) complex(0.00,0.00) b = complex(0.00,0.00) complex(0.00,0.00) complex(10.00,10.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(10.00,10.00) complex(1.10,0.10) complex(1.00,0.10) complex(0.00,0.00) complex(0.00,0.00) complex(1.00,0.10) complex(1.10,0.10) complex(0.00,0.00) complex(0.00,0.00) d = 0.10 0.00 0.00 0.00 0.00 0.10 0.00 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 1.00 inverse(d)*a*d -b = complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00) complex(0.00,0.00)