|
|
@@ -77,8 +77,8 @@ template <
|
|
|
typename Derivedbc,
|
|
|
typename DerivedW>
|
|
|
IGL_INLINE bool igl::harmonic(
|
|
|
- const Eigen::SparseMatrix<DerivedL> & L,
|
|
|
- const Eigen::SparseMatrix<DerivedM> & M,
|
|
|
+ const Eigen::SparseCompressedBase<DerivedL> & L,
|
|
|
+ const Eigen::SparseCompressedBase<DerivedM> & M,
|
|
|
const Eigen::MatrixBase<Derivedb> & b,
|
|
|
const Eigen::MatrixBase<Derivedbc> & bc,
|
|
|
const int k,
|
|
|
@@ -89,15 +89,16 @@ IGL_INLINE bool igl::harmonic(
|
|
|
assert((k==1 || n == M.cols() ) && "M must be same size as L");
|
|
|
assert((k==1 || n == M.rows() ) && "M must be square");
|
|
|
assert((k==1 || igl::isdiag(M)) && "Mass matrix should be diagonal");
|
|
|
+ typedef typename DerivedL::Scalar Scalar;
|
|
|
|
|
|
- Eigen::SparseMatrix<DerivedL> Q;
|
|
|
+ Eigen::SparseMatrix<Scalar> Q;
|
|
|
igl::harmonic(L,M,k,Q);
|
|
|
|
|
|
- typedef DerivedL Scalar;
|
|
|
+
|
|
|
min_quad_with_fixed_data<Scalar> data;
|
|
|
min_quad_with_fixed_precompute(Q,b,Eigen::SparseMatrix<Scalar>(),true,data);
|
|
|
W.resize(n,bc.cols());
|
|
|
- typedef Eigen::Matrix<Scalar,Eigen::Dynamic,1> VectorXS;
|
|
|
+ typedef Eigen::Matrix<typename Derivedbc::Scalar,Eigen::Dynamic,1> VectorXS;
|
|
|
const VectorXS B = VectorXS::Zero(n,1);
|
|
|
for(int w = 0;w<bc.cols();w++)
|
|
|
{
|
|
|
@@ -117,17 +118,17 @@ template <
|
|
|
typename DerivedM,
|
|
|
typename DerivedQ>
|
|
|
IGL_INLINE void igl::harmonic(
|
|
|
- const Eigen::SparseMatrix<DerivedL> & L,
|
|
|
- const Eigen::SparseMatrix<DerivedM> & M,
|
|
|
+ const Eigen::SparseCompressedBase<DerivedL> & L,
|
|
|
+ const Eigen::SparseCompressedBase<DerivedM> & M,
|
|
|
const int k,
|
|
|
- Eigen::SparseMatrix<DerivedQ> & Q)
|
|
|
+ DerivedQ & Q)
|
|
|
{
|
|
|
assert(L.rows() == L.cols()&&"L should be square");
|
|
|
Q = -L;
|
|
|
if(k == 1) return;
|
|
|
assert(L.rows() == M.rows()&&"L should match M's dimensions");
|
|
|
assert(M.rows() == M.cols()&&"M should be square");
|
|
|
- Eigen::SparseMatrix<DerivedM> Mi;
|
|
|
+ Eigen::SparseMatrix<typename DerivedM::Scalar> Mi;
|
|
|
invert_diag(M,Mi);
|
|
|
// This is **not** robust for k>2. See KKT system in [Jacobson et al. 2010]
|
|
|
// of the kharmonic function in gptoolbox
|
|
|
@@ -146,9 +147,9 @@ IGL_INLINE void igl::harmonic(
|
|
|
const Eigen::MatrixBase<DerivedV> & V,
|
|
|
const Eigen::MatrixBase<DerivedF> & F,
|
|
|
const int k,
|
|
|
- Eigen::SparseMatrix<DerivedQ> & Q)
|
|
|
+ DerivedQ & Q)
|
|
|
{
|
|
|
- Eigen::SparseMatrix<DerivedQ> L,M;
|
|
|
+ DerivedQ L,M;
|
|
|
cotmatrix(V,F,L);
|
|
|
if(k>1)
|
|
|
{
|
|
|
@@ -166,7 +167,7 @@ template bool igl::harmonic<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Mat
|
|
|
// generated by autoexplicit.sh
|
|
|
template bool igl::harmonic<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
|
|
|
// generated by autoexplicit.sh
|
|
|
-template void igl::harmonic<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double>(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, int, Eigen::SparseMatrix<double, 0, int>&);
|
|
|
+template void igl::harmonic<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::SparseMatrix<double, 0, int> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, int, Eigen::SparseMatrix<double, 0, int>&);
|
|
|
// generated by autoexplicit.sh
|
|
|
template bool igl::harmonic<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
|
|
|
// generated by autoexplicit.sh
|