![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/local/lib/python3.6/dist-packages/sympy/matrices/expressions/tests/ |
Upload File : |
from sympy.matrices.expressions.factorizations import lu, LofCholesky, qr, svd from sympy import Symbol, MatrixSymbol, ask, Q n = Symbol('n') X = MatrixSymbol('X', n, n) def test_LU(): L, U = lu(X) assert L.shape == U.shape == X.shape assert ask(Q.lower_triangular(L)) assert ask(Q.upper_triangular(U)) def test_Cholesky(): LofCholesky(X) def test_QR(): Q_, R = qr(X) assert Q_.shape == R.shape == X.shape assert ask(Q.orthogonal(Q_)) assert ask(Q.upper_triangular(R)) def test_svd(): U, S, V = svd(X) assert U.shape == S.shape == V.shape == X.shape assert ask(Q.orthogonal(U)) assert ask(Q.orthogonal(V)) assert ask(Q.diagonal(S))