%% SHREC 2019 track: 
%% Matching Humans with Different Connectivity
%
% This code provides an example of how to save the correspondence results
% for the submission to SHREC 2019 track: Matching Humans with Different 
% connectivity. Only files that comply this format will be accepted 
% for evaluation.
% Many thanks for your partecipation.
% Best regards
%
% Simone Melzi, Riccardo Marin, Emanuele Rodola and Umberto Castellani
% Verona, February 14th 2019.

%% an example pair (35_28)
% We consider the pair 35_28
% the shape 35 has 12500 vertices
% the shape 28 has 52565 vertices
% we are expecting a column vector of length 12500 that contains integer
% numbers greater than 1 and smaller than 52565.
idxs = randperm(52565,12500)';

% to generate the example.txt we use csvwrite.
dlmwrite('example.txt',idxs,'precision',9);

% Only txt files of this kind will be accepted for the evaluation.
% Each of the index is contained in a different line without any additional
% separation character.
% Compare example.txt to your submission file.

% To check your txt:
idxs2 = csvread('example.txt');

% If you load your txt file with the previous code you should obtain a
% vector idxs2 that is equal to idxs.
if ~(nnz(idxs ~= idxs2))
    disp('OK your txt file is adequate for submission to SHREC19 connettivity track!')
else
    disp('Please check your txt file it seems that something is wrong!')
end