-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_projection_func_linear.m
43 lines (25 loc) · 1.04 KB
/
create_projection_func_linear.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
% Code implementing the paper "Injective and Bounded Mappings in 3D".
% Disclaimer: The code is provided as-is and without any guarantees. Please contact the author to report any bugs.
% Written by Noam Aigerman, http://www.wisdom.weizmann.ac.il/~noamaig/
function [L] = create_projection_func_linear(OPTIONS,faces)
%create the linaer part of the last-diff functional
%see create_ineq_matri for detailed documentation
cur_pos=1;
cur_y=1;
[dims,vnums]=meshgrid(1:OPTIONS.PROBLEM.TD,1:OPTIONS.PROBLEM.NODES_IN_PRIMITIVE);
dims=dims(:)';
vnums=vnums(:)';
L=zeros(OPTIONS.PROBLEM.SOL_LENGTH,1);
for face_ind=1:length(faces)
face=faces{face_ind};
D=face.target_matrix;
for i=1:OPTIONS.PROBLEM.SD
inds=(face.inds(vnums)-1)*OPTIONS.PROBLEM.TD+dims;
coef=(face.tframe(dims,i).*face.left_coef_mat(vnums,i))';
new_pos=cur_pos+length(inds)-1;
cur_pos=new_pos+1;
cur_y=cur_y+1;
L(inds)= L(inds)-coef'*face.volume*D(i,i);
end
end
end