b2ac/ext/src/Eigenmethods_double.c
void matrixToHessenbergForm_Givens_double(double *A)
{
	double givensValues[2] = {0.0, 0.0};
	int i;
	double tau_one = 0.0;
	double tau_two = 0.0;

	// For a 3x3 A, we need only rotate the A[2, 2] = A[6] value
	// into the A. Thus we first do a rotation with rows [1,2] and the
	// with columns [1,2].
	givensRotation_double(givensValues, A[3], A[6]);

	// Perform the row rotations.
	for(i = 0; i < 3; i++)
	{
		tau_one = A[3 + i];
		tau_two = A[6 + i];
		A[3 + i] = tau_one * givensValues[0] - tau_two * givensValues[1];
		A[6 + i] = tau_one * givensValues[1] + tau_two * givensValues[0];
	}

	// Perform the column rotations.
	for(i = 0; i < 9; i += 3)
	{
		tau_one = A[i + 1];
		tau_two = A[i + 2];
		A[i + 1] = tau_one * givensValues[0] - tau_two * givensValues[1];
		A[i + 2] = tau_one * givensValues[1] + tau_two * givensValues[0];
	}
}
/**
 * Converts a 3x3 general matrix to a Hessenberg form, using
 * Givens rotations.
 *
 * @brief In Hessenberg form, a matrix has the same eigenvalues
 * as in its original form, but it is upper triangular, with
 * non-zero values from the first subdiagonal and up.
 *
 */
Converts a 3x3 general matrix to a Hessenberg form, using
Givens rotations.

@brief In Hessenberg form, a matrix has the same eigenvalues
as in its original form, but it is upper triangular, with
non-zero values from the first subdiagonal and up.
Converts a 3x3 general matrix to a Hessenberg form using Givens rotations . @brief In Hessenberg form a matrix has the same eigenvalues as in its original form but it is upper triangular with non - zero values from the first subdiagonal and up .
void matrixToHessenbergForm_Givens_double(double *A)
{
	double givensValues[2] = {0.0, 0.0};
	int i;
	double tau_one = 0.0;
	double tau_two = 0.0;
	givensRotation_double(givensValues, A[3], A[6]);
	for(i = 0; i < 3; i++)
	{
		tau_one = A[3 + i];
		tau_two = A[6 + i];
		A[3 + i] = tau_one * givensValues[0] - tau_two * givensValues[1];
		A[6 + i] = tau_one * givensValues[1] + tau_two * givensValues[0];
	}
	for(i = 0; i < 9; i += 3)
	{
		tau_one = A[i + 1];
		tau_two = A[i + 2];
		A[i + 1] = tau_one * givensValues[0] - tau_two * givensValues[1];
		A[i + 2] = tau_one * givensValues[1] + tau_two * givensValues[0];
	}
}
void matrixToHessenbergForm_Givens_double ( double * A ) { double givensValues [ 2 ] = { 0.0 , 0.0 } ; int i ; double tau_one = 0.0 ; double tau_two = 0.0 ; givensRotation_double ( givensValues , A [ 3 ] , A [ 6 ] ) ; for ( i = 0 ; i < 3 ; i ++ ) { tau_one = A [ 3 + i ] ; tau_two = A [ 6 + i ] ; A [ 3 + i ] = tau_one * givensValues [ 0 ] - tau_two * givensValues [ 1 ] ; A [ 6 + i ] = tau_one * givensValues [ 1 ] + tau_two * givensValues [ 0 ] ; } for ( i = 0 ; i < 9 ; i += 3 ) { tau_one = A [ i + 1 ] ; tau_two = A [ i + 2 ] ; A [ i + 1 ] = tau_one * givensValues [ 0 ] - tau_two * givensValues [ 1 ] ; A [ i + 2 ] = tau_one * givensValues [ 1 ] + tau_two * givensValues [ 0 ] ; } }
Converts a 3x3 general matrix to a Hessenberg form, using
 Givens rotations.
Converts a 3x3 general matrix to a Hessenberg form using Givens rotations .
// For a 3x3 A, we need only rotate the A[2, 2] = A[6] value // into the A. Thus we first do a rotation with rows [1,2] and the // with columns [1,2]. // Perform the row rotations. // Perform the column rotations.