Generate and return the (economy-sized) orthogonal factor
@return     Q
342399
public Matrix getQ () {
		Matrix X = new Matrix(m,n);
		double[][] Q = X.getArray();
		for (int k = n-1; k >= 0; k--) {
			for (int i = 0; i < m; i++) {
				Q[i][k] = 0.0;
			}
			Q[k][k] = 1.0;
			for (int j = k; j < n; j++) {
				if (QR[k][k] != 0) {
					double s = 0.0;
					for (int i = k; i < m; i++) {
						s += QR[i][k]*Q[i][j];
					}
					s = -s/QR[k][k];
					for (int i = k; i < m; i++) {
						Q[i][j] += s*QR[i][k];
					}
				}
			}
		}
		return X;
	}
1149569
public static QL factorize(Matrix A) {
        return new QL(A.numRows(), A.numColumns()).factor(new DenseMatrix(A));
    }
882088
public function getR()
    {
        for ($i = 0; $i < $this->n; ++$i) {
            for ($j = 0; $j < $this->n; ++$j) {
                if ($i < $j) {
                    $R[$i][$j] = $this->QR[$i][$j];
                } elseif ($i == $j) {
                    $R[$i][$j] = $this->Rdiag[$i];
                } else {
                    $R[$i][$j] = 0.0;
                }
            }
        }
        return new PHPExcel_Shared_JAMA_Matrix($R);
    }
1252371
public function bl()
    {
        $q = new self(self::BOTTOM_LEFT, $this->bool_rotate_way);
        $q->units($this->arr_units);

        return $q;
    }
1248223
def Q_srk(self, k):
        
        ind = self.index[self.Q_time_var_index, k]
        Q = self.Q[:, :, ind]

        if (Q.shape[0] == 1):  # 1-D case handle simplier. No storage
            # of the result, just compute it each time.
            square_root = np.sqrt(Q)
        else:
            if self.svd_each_time:

                (U, S, Vh) = sp.linalg.svd(Q, full_matrices=False,
                                           compute_uv=True,
                                           overwrite_a=False,
                                           check_finite=True)

                square_root = U * np.sqrt(S)
            else:

                if ind in self.Q_square_root:
                    square_root = self.Q_square_root[ind]
                else:
                    (U, S, Vh) = sp.linalg.svd(Q, full_matrices=False,
                                               compute_uv=True,
                                               overwrite_a=False,
                                               check_finite=True)

                    square_root = U * np.sqrt(S)

                    self.Q_square_root[ind] = square_root

        return square_root
1194756
public function rref() : self
    {
        [$b, $swaps] = $this->ref();

        $b = $b->asArray();

        $row = $col = 0;

        while ($row < $this->m and $col < $this->n) {
            $t = $b[$row];

            if (abs($t[$col]) == 0) {
                $col++;

                continue 1;
            }

            $divisor = $t[$col];

            if ($divisor != 1) {
                for ($i = 0; $i < $this->n; $i++) {
                    $t[$i] /= $divisor;
                }
            }

            for ($i = $row - 1; $i >= 0; $i--) {
                $scale = $b[$i][$col];

                if ($scale != 0) {
                    for ($j = 0; $j < $this->n; $j++) {
                        $b[$i][$j] += -$scale * $t[$j];
                    }
                }
            }

            $b[$row] = $t;

            $row++;
            $col++;
        }

        return self::quick($b);
    }
17855
public function getQuality()
    {
        $default = 90;

        if (!is_numeric($this->q)) {
            return $default;
        }

        if ($this->q < 0 or $this->q > 100) {
            return $default;
        }

        return (int) $this->q;
    }
890270
private function normalizeQualityFactor($qFactor)
    {
        if (!is_numeric($qFactor)) {
            $qFactor = 1.0;

        } elseif ($qFactor < 0) {
            $qFactor = 0.0;

        } elseif ($qFactor > 1) {
            $qFactor = 1.0;

        } else {
            $qFactor = floatval($qFactor);
        }

        return $qFactor;
    }
46134
@Override
    public DMatrixRMaj getQ(DMatrixRMaj Q , boolean compact ) {
        if( compact ) {
            Q = UtilDecompositons_DDRM.checkIdentity(Q,numRows,minLength);
        } else {
            Q = UtilDecompositons_DDRM.checkIdentity(Q,numRows,numRows);
        }

        for( int j = minLength-1; j >= 0; j-- ) {
            double u[] = dataQR[j];

            double vv = u[j];
            u[j] = 1;
            QrHelperFunctions_DDRM.rank1UpdateMultR(Q, u, gammas[j], j, j, numRows, v);
            u[j] = vv;
        }

        return Q;
    }
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);
    }
763441
public Quaterniond premul(Quaterniondc q, Quaterniond dest) {
        dest.set(q.w() * x + q.x() * w + q.y() * z - q.z() * y,
                 q.w() * y - q.x() * z + q.y() * w + q.z() * x,
                 q.w() * z + q.x() * y - q.y() * x + q.z() * w,
                 q.w() * w - q.x() * x - q.y() * y - q.z() * z);
        return dest;
    }
612862
public function getD()
    {
        for ($i = 0; $i < $this->n; ++$i) {
            $D[$i] = array_fill(0, $this->n, 0.0);
            $D[$i][$i] = $this->d[$i];
            if ($this->e[$i] == 0) {
                continue;
            }
            $o = ($this->e[$i] > 0) ? $i + 1 : $i - 1;
            $D[$i][$o] = $this->e[$i];
        }
        return new Matrix($D);
    }
281972
public function ArithmeticFactor()
    {
        $sign   = null;
        $isPlus = $this->lexer->isNextToken(Lexer::T_PLUS);

        if ($isPlus || $this->lexer->isNextToken(Lexer::T_MINUS)) {
            $this->match($isPlus ? Lexer::T_PLUS : Lexer::T_MINUS);
            $sign = $isPlus;
        }

        $primary = $this->ArithmeticPrimary();

        // Phase 1 AST optimization: Prevent AST\ArithmeticFactor
        // if only one AST\ArithmeticPrimary is defined
        if ($sign === null) {
            return $primary;
        }

        return new AST\ArithmeticFactor($primary, $sign);
    }
478721
public function br()
    {
        $q = new self(self::BOTTOM_RIGHT, $this->bool_rotate_way);
        $q->units($this->arr_units);

        return $q;
    }
382059
protected function generateEquation()
    {
        $ops = [' + ', ' - ', ' * ', ' / '];
        $equation = null;
        $rand1 = rand(1, 10);
        $rand2 = rand(1, 10);
        $op    = $ops[rand(0, 3)];
        // If the operator is division, keep the equation very simple, with no remainder
        if ($op == ' / ') {
            $mod = ($rand2 > $rand1) ? $rand2 % $rand1 : $rand1 % $rand2;
            while ($mod != 0) {
                $rand1 = rand(1, 10);
                $rand2 = rand(1, 10);
                $mod   = ($rand2 > $rand1) ? $rand2 % $rand1 : $rand1 % $rand2;
            }
        }
        $equation = ($rand2 > $rand1) ? $rand2 . $op . $rand1 : $rand1 . $op . $rand2;
        return $equation;
    }
882572
public function getUnitPrice()
    {
        // Performance
        if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadPrice') || !$this->_blLoadPrice) {
            return;
        }

        $oPrice = null;
        if ((double) $this->getUnitQuantity() && $this->oxarticles__oxunitname->value) {
            $oPrice = clone $this->getPrice();
            $oPrice->divide((double) $this->getUnitQuantity());
        }

        return $oPrice;
    }
1068849
public void recomputeQ( DMatrix4x4 Q ) {
		CommonOps_DDF3.multTransB(k,k,w);

		Q.a11 = w.a11;Q.a12 = w.a12;Q.a13 = w.a13;
		Q.a21 = w.a21;Q.a22 = w.a22;Q.a23 = w.a23;
		Q.a31 = w.a31;Q.a32 = w.a32;Q.a33 = w.a33;

		CommonOps_DDF3.mult(w,p,t);
		CommonOps_DDF3.scale(-1,t);

		Q.a14 = t.a1;Q.a24 = t.a2;Q.a34 = t.a3;
		Q.a41 = t.a1;Q.a42 = t.a2;Q.a43 = t.a3;

		Q.a44 = -CommonOps_DDF3.dot(t,p);
	}