Efficient calculation of Laplacian matrices

Source: Internet
Author: User

Directly on the code, you can call directly:

function L1 =Cp_laplacian (M)%untitled Summary of Thisfunction goes here%detailed explanation goes here%Number of vertices (size of matrix) Nverts= Size (M.vertices,1);%assume manifold and faces oriented uniformlyedges= [M.faces (:, [1,2]); M.faces (:, [2,3]); M.faces (:, [3,1])];% extract vertices fromMATRIXV1IDXS= Edges (:,1); V2idxs= Edges (:,2); V1s=m.vertices (V1idxs,:); V2s=m.vertices (V2idxs,:);%Compute edge lengths and Weightseps= 1e-8; Edgel= sqrt (sum ((v1s-v2s). ^2,2)); Edgew=1./(EPS +Edgel);%Construct sparse Matrixnnzeros= Size (Edges,1) /2; L1=sparse (V1IDXS, V2IDXS, Edgew, Nverts, nverts);% compute diagonal by summing column-major (faster) D=-full (sum (L1,1) )';% Insert Dinch 0-Diagonal of L1l1= Spdiags (D,0, L1); end

Efficient calculation of Laplacian matrices

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.