23template<
typename DerivedV,
typename DerivedF,
typename DerivedC>
25 const Eigen::PlainObjectBase<DerivedF> &
F,
26 Eigen::PlainObjectBase<DerivedC> &
C)
29 using namespace Eigen;
37 Matrix<typename DerivedC::Scalar, Dynamic, 3> l2;
40 Matrix<typename DerivedC::Scalar, Dynamic, 3>
l;
41 l = l2.array().sqrt();
44 Matrix<typename DerivedC::Scalar, Dynamic, 1> dblA;
49 for (
int i = 0;
i < m;
i++) {
50 C(
i, 0) = (l2(
i, 1) + l2(
i, 2) - l2(
i, 0)) / dblA(
i) / 4.0;
51 C(
i, 1) = (l2(
i, 2) + l2(
i, 0) - l2(
i, 1)) / dblA(
i) / 4.0;
52 C(
i, 2) = (l2(
i, 0) + l2(
i, 1) - l2(
i, 2)) / dblA(
i) / 4.0;
56template<
typename DerivedV,
typename DerivedF,
typename Scalar>
57inline void cotmatrix(
const Eigen::PlainObjectBase<DerivedV> &
V,
58 const Eigen::PlainObjectBase<DerivedF> &
F,
59 Eigen::SparseMatrix<Scalar> &
L)
61 using namespace Eigen;
64 L.resize(
V.rows(),
V.rows());
65 Matrix<int, Dynamic, 2> edges;
72 L.reserve(10 *
V.rows());
74 edges << 1, 2, 2, 0, 0, 1;
77 Matrix<Scalar, Dynamic, Dynamic>
C;
81 IJV.reserve(
F.rows() * edges.rows() * 4);
83 for (
int i = 0;
i <
F.rows();
i++) {
85 for (
int e = 0;
e < edges.rows();
e++) {
86 int source =
F(
i, edges(
e, 0));
87 int dest =
F(
i, edges(
e, 1));
94 L.setFromTriplets(IJV.begin(), IJV.end());
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
Eigen::Triplet< Scalar > Triplet
#define assert(assertion)
static void cotmatrix_entries(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedC > &C)
void cotmatrix(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, Eigen::SparseMatrix< Scalar > &L)
void doublearea(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DeriveddblA > &dblA)
void squared_edge_lengths(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedL > &L)
CCL_NAMESPACE_BEGIN struct Window V