Subject: CGAL users discussion list
List archive
- From: mytien <>
- To:
- Subject: [cgal-discuss] Compile error: poisson_reconstruction_example.cpp
- Date: Wed, 9 Oct 2013 03:10:55 -0700 (PDT)
Hello again,
Today I tried to run the poisson_reconstruction_example.cpp, which failed
with following compilation error:
..\test\main.cpp:89:47: error: no matching function for call to
'CGAL::Poisson_reconstruction_function<CGAL::Epick>::compute_implicit_function()'
if ( ! function.compute_implicit_function() )
^
..\test\main.cpp:89:47: note: candidates are:
In file included from ..\test\main.cpp:33:0:
C:\Qt\Qt5.1.0\Tools\mingw48_32\include/CGAL/Poisson_reconstruction_function.h:366:8:
note: template<class SparseLinearAlgebraTraits_d, class Visitor> bool
CGAL::Poisson_reconstruction_function<Gt>::compute_implicit_function(SparseLinearAlgebraTraits_d,
Visitor, double, double) [with SparseLinearAlgebraTraits_d =
SparseLinearAlgebraTraits_d; Visitor = Visitor; Gt = CGAL::Epick]
bool compute_implicit_function(
^
C:\Qt\Qt5.1.0\Tools\mingw48_32\include/CGAL/Poisson_reconstruction_function.h:366:8:
note: template argument deduction/substitution failed:
..\test\main.cpp:89:47: note: candidate expects 4 arguments, 0 provided
if ( ! function.compute_implicit_function() )
^
In file included from ..\test\main.cpp:33:0:
C:\Qt\Qt5.1.0\Tools\mingw48_32\include/CGAL/Poisson_reconstruction_function.h:519:8:
note: template<class SparseLinearAlgebraTraits_d> bool
CGAL::Poisson_reconstruction_function<Gt>::compute_implicit_function(SparseLinearAlgebraTraits_d,
bool) [with SparseLinearAlgebraTraits_d = SparseLinearAlgebraTraits_d; Gt =
CGAL::Epick]
bool compute_implicit_function(SparseLinearAlgebraTraits_d solver, bool
smoother_hole_filling = false)
^
C:\Qt\Qt5.1.0\Tools\mingw48_32\include/CGAL/Poisson_reconstruction_function.h:519:8:
note: template argument deduction/substitution failed:
..\test\main.cpp:89:47: note: candidate expects 2 arguments, 0 provided
if ( ! function.compute_implicit_function() )
----------------------------------------
I use Windows7 64-bit with MinGW and Qt and use Eigen3.2.
Now, I saw that the same problem was reported over a year ago here:
http://cgal-discuss.949826.n4.nabble.com/Surface-reconstruction-points-3-macports-eigen-problem-td4655278.html
I tried the solutions desccribed:
- using Eigen3.1.0-alpha1
- replace the Eigen_solver_traits.h with the code listed below.
I still receive the same error.
Do you possibly know the solution by now?
Kind regards
My-Tien Nguyen
--------------------------------------------
// Copyright (c) 2012 INRIA Bordeaux Sud-Ouest (France), All rights
reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the
License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the
software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
// Author(s) : Gael Guennebaud
#ifndef CGAL_EIGEN_SOLVER_TRAITS_H
#define CGAL_EIGEN_SOLVER_TRAITS_H
#include <CGAL/basic.h> // include basic.h before testing #defines
#include <Eigen/Sparse>
#include <CGAL/Eigen_matrix.h>
#include <CGAL/Eigen_vector.h>
#include <boost/shared_ptr.hpp>
namespace CGAL {
namespace internal {
template <class EigenSolver,class FT>
struct Get_eigen_matrix{
typedef Eigen_sparse_matrix<FT> type;
};
template <class FT,class EigenMatrix>
struct Get_eigen_matrix< ::Eigen::ConjugateGradient<EigenMatrix>,FT>{
typedef Eigen_sparse_symmetric_matrix<FT> type;
};
template <class FT,class EigenMatrix>
struct Get_eigen_matrix< ::Eigen::SimplicialCholesky<EigenMatrix>,FT>{
typedef Eigen_sparse_symmetric_matrix<FT> type;
};
} //internal
/// The class Eigen_solver_traits
/// is a generic traits class for solving asymmetric or symmetric positive
definite (SPD)
/// sparse linear systems using one of the Eigen solvers.
/// The default solver is the iterative bi-congugate gradient stabilized
solver
/// Eigen::BiCGSTAB for double.
///
/// @heading Is Model for the Concepts: Model of the
SparseLinearAlgebraTraits_d concept.
template<class EigenSolverT =
Eigen::BiCGSTAB<Eigen_sparse_matrix<double>::EigenType> >
class Eigen_solver_traits
{
typedef typename EigenSolverT::Scalar Scalar;
// Public types
public:
typedef Scalar NT;
typedef typename internal::Get_eigen_matrix<EigenSolverT,NT>::type
Matrix;
typedef Eigen_vector<Scalar>
Vector;
// Public operations
public:
Eigen_solver_traits(): m_solver_sptr(new EigenSolverT)
{
}
EigenSolverT& solver() { return *m_solver_sptr; }
/// Solve the sparse linear system "A*X = B".
/// Return true on success. The solution is then (1/D) * X.
///
/// @commentheading Preconditions:
/// - A.row_dimension() == B.dimension().
/// - A.column_dimension() == X.dimension().
bool linear_solver(const Matrix& A, const Vector& B, Vector& X, NT& D)
{
D = 1; // Eigen does not support homogeneous coordinates
m_solver_sptr->compute(A.eigen_object());
if(m_solver_sptr->info() != Eigen::Success)
return false;
X = m_solver_sptr->solve(B);
return m_solver_sptr->info() == Eigen::Success;
}
protected:
boost::shared_ptr<EigenSolverT> m_solver_sptr;
};
} //namespace CGAL
#endif // CGAL_EIGEN_SOLVER_TRAITS_H
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Compile-error-poisson-reconstruction-example-cpp-tp4658164.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Compile error: poisson_reconstruction_example.cpp, mytien, 10/09/2013
- Re: [cgal-discuss] Compile error: poisson_reconstruction_example.cpp, Sebastien Loriot (GeometryFactory), 10/09/2013
- Re: [cgal-discuss] Compile error: poisson_reconstruction_example.cpp, mytien, 10/13/2013
- Re: [cgal-discuss] Compile error: poisson_reconstruction_example.cpp, Sebastien Loriot (GeometryFactory), 10/09/2013
Archive powered by MHonArc 2.6.18.