Blender V4.3
cotmatrix.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2014 Alec Jacobson
2 * 2023 Blender Authors
3 *
4 * SPDX-License-Identifier: MPL-2.0 */
5
10#pragma once
11
12#include <Eigen/Dense>
13#include <Eigen/Sparse>
14
15namespace slim {
16
17/* Constructs the cotangent stiffness matrix (discrete laplacian) for a given
18 * mesh (V,F).
19 *
20 * Templates:
21 * DerivedV derived type of eigen matrix for V (e.g. derived from
22 * MatrixXd)
23 * DerivedF derived type of eigen matrix for F (e.g. derived from
24 * MatrixXi)
25 * Scalar scalar type for eigen sparse matrix (e.g. double)
26 * Inputs:
27 * V #V by dim list of mesh vertex positions
28 * F #F by simplex_size list of mesh faces (must be triangles)
29 * Outputs:
30 * L #V by #V cotangent matrix, each row i corresponding to V(i,:)
31 *
32 * Note: This Laplacian uses the convention that diagonal entries are
33 * **minus** the sum of off-diagonal entries. The diagonal entries are
34 * therefore in general negative and the matrix is **negative** semi-definite
35 * (immediately, -L is **positive** semi-definite)
36 */
37template<typename DerivedV, typename DerivedF, typename Scalar>
38inline void cotmatrix(const Eigen::PlainObjectBase<DerivedV> &V,
39 const Eigen::PlainObjectBase<DerivedF> &F,
40 Eigen::SparseMatrix<Scalar> &L);
41
42} // namespace slim
43
44#include "cotmatrix.cpp"
#define L
void cotmatrix(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, Eigen::SparseMatrix< Scalar > &L)
Definition cotmatrix.cpp:57
CCL_NAMESPACE_BEGIN struct Window V