mirror of
https://gitcode.com/gh_mirrors/ope/OpenFace.git
synced 2025-12-30 13:02:30 +00:00
27 lines
661 B
Matlab
27 lines
661 B
Matlab
function [ SigmaInv] = CalcSigmaCCRFflat(alphas, betas, n, PrecalcB_flat)
|
|
%CALCSIGMAPRF Summary of this function goes here
|
|
% Detailed explanation goes here
|
|
% constructing the Sigma (that is laid out in an efficient way for
|
|
% symmertic matrices
|
|
|
|
A = sum(alphas) * eye(n);
|
|
|
|
% calculating the B from the paper
|
|
% using the precalculated lower triangular elements of B without beta
|
|
Btmp = PrecalcB_flat * betas;
|
|
|
|
% not faster
|
|
|
|
% now make it into a square symmetric matrix
|
|
B = zeros(n,n);
|
|
on = tril(true(n,n));
|
|
B(on) = Btmp;
|
|
B = B';
|
|
B(on) = Btmp;
|
|
|
|
% Combine A and B
|
|
SigmaInv = 2 * (A + B);
|
|
|
|
end
|
|
|