src/Matrix/matrix.cc
// sosi - the hermitian_type isn't even used!
// sosi - should not copy here if input is hermitian
// why do not individual classes handle this change
// why isn't the unknown matrix type handled?
the hermitian_type isn't even used.
the hermitian_type isn ' t even used .
void matrix::set_hermitian(hermitian_type h)
  {
  m = virtual_to_real_copy(m);            
  switch((*m).stored_type())
    {
    case d_matrix_type:			
      {					
      for(int i=0; i<(*m).rows(); i++)	
	set_imaginary_part((*m)(i,i),0);
      break;
      }
    case n_matrix_type: 		
      {					
      int i;
      for(i=0; i<(*m).rows(); i++)	
	for(int j=0; j<i; j++)
	  (*m)(i,j) = ((*m)(j,i)).conj();
      for(i=0; i<(*m).rows(); i++) 
	set_imaginary_part((*m)(i,i),0);
      break;
      }
    case i_matrix_type:			
    case h_matrix_type:			
      break;
    default:				
      Mxerror(49, 1);			
      Mxerror(6, "set_hermitian", 1);	
      Mxfatality(30);			
    }
  return;
  hermitian_type x;
  x = h;				
  }
void matrix :: set_hermitian ( hermitian_type h ) { m = virtual_to_real_copy ( m ) ; switch ( ( * m ) . stored_type ( ) ) { case d_matrix_type : { for ( int i = 0 ; i < ( * m ) . rows ( ) ; i ++ ) set_imaginary_part ( ( * m ) ( i , i ) , 0 ) ; break ; } case n_matrix_type : { int i ; for ( i = 0 ; i < ( * m ) . rows ( ) ; i ++ ) for ( int j = 0 ; j < i ; j ++ ) ( * m ) ( i , j ) = ( ( * m ) ( j , i ) ) . conj ( ) ; for ( i = 0 ; i < ( * m ) . rows ( ) ; i ++ ) set_imaginary_part ( ( * m ) ( i , i ) , 0 ) ; break ; } case i_matrix_type : case h_matrix_type : break ; default : Mxerror ( 49 , 1 ) ; Mxerror ( 6 , " " , 1 ) ; Mxfatality ( 30 ) ; } return ; hermitian_type x ; x = h ; }
sosi - the hermitian_type isn't even used!
sosi - the hermitian_type isn ' t even used!
// Make copy which we'll alter // Set diagonal to Hermitian // Just zero the imaginary parts // on the diagonal & its Hermitian // Set normal matrix to Hermitian  // Copy <i|mx|j> to <j|mx|i>* for i>j // ant set <i|mx|i> to real // Set identity or Hermitian to Hermitian // does nothing, they are Hermitian  // Set unknown type Hermitian, don't know //    Cannot set  hermitian matrix type //    Trouble w/ set_hermitian fnct! //    Failed operation // Compiler likes h to be used