src/Matrix/n_matrix.cc
// Input                nmx     : A n_matrix (this)
// Output               dmx     : A new d_matrix matrix whose
//                                elements are the same as nmx
// Note                         : This will allocate NEW memory
// Note                         : Array nmx MUST be square or fatal
//				  error will occur herein
Input                nmx     : A n_matrix (this)
Output               dmx     : A new d_matrix matrix whose
elements are the same as nmx
Note                         : This will allocate NEW memory
Note                         : Array nmx MUST be square or fatal
error will occur herein
Input nmx : A n_matrix ( this ) Output dmx : A new d_matrix matrix whose elements are the same as nmx Note : This will allocate NEW memory Note : Array nmx MUST be square or fatal error will occur herein
d_matrix* n_matrix::DMX()
  {                                             
  if(rows_ != cols_)				
    {
    NMxerror(14,1);				
    NMxfatal(71);				
    }
  d_matrix* dmx = new d_matrix(rows_,rows_);	
  complex *nii = data;				
  complex *dii = ((d_matrix*)dmx)->data;	
  complex *dend = dii + rows_;			
  for(; dii<dend; dii++,nii+=rows_+1)		
    (*dii) = (*nii);				
  return dmx;
  }
d_matrix * n_matrix :: DMX ( ) { if ( rows_ != cols_ ) { NMxerror ( 14 , 1 ) ; NMxfatal ( 71 ) ; } d_matrix * dmx = new d_matrix ( rows_ , rows_ ) ; complex * nii = data ; complex * dii = ( ( d_matrix * ) dmx ) -> data ; complex * dend = dii + rows_ ; for ( ; dii < dend ; dii ++ , nii += rows_ + 1 ) ( * dii ) = ( * nii ) ; return dmx ; }
Input                nmx     : A n_matrix (this)
Output               dmx     : A new d_matrix matrix whose
elements are the same as nmx
Note                         : This will allocate NEW memory
Note                         : Array nmx MUST be square or fatal
error will occur herein
Input nmx : A n_matrix ( this ) Output dmx : A new d_matrix matrix whose elements are the same as nmx Note : This will allocate NEW memory Note : Array nmx MUST be square or fatal error will occur herein
// We then loose nmx off diagonals // Array nmx MUST be square //    Bad rectangular array use //    Cannot convert to Hermitian // Start with an empty d_matrix // Start of data in nmx: <i|nmx|i>-><0|nmx|0> // Start of data in dmx: <i|dmx|i>-><0|dmx|0> // End of data in dmx: <rows_|nmx|rows_+1> // Loop over all the elements of dmx // <i|dmx|i> = <i|nmx|i>, forget other <i|nmx|j>