// Converts a complex matrix (ComplexMatrix) to a phasor matrix (PhasorMatix)
 public static PhasorMatrix toPhasorMatrix(ComplexMatrix cc) {
   PhasorMatrix pp = new PhasorMatrix(cc.getNrow(), cc.getNcol());
   pp.index = cc.getIndexCopy();
   pp.dswap = cc.getSwap();
   for (int i = 0; i < pp.nrow; i++) {
     for (int j = 0; j < pp.ncol; i++) {
       pp.matrix[i][j] = Phasor.toPhasor(cc.getElementCopy(i, j));
     }
   }
   return pp;
 }