offDiagonalFrobeniusNorm method

double offDiagonalFrobeniusNorm()

Computes the "off-diagonal" frobenius norm. Assumes the matrix is symmetric.

Implementation

double offDiagonalFrobeniusNorm() {
	final e = elements;
	double norm = 0;

	for ( int i = 0; i < 3; i ++ ) {
		final t = e[ getElementIndex( colVal[ i ], rowVal[ i ] ) ];
		norm += 2 * t * t; // multiply the result by two since the matrix is symetric
	}

	return math.sqrt( norm );
}