src/Matrix/n_matrix.cc
/* sosi - There are a few ways this can be sped up I think.
    1.) Replace the line nmx(l+1,l) = conj(ss,(*this)(l+1,l));
        with the line    nmx(l+1,l) = conj(ss, nmx(l+1,l))
    2.) Forget about even setting nmx(l,l+1)*=ss since we don't seem
        to ever use it and we definetely overwrite it if it is zero 
    3.) Switch to direct element access rather than recomputing the
        element index here.
*/
There are a few ways this can be sped up I think.
There are a few ways this can be sped up I think .
void n_matrix::rred(n_matrix& mxev, int newU)
  {
  n_matrix &nmx = *this;			
  int i, l, nr=rows();				
  double normod;				
  complex sf;
  for(l=1; l<nr; l++)				
    {
    normod = norm(nmx(l,l-1));			
    if(normod!=0)				
      {						
      sf = conj(nmx(l,l-1))/normod;		
      nmx(l,l-1) = normod;			
      nmx(l-1,l) = normod;			
      if(l < nr-1)				
        {					
        nmx(l,l+1) *= sf;			
        nmx(l+1,l) = conj(sf,(*this)(l+1,l));   
        }					
      for(i=0; i<nr; i++) 			
        mxev(i,l) = conj(sf,mxev(i,l));		
      }
    }
  }
void n_matrix :: rred ( n_matrix & mxev , int newU ) { n_matrix & nmx = * this ; int i , l , nr = rows ( ) ; double normod ; complex sf ; for ( l = 1 ; l < nr ; l ++ ) { normod = norm ( nmx ( l , l - 1 ) ) ; if ( normod != 0 ) { sf = conj ( nmx ( l , l - 1 ) ) / normod ; nmx ( l , l - 1 ) = normod ; nmx ( l - 1 , l ) = normod ; if ( l < nr - 1 ) { nmx ( l , l + 1 ) *= sf ; nmx ( l + 1 , l ) = conj ( sf , ( * this ) ( l + 1 , l ) ) ; } for ( i = 0 ; i < nr ; i ++ ) mxev ( i , l ) = conj ( sf , mxev ( i , l ) ) ; } } }
sosi - There are a few ways this can be sped up I think.
sosi - There are a few ways this can be sped up I think .
// A handle on the array // These are just a set // of working variables // Loop nmx rows // Get norm of <l|nmx|l-1>  // (direcly left of <l|nmx|l>) // Act only if its non-zero // <l|nmx|l-1>/||<l|nmx|l-1>|| // Set <l|nmx|l-1>=normod (left) // Set <l-1|nmx|l>=normod (above) // Apply transform if  // still two rows from end // Mult. <l|nmxl+1> by sf (right) // <l+1|nmx|l> = conj(s)*<l+1|this|l> // (below, using original below?) // Accumulate transform in // the mxev array now