SHARE
TWEET

function_greedy_checks_matlab

manger32 Aug 14th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function [ bool ] = greedy_check( Protho_H, p )
  2. %GREEDY_SELECT Algorithm determining cycle-regarding equations for Protograph
  3. bool = true;
  4. a = Protho_H(2,:);
  5. if size(a, 2) == 2
  6.     if (a(1) == a(2))
  7.         bool = false;
  8.     end
  9. elseif size(a, 2) == 3
  10.     if mod((2*a(1)-a(2)-a(3)), p) == 0
  11.         bool = false;
  12.     elseif mod((2*a(2)-a(1)-a(3)), p) == 0
  13.         bool = false;
  14.     elseif mod((2*a(3)-a(1)-a(2)), p) == 0
  15.         bool = false;
  16.     end
  17. else
  18.     if mod(2*(a(1)+a(3)), p) == mod(2*(a(2)+a(4)), p)
  19.         bool = false;
  20.     elseif mod(2*(a(1)+a(2)), p) == mod(2*(a(3)+a(4)), p)
  21.         bool = false;
  22.     elseif mod(2*(a(1)+a(4)), p) == mod(2*(a(2)+a(3)), p)
  23.         bool = false;
  24.     end
  25. end
  26. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top