Linear Algebra and the C Language/a0gm
Similar matrices:
In linear algebra, two n-by-n matrices A and B are called similar if there exists an invertible n-by-n matrix P such that : B = InvP A P... Wikipedia: Matrix similarity
Create similar matrices: B = InvP A P
First, I create the matrix P and its inverse.
for(i=A0; i<ARRAY; i++)
{
A[i] = i_mR(RCA,RCA);
P[i] = r_mR( i_mR(RCA,RCA),99);
InvP[i] = inv_mR(P[i], i_mR(RCA,RCA));
}
For A[0], I choose a symmetric matrix so that the eigenvalues are real.
rsymmetric_mR(A[0],99);
I am currently creating all the similar matrices.
for(i=A0; i<(ARRAY-C1); i++)
{
mul_mR(InvP[i],A[i],T);
mul_mR(T,P[i],A[i+C1]);
}
Similar matrices have the same determinant.
Similar matrices have the same trace.
Similar matrices have the same eigenvalues.
IF ... A[1] = InvP A[0] P ... Then ... A[1]**3 = InvP A[0]**3 P
IF ... A[1] = InvP A[0] P ... Then ... InvA[1] = InvP InvA[0] P