package Jampack;

/**
   Swap interchanges rows and columns of a matrix.

   @version Pre-alpha
   @author G. W. Stewart
*/

public class Swap{

/**
   Interchances two rows of a Zmat (altered).
   @param     A  The Zmat (altered)
   @param     r1 The index of the first row
   @param     r2 The index of the second row
   @exception JampackException
              Thrown for inconsistent row indices.
*/

   public static void rows(Zmat A, int r1, int r2)
   throws JampackException{

      A.getProperties();
      if (r1A.rx || r2A.rx){
         throw new JampackException
            ("Inconsistent row indices");
      }

      A.dirty = true;

      r1 = r1-A.bx;
      r2 = r2-A.bx;

      for (int j=0; jA.cx || c2A.cx){
         throw new JampackException
            ("Inconsistent row indices");
      }

      A.dirty = true;

      c1 = c1-A.bx;
      c2 = c2-A.bx;

      for (int i=0; i 

Ads help maintain this website.