src/Matrix/n_matrix.cc
/*     Function    Output                       Description
     ------------  -------  ---------------------------------------------------
       swaprows      T/F    Swaps two rows of the matrix, true if successful
       swapcols      T/F    Swaps two columns of the matrix, true if successful
        permute    matrix   Permutes rows & columns of the matrix
        maxRe      double   Returns largest real value in the array
        maxIm      double   Returns largest imaginary value in the array
        maxZ       complex  Returns largest complex (norm) value in array
        minRe      double   Returns smallest real value in the array
        minIm      double   Returns smallest imaginary value in the array
        minZ       complex  Returns smallest complex (norm) value in array   */
Function    Output                       Description

swaprows      T/F    Swaps two rows of the matrix, true if successful
swapcols      T/F    Swaps two columns of the matrix, true if successful
permute    matrix   Permutes rows & columns of the matrix
maxRe      double   Returns largest real value in the array
maxIm      double   Returns largest imaginary value in the array
maxZ       complex  Returns largest complex (norm) value in array
minRe      double   Returns smallest real value in the array
minIm      double   Returns smallest imaginary value in the array
minZ       complex  Returns smallest complex (norm) value in array
Function Output Description swaprows T / F Swaps two rows of the matrix true if successful swapcols T / F Swaps two columns of the matrix true if successful permute matrix Permutes rows & columns of the matrix maxRe double Returns largest real value in the array maxIm double Returns largest imaginary value in the array maxZ complex Returns largest complex ( norm ) value in array minRe double Returns smallest real value in the array minIm double Returns smallest imaginary value in the array minZ complex Returns smallest complex ( norm ) value in array
_matrix* n_matrix::swaprows(int I, int J)
  {
  n_matrix* nsr = new n_matrix(*this);          
  int I0 = I*cols_;				
  int J0 = J*cols_;				
  for(int k=0; k<cols_; k++)			
    {
    nsr->data[I0+k] = data[J0+k];       	
    nsr->data[J0+k] = data[I0+k];               
    }
  return nsr;
  }
_matrix * n_matrix :: swaprows ( int I , int J ) { n_matrix * nsr = new n_matrix ( * this ) ; int I0 = I * cols_ ; int J0 = J * cols_ ; for ( int k = 0 ; k < cols_ ; k ++ ) { nsr -> data [ I0 + k ] = data [ J0 + k ] ; nsr -> data [ J0 + k ] = data [ I0 + k ] ; } return nsr ; }
Function    Output                       Description
  
swaprows      T/F    Swaps two rows of the matrix, true if successful
swapcols      T/F    Swaps two columns of the matrix, true if successful
permute    matrix   Permutes rows & columns of the matrix
maxRe      double   Returns largest real value in the array
maxIm      double   Returns largest imaginary value in the array
maxZ       complex  Returns largest complex (norm) value in array
minRe      double   Returns smallest real value in the array
minIm      double   Returns smallest imaginary value in the array
minZ       complex  Returns smallest complex (norm) value in array
Function Output Description swaprows T / F Swaps two rows of the matrix true if successful swapcols T / F Swaps two columns of the matrix true if successful permute matrix Permutes rows & columns of the matrix maxRe double Returns largest real value in the array maxIm double Returns largest imaginary value in the array maxZ complex Returns largest complex ( norm ) value in array minRe double Returns smallest real value in the array minIm double Returns smallest imaginary value in the array minZ complex Returns smallest complex ( norm ) value in array
// Make new n_matrix // Index of <I|mx,mx'|0> // Index of <J|mx,mx'|0> // Swap rows I & J // Set <I|mx'|k> = <J|mx|k> // Set <J|mx'|k> = <I|mx|k>