decomposition

LU decomposition with partial pivoting Matlab

99封情书 提交于 2019-11-28 08:48:25
问题 I am trying to implement my own LU decomposition with partial pivoting. My code is below and apparently is working fine, but for some matrices it gives different results when comparing with the built-in [L, U, P] = lu(A) function in matlab Can anyone spot where is it wrong? function [L, U, P] = lu_decomposition_pivot(A) n = size(A,1); Ak = A; L = zeros(n); U = zeros(n); P = eye(n); for k = 1:n-1 for i = k+1:n [~,r] = max(abs(Ak(:,k))); Ak([k r],:) = Ak([r k],:); P([k r],:) = P([r k],:); L(i,k

BCNF decomposition algorithm explanation

半腔热情 提交于 2019-11-28 00:36:02
I looked in Decomposing a relation into BCNF answers and tried it on my homework, but i don't get the correct answers, so i ask for help in BCNF decomposition Consider R=(ABCDEG) & F={BG->CD, G->A, CD->AE, C->AG, A->D} . I start pick A->D . Now i got S=(AD), R'=(ABCEG). I pick G->A . Now i got S=(AD,AG) R'=(BCEG) . I pick C->G . Now i think i need to get S=(AD,AG,CG) and R'=(BCE) , But the answer in the end is (AD,AG,CGE,BC) .what went wrong? or perhaps, a better algorithm? To convert a relation R and a set of functional dependencies( FD's ) into 3NF you can use Bernstein's Synthesis . To

BCNF decomposition algorithm explanation

做~自己de王妃 提交于 2019-11-26 21:30:35
问题 I looked in Decomposing a relation into BCNF answers and tried it on my homework, but i don't get the correct answers, so i ask for help in BCNF decomposition Consider R=(ABCDEG) & F={BG->CD, G->A, CD->AE, C->AG, A->D} . I start pick A->D . Now i got S=(AD), R'=(ABCEG). I pick G->A . Now i got S=(AD,AG) R'=(BCEG) . I pick C->G . Now i think i need to get S=(AD,AG,CG) and R'=(BCE) , But the answer in the end is (AD,AG,CGE,BC) .what went wrong? or perhaps, a better algorithm? 回答1: To convert a