commands → symmetric

symmetric(A)

The symmetric command tests whether a matrix A is symmetric, that is, whether A[i][j] equals A[j][i] for each i and j.

Examples

A = [[1,2,3],[4,5,6],[7,8,9]];
symmetric(A);
	0
B = A * transpose(A);
symmetric(B);
	1;
B;
	[[14, 32, 50], [32, 77, 122], [50, 122, 194]]