% Regression test function (black blox) for FreeMat v3.6
% This function is autogenerated by helpgen.
function bbtest_success = bbtest_eig
  bbtest_success = 1;
NumErrors = 0;
try
  A = diag([1.02f,3.04f,1.53f])

catch
  NumErrors = NumErrors + 1;
end
try
  eig(A)

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
NumErrors = 0;
try
  A = [1.0f,3.0f,4.0f;0,2.0f,6.7f;0.0f,0.0f,1.0f]

catch
  NumErrors = NumErrors + 1;
end
try
  eig(A)

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
NumErrors = 0;
try
  A = float(randn(2))

catch
  NumErrors = NumErrors + 1;
end
try
  [V,D] = eig(A)

catch
  NumErrors = NumErrors + 1;
end
try
  A*V - V*D

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
NumErrors = 0;
try
  B = [3,-2,-.9,2*eps;-2,4,1,-eps;-eps/4,eps/2,-1,0;-.5,-.5,.1,1]

catch
  NumErrors = NumErrors + 1;
end
try
  [VB,DB] = eig(B)

catch
  NumErrors = NumErrors + 1;
end
try
  B*VB - VB*DB

catch
  NumErrors = NumErrors + 1;
end
try
  [VN,DN] = eig(B,'nobalance')

catch
  NumErrors = NumErrors + 1;
end
try
  B*VN - VN*DN

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
