Older debugging utility for backwards compatability.
@return html version of matrix
179250
public function mprint($A, $format='%01.2f', $width=2)
    {
        $spacing = '';
        $m = count($A);
        $n = count($A[0]);
        for ($i = 0; $i < $width; $i++) {
            $spacing .= '&nbsp;';
        }
        for ($i = 0; $i < $m; $i++) {
            for ($j = 0; $j < $n; $j++) {
                $formatted = sprintf($format, $A[$i][$j]);
                echo $formatted . $spacing;
            }
            echo '<br />';
        }
    }
778870
function() {
    var rows = this.elements.length, cols = this.elements[0].length;
    var elements = [], ni = cols, i, nj, j;
    do { i = cols - ni;
      elements[i] = [];
      nj = rows;
      do { j = rows - nj;
        elements[i][j] = this.elements[j][i];
      } while (--nj);
    } while (--ni);
    return Matrix.create(elements);
  }
1151377
function() {
    var matrix_rows = [];
    var n = this.elements.length, k = n, i;
    do { i = k - n;
      matrix_rows.push(Vector.create(this.elements[i]).inspect());
    } while (--n);
    return matrix_rows.join('\n');
  }
241017
public Matrix transpose() {
        Matrix result = blankOfShape(columns, rows);
        MatrixIterator it = result.iterator();

        while (it.hasNext()) {
            it.next();
            int i = it.rowIndex();
            int j = it.columnIndex();
            it.set(get(j, i));
        }

        return result;
    }
452307
@Nonnull
  @ReturnsMutableCopy
  public Matrix getD ()
  {
    final Matrix aNewMatrix = new Matrix (m_nDim, m_nDim);
    final double [] [] aNewArray = aNewMatrix.internalGetArray ();
    for (int nRow = 0; nRow < m_nDim; nRow++)
    {
      final double [] aDstRow = aNewArray[nRow];
      Arrays.fill (aDstRow, 0.0);
      aDstRow[nRow] = m_aEVd[nRow];

      final double dEVe = m_aEVe[nRow];
      if (dEVe > 0)
        aDstRow[nRow + 1] = dEVe;
      else
        if (dEVe < 0)
          aDstRow[nRow - 1] = dEVe;
    }
    return aNewMatrix;
  }
1180529
public Matrix getWorldToPanTransformation() {
		if (viewState.getScale() > 0) {
			double dX = -(viewState.getPanX() * viewState.getScale());
			double dY = viewState.getPanY() * viewState.getScale();
			return new Matrix(viewState.getScale(), 0, 0, -viewState.getScale(), dX, dY);
		}
		return new Matrix(1, 0, 0, 1, 0, 0);
	}
1092698
public function getL()
    {
        $L = [];
        for ($i = 0; $i < $this->m; ++$i) {
            for ($j = 0; $j < $this->n; ++$j) {
                if ($i > $j) {
                    $L[$i][$j] = $this->LU[$i][$j];
                } elseif ($i == $j) {
                    $L[$i][$j] = 1.0;
                } else {
                    $L[$i][$j] = 0.0;
                }
            }
        }
        return new Matrix($L);
    }
1298571
public DMatrixRMaj getR() {
        DMatrixRMaj R = new DMatrixRMaj(QR.numRows,QR.numCols);
        int N = Math.min(QR.numCols,QR.numRows);

        for( int i = 0; i < N; i++ ) {
            for( int j = i; j < QR.numCols; j++ ) {
                R.unsafe_set(i,j, QR.unsafe_get(i,j));
            }
        }

        return R;
    }
1197690
public function getMatrix()
    {
        if (func_num_args() > 0) {
            $args = func_get_args();
            $match = implode(',', array_map('gettype', $args));
            switch ($match) {
 
      //A($i0...; $j0...)
      case 'integer,integer':
        list($i0, $j0) = $args;
          $m = $i0 >= 0 ? $this->m - $i0 : trigger_error(ArgumentBoundsException, ERROR);
          $n = $j0 >= 0 ? $this->n - $j0 : trigger_error(ArgumentBoundsException, ERROR);
          $R = new Matrix($m, $n);
 
          for ($i = $i0; $i < $this->m; $i++) {
              for ($j = $j0; $j < $this->n; $j++) {
                  $R->set($i, $j, $this->A[$i][$j]);
              }
          }
 
          return $R;
          break;
 
      //A($i0...$iF; $j0...$jF)
      case 'integer,integer,integer,integer':
       list($i0, $iF, $j0, $jF) = $args;
        $m = (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) ? $iF - $i0 : trigger_error(ArgumentBoundsException, ERROR);
        $n = (($jF > $j0) && ($this->n >= $jF) && ($j0 >= 0)) ? $jF - $j0 : trigger_error(ArgumentBoundsException, ERROR);
        $R = new Matrix($m+1, $n+1);
 
        for ($i = $i0; $i <= $iF; $i++) {
            for ($j = $j0; $j <= $jF; $j++) {
                $R->set($i - $i0, $j - $j0, $this->A[$i][$j]);
            }
        }
 
        return $R;
        break;
 
      //$R = array of row indices; $C = array of column indices
      case 'array,array':
        list($RL, $CL) = $args;
        $m = count($RL) > 0 ? count($RL) : trigger_error(ArgumentBoundsException, ERROR);
        $n = count($CL) > 0 ? count($CL) : trigger_error(ArgumentBoundsException, ERROR);
        $R = new Matrix($m, $n);
 
        for ($i = 0; $i < $m; $i++) {
            for ($j = 0; $j < $n; $j++) {
                $R->set($i - $i0, $j - $j0, $this->A[$RL[$i]][$CL[$j]]);
            }
        }
 
        return $R;
        break;
 
      //$RL = array of row indices; $CL = array of column indices
      case 'array,array':
        list($RL, $CL) = $args;
        $m = count($RL) > 0 ? count($RL) : trigger_error(ArgumentBoundsException, ERROR);
        $n = count($CL) > 0 ? count($CL) : trigger_error(ArgumentBoundsException, ERROR);
        $R = new Matrix($m, $n);
 
        for ($i = 0; $i < $m; $i++) {
            for ($j = 0; $j < $n; $j++) {
                $R->set($i, $j, $this->A[$RL[$i]][$CL[$j]]);
            }
        }
 
        return $R;
        break;
 
      //A($i0...$iF); $CL = array of column indices
      case 'integer,integer,array':
        list($i0, $iF, $CL) = $args;
        $m = (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) ? $iF - $i0 : trigger_error(ArgumentBoundsException, ERROR);
        $n = count($CL) > 0 ? count($CL) : trigger_error(ArgumentBoundsException, ERROR);
        $R = new Matrix($m, $n);
 
        for ($i = $i0; $i < $iF; $i++) {
            for ($j = 0; $j < $n; $j++) {
                $R->set($i - $i0, $j, $this->A[$RL[$i]][$j]);
            }
        }
 
        return $R;
        break;
 
      //$RL = array of row indices
      case 'array,integer,integer':
        list($RL, $j0, $jF) = $args;
        $m = count($RL) > 0 ? count($RL) : trigger_error(ArgumentBoundsException, ERROR);
        $n = (($jF >= $j0) && ($this->n >= $jF) && ($j0 >= 0)) ? $jF - $j0 : trigger_error(ArgumentBoundsException, ERROR);
        $R = new Matrix($m, $n+1);
 
        for ($i = 0; $i < $m; $i++) {
            for ($j = $j0; $j <= $jF; $j++) {
                $R->set($i, $j - $j0, $this->A[$RL[$i]][$j]);
            }
        }
 
        return $R;
        break;
      default:
        trigger_error(PolymorphicArgumentException, ERROR);
        break;
      }
        } else {
            trigger_error(PolymorphicArgumentException, ERROR);
        }
    }
1174039
public Matrix3dStack pushMatrix() {
        if (curr == mats.length) {
            throw new IllegalStateException("max stack size of " + (curr + 1) + " reached"); //$NON-NLS-1$ //$NON-NLS-2$
        }
        mats[curr++].set(this);
        return this;
    }
537192
protected function get_RowsInnerHtml() {
    $rowsInnerHtml = [];
    foreach ($this->MatrixCells as $rowIndex => $rowCells) {
      $rowInnerHtml = '';
      foreach ($rowCells as $colIndex => $cell) {
        $rowInnerHtml .= $cell->render();
      }
      $rowsInnerHtml[$rowIndex] = $rowInnerHtml;
    }
    return $rowsInnerHtml;
  }
181214
function() {
                	var matrix_rows = [];
                	var n = this.elements.length;
                	for (var i = 0; i < n; i++) {
                    matrix_rows.push(this.elements[i]);
                	}
                  return matrix_rows;
                }
227461
function() {
        return "| " + this.matrix[0][0] + " " + this.matrix[0][1] + " " + this.matrix[0][2] + " " + this.matrix[0][3] + " |\n" + "| " + this.matrix[1][0] + " " + this.matrix[1][1] + " " + this.matrix[1][2] + " " + this.matrix[1][3] + " |\n" + "| " + this.matrix[2][0] + " " + this.matrix[2][1] + " " + this.matrix[2][2] + " " + this.matrix[2][3] + " |\n" + "| " + this.matrix[3][0] + " " + this.matrix[3][1] + " " + this.matrix[3][2] + " " + this.matrix[3][3] + " |";
    }
636940
public Matrix4f getOffsetMatrix()
    {
        Matrix4f offsetMatrix = new Matrix4f();
        offsetMatrix.set(NativeBone.getOffsetMatrix(getNative()));
        return offsetMatrix;
    }
1189388
public Matrix4f getFinalTransformMatrix()
    {
        final FloatBuffer fb = ByteBuffer.allocateDirect(4*4*4).order(ByteOrder.nativeOrder()).asFloatBuffer();
        NativeBone.getFinalTransformMatrix(getNative(), fb);
        return new Matrix4f(fb);
    }
854172
public static int getJavaMajorVersion() {

        final String[] versionElements = System.getProperty(JAVA_VERSION_PROPERTY).split("\\.");
        final int[] versionNumbers = new int[versionElements.length];

        for (int i = 0; i < versionElements.length; i++) {
            try {
                versionNumbers[i] = Integer.parseInt(versionElements[i]);
            } catch (NumberFormatException e) {
                versionNumbers[i] = 0;
            }
        }

        /*
        Java versions 1 - 8 (i.e. jdk 1.1 through 1.8) yields the structure 1.8
        Java versions 9 - yields the structure 10

        JDK 10
        ======
        [java.specification.version]: 10

        JDK 8
        =====
        [java.specification.version]: 1.8

        JDK 7
        =====
        [java.specification.version]: 1.7
        */
        return versionNumbers[0] == 1 ? versionNumbers[1] : versionNumbers[0];
    }
1295896
function() {
        return this.set(
			this.matrix[0][0], this.matrix[1][0], this.matrix[2][0], this.matrix[3][0],
			this.matrix[0][1], this.matrix[1][1], this.matrix[2][1], this.matrix[3][1],
			this.matrix[0][2], this.matrix[1][2], this.matrix[2][2], this.matrix[3][2],
			this.matrix[0][3], this.matrix[1][3], this.matrix[2][3], this.matrix[3][3]
		);
	}