Exemplo n.º 1
0
 /**
  * Solve A*X = B.
  * @param Matrix $B Right hand side
  * @return Matrix ... Solution if A is square, least squares solution otherwise
  */
 function solve($B)
 {
     if ($this->m == $this->n) {
         $LU = new LUDecomposition($this);
         return $LU->solve($B);
     } else {
         $QR = new QRDecomposition($this);
         return $QR->solve($B);
     }
 }
Exemplo n.º 2
0
 /**
  *    Solve A*X = B.
  *
  *    @param Matrix $B Right hand side
  *    @return Matrix ... Solution if A is square, least squares solution otherwise
  */
 public function solve($B)
 {
     if ($this->m == $this->n) {
         $LU = new LUDecomposition($this);
         return $LU->solve($B);
     } else {
         $QR = new PHPExcel_Shared_JAMA_QRDecomposition($this);
         return $QR->solve($B);
     }
 }