src/Matrix/i_matrix.cc
/* These functions reflect individual steps used in general complex matrix
   diagonalizations. Since how a diagonalization is performed depends upon the
   underlying matrix type.  Of course, in the case of identity matrices, such
   routines don't do a damn thing. They must exist but will just return imx
   back.

   Function   Arguments                         Result
 ------------ --------- ------------------------------------------------------
  BlockDiag    mx, mx   Get blocked array form:          mx = U * BD  * inv(U)
 SymTriDiag    mx, mx   Get symmetric tridiagonal form:  mx = U * STD * inv(U)
 HermTriDiag   mx, mx   Get Hermitian tridiagonal array: mx = U * HTD * inv(U)
   SymDiag     mx, mx   Diagonalize symmetric array:     mx = U * SD  * inv(U)
 Diagonalize   mx, mx   Diagonalize array:               mx = U *  D  * inv(U)
    diag       mx, mx   Diagonalize array (non-member):  mx = U *  D  * inv(U)

 In all cases, the original array will remain unchanged and both the array U
 and "diagonalized" matrix will return as (pointers to) identity matrices.
 The input arrays should be NULL entering this function, and there referencing
 done upon return.  Since the return here is invariably the same matrix, all
 of this amounts to just incrementing the "this" imx reference count by 2.   */
These functions reflect individual steps used in general complex matrix
diagonalizations. Since how a diagonalization is performed depends upon the
underlying matrix type.  Of course, in the case of identity matrices, such
routines don't do a damn thing. They must exist but will just return imx
back.



In all cases, the original array will remain unchanged and both the array U
and "diagonalized" matrix will return as (pointers to) identity matrices.
The input arrays should be NULL entering this function, and there referencing
done upon return.  Since the return here is invariably the same matrix, all
of this amounts to just incrementing the "this" imx reference count by 2.
These functions reflect individual steps used in general complex matrix diagonalizations . Since how a diagonalization is performed depends upon the underlying matrix type . Of course in the case of identity matrices such routines don ' t do a damn thing . They must exist but will just return imx back . In all cases the original array will remain unchanged and both the array U and " diagonalized " matrix will return as ( pointers to ) identity matrices . The input arrays should be NULL entering this function and there referencing done upon return . Since the return here is invariably the same matrix all of this amounts to just incrementing the " this " imx reference count by 2 .
std::vector<int> i_matrix::BlockDiag(_matrix*    (&BD), std::vector<int> &U)
  { BD = this;
  int nr = rows_;				
  int i;
  for(i=0; i<nr; i++) { U.push_back(i); }	
  return std::vector<int>(1, rows_); }
std :: vector < int > i_matrix :: BlockDiag ( _matrix * ( & BD ) , std :: vector < int > & U ) { BD = this ; int nr = rows_ ; int i ; for ( i = 0 ; i < nr ; i ++ ) { U . push_back ( i ) ; } return std :: vector < int > ( 1 , rows_ ) ; }
These functions reflect individual steps used in general complex matrix
diagonalizations.
These functions reflect individual steps used in general complex matrix diagonalizations .
// Matrix dimension // Set both as unpermuted