Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/ruqihuang/AdjointFmaps
09 October 2023, 23:06:25 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
Revision d41efaa1636fb8cc0da8f09d89f4a1cae0172320 authored by ruqihuang on 24 August 2017, 07:39:27 UTC, committed by ruqihuang on 24 August 2017, 07:39:27 UTC
Update readme
claim that the package is only pre-compiled for Mac
1 parent 702a390
  • Files
  • Changes
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • d41efaa1636fb8cc0da8f09d89f4a1cae0172320
    No releases to show
  • cece858
  • /
  • Change_of_basis_F8.m
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
  • snapshot
origin badgerevision badge
swh:1:rev:d41efaa1636fb8cc0da8f09d89f4a1cae0172320
origin badgedirectory badge Iframe embedding
swh:1:dir:cece85816db457bbb43ee987ef2ffe1dc0d156dc
origin badgecontent badge Iframe embedding
swh:1:cnt:a6a345b390f31254b7b53c6f1d05f2aced80d08f
origin badgesnapshot badge
swh:1:snp:f8058bb26ca7dfa4e9342cbbd0758552e7f5f26e
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: d41efaa1636fb8cc0da8f09d89f4a1cae0172320 authored by ruqihuang on 24 August 2017, 07:39:27 UTC
Update readme
Tip revision: d41efaa
Change_of_basis_F8.m
% Readme: we first select randomly 25 pairs of deformed spheres, and then
% recover the p2p maps from the ground-truth functional maps. A fixed set
% of random pairs and pre-computed result from the paper [RMC15] are loaded
% in line 19~20. (Unfortunately we lost the random pairs
% used in producing the result in the paper) 

clear; close all; clc; 
addpath(genpath('data')); 
addpath(genpath('external')); 
addpath(genpath('utils')); 

% %% generate random pairs of deformed spheres. 
% ra = randi(64, 50, 2); 
% ra = unique(ra, 'rows'); 
% idx = find(ra(:, 1) - ra(:, 2) ~= 0); 
% ra = ra(idx, :); 
% t = randperm(33); 
% ra = ra(t(1:25), :); 

%% Pre-load random pairs and results from [RMC15]
load rand_sph.mat;
load cpd_results.mat; 

%% Recovery
E1 = zeros(1922, 25); 
E2 = E1; 
E3 = E1; 
for i = 1:25
    test_shape1 = sprintf('deform_sph_%d.off', ra(i, 1)); 
    test_shape2 = sprintf('deform_sph_%d.off', ra(i, 2)); 

    S1 = read_off_shape(test_shape1);
    S2 = read_off_shape(test_shape2);


    % Number of basis functions
    nk = 60;
    % dimensionality of the functional map (nk x nk2)
    nk2 = 20;

    % Compute the LB eigenbasis
    S1 = compute_laplacian_basis(S1, nk);
    S2 = compute_laplacian_basis(S2, nk);


    % Compute initial (slightly perturbed identity) map
    P2 = 1:length(S1.evecs); 
    P1 = 1:length(S2.evecs); 
    C = S2.evecs'*S2.A*S1.evecs(P1, :); 


    C12 = C;
    e = ones(length(S2.evecs), 1); e = S2.evecs'*S2.A*e; 
    k1_const = S1.evecs*C12'*e;
    K = S1.evecs'*S1.A*diag(k1_const)*S1.evecs;
    X12 = C12/K;
    cvx_begin quiet
        variable H(nk, nk) semidefinite
        minimize( norm(X12 - H*C12, 'fro'))        
    cvx_end


    [e,v] = eig(diag(S2.evals),H);
    e = e*diag(1./sqrt(diag(e'*H*e)));
    [v, order] = sort(diag(v));
    e = e(:,order);

    % Compute the functional map with respect to this new basis.
    C2 = (S2.evecs*e)\S1.evecs(P1, 1:nk);
    C2r = C2(1:nk,1:nk2);


    % Covert to p2p map
    [~, matches1] = icp_refine(S1.evecs, S2.evecs, C, 0); 
    [~, matches2] = icp_refine(S1.evecs,(S2.evecs*e),C2r,0);

    error1 = eval_geodesic_error(S1, matches1, P1)/sqrt(6); 
    error2 = eval_geodesic_error(S1, M(:, i), P1)/sqrt(6); 
    error3 = eval_geodesic_error(S1, matches2, P1)/sqrt(6);

    E1(:, i) = error1; 
    E2(:, i) = error2; 
    E3(:, i) = error3; 

    fprintf(sprintf('the %d-th pair done.\n', i)); 
end

%% Plot the results. 
nr = length(reshape(E1, [], 1));
figure; plot(sort(reshape(E1, [], 1))*100, linspace(0, 1, nr)*100, 'k', 'LineWidth', 3); 
hold on; plot(sort(reshape(E2, [], 1))*100, linspace(0, 1, nr)*100, 'b', 'LineWidth', 3); 
hold on; plot(sort(reshape(E3, [], 1))*100, linspace(0, 1, nr)*100, 'r', 'LineWidth', 3); 
ylabel('% of Correspondences', 'FontSize',25);
xlabel('% of Geodesic Error', 'FontSize',25);
ylim([80, 100]); 
xlim([0, 8]); 
leg = legend('NN-search', '[RMC15]', 'Our scheme' ,'Location', 'southeast'); 
set(leg, 'FontSize', 25);
% print('sphere_collection', '-r400', '-dpng'); 
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top