Attribute VB_Name = "MATRIX_SIMILARITY_LIBR" Option Explicit 'Requires that all variables to be declared explicitly. Option Base 1 'The "Option Base" statement allows to specify 0 or 1 as the 'default first index of arrays. '************************************************************************************ '************************************************************************************ '© Copyright NicoSystem 2009. All rights reserved by Rafael Nicolas Fermin Cota, 'San Francisco, CA. USA www.rnfc.org 'nfermincota.hba2005@ivey.ca '************************************************************************************ '************************************************************************************ 'FUNCTION : MATRIX_SIMILARITY_TRANSFORM_FUNC 'DESCRIPTION : This operation is also called the "similarity transform" of 'matrix A by matrix B --> B^(-1)*A*B 'Similarity transforms play a crucial role in the computation of 'eigenvalues, because they leave the eigenvalues of the matrix A 'unchanged. For real symmetric matrices, B is orthogonal. The 'similarity transformation is the also called "orthogonal transform. 'LIBRARY : MATRIX 'GROUP : SIMILARITY 'ID : 001 'AUTHOR : RAFAEL NICOLAS FERMIN COTA '************************************************************************************ '************************************************************************************ Function MATRIX_SIMILARITY_TRANSFORM_FUNC(ByRef ADATA_RNG As Variant, _ ByRef BDATA_RNG As Variant) Dim ADATA_MATRIX As Variant Dim BDATA_MATRIX As Variant On Error GoTo ERROR_LABEL ADATA_MATRIX = ADATA_RNG BDATA_MATRIX = BDATA_RNG ADATA_MATRIX = MMULT_FUNC(ADATA_MATRIX, BDATA_MATRIX, 70) BDATA_MATRIX = MATRIX_LU_INVERSE_FUNC(BDATA_MATRIX) ADATA_MATRIX = MMULT_FUNC(BDATA_MATRIX, ADATA_MATRIX, 70) MATRIX_SIMILARITY_TRANSFORM_FUNC = ADATA_MATRIX Exit Function ERROR_LABEL: MATRIX_SIMILARITY_TRANSFORM_FUNC = Err.number End Function