src/Matrix/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, the generic functions will handle this process,
   namely "Diagonalize" or "diag".  The other functions allow the user to
   monitor individual steps taken in the general case. 

   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 the arguments will
 will be set to the new matrix and transformation array (U) that will convert
 between the new form and the original array. In the case of block diagonal-
 ization a vector of block sizes will be returned. When possible, specialized
 routines will be used based on the matrix type and the return arrays will 
 be of the best suited form (e.g diagonal, block, unitary, etc....)          */
These functions reflect individual steps used in general complex matrix
diagonalizations. Since how a diagonalization is performed depends upon the
underlying matrix type, the generic functions will handle this process,
namely "Diagonalize" or "diag".  The other functions allow the user to
monitor individual steps taken in the general case.



In all cases, the original array will remain unchanged and the arguments will
will be set to the new matrix and transformation array (U) that will convert
between the new form and the original array. In the case of block diagonal
ization a vector of block sizes will be returned. When possible, specialized
routines will be used based on the matrix type and the return arrays will
be of the best suited form
These functions reflect individual steps used in general complex matrix diagonalizations . Since how a diagonalization is performed depends upon the underlying matrix type the generic functions will handle this process namely " Diagonalize " or " diag " . The other functions allow the user to monitor individual steps taken in the general case . In all cases the original array will remain unchanged and the arguments will will be set to the new matrix and transformation array ( U ) that will convert between the new form and the original array . In the case of block diagonal ization a vector of block sizes will be returned . When possible specialized routines will be used based on the matrix type and the return arrays will be of the best suited form
std::vector<int> matrix::BlockDiag(matrix& BF, std::vector<int> &U) const
  {
  if(rows() != cols()) 			
    { 					
    Mxerror(5, "BlockDiag", 1);	        
    Mxfatality(28);			
    }
  virtual_delete(BF.m);			
  std::vector<int> blks;		
  blks = m->BlockDiag(BF.m, U);	
  BF.m = virtual_copy(BF.m);		
  return blks;				
  }
std :: vector < int > matrix :: BlockDiag ( matrix & BF , std :: vector < int > & U ) const { if ( rows ( ) != cols ( ) ) { Mxerror ( 5 , " " , 1 ) ; Mxfatality ( 28 ) ; } virtual_delete ( BF . m ) ; std :: vector < int > blks ; blks = m -> BlockDiag ( BF . m , U ) ; BF . m = virtual_copy ( BF . m ) ; return blks ; }
These functions reflect individual steps used in general complex matrix
diagonalizations.
These functions reflect individual steps used in general complex matrix diagonalizations .
// Cant block non-square array  // so this will be a fatal error //   Bad use of BlockDiag function //   Diagonalization on non-square mx // Delete BF, it will be overwritten // Array of blocks // Block diagonalize mx: make BF & U // Now copy the new matrices as they // Return array of blocks 