Merge changes from 'releases/CGAL-4.8-branch'

- Merge pull request #1023 from mglisse/NewKernel_d-solve_check-glisse
- Merge pull request #1025 from CGAL/Stream_support-Fix_io.h-lrineau
This commit is contained in:
Laurent Rineau 2016-04-22 15:41:59 +02:00
commit 9ea630eeb1
3 changed files with 12 additions and 3 deletions

View File

@ -135,7 +135,12 @@ template<class NT_,class Dim_,class Max_dim_=Dim_> struct LA_eigen {
// m*a==b
template<class DV, class DM, class V>
static bool solve(DV&a, DM const&m, V const& b){
static void solve(DV&a, DM const&m, V const& b){
//a = m.colPivHouseholderQr().solve(b);
a = m.fullPivLu().solve(b);
}
template<class DV, class DM, class V>
static bool solve_and_check(DV&a, DM const&m, V const& b){
//a = m.colPivHouseholderQr().solve(b);
a = m.fullPivLu().solve(b);
return b.isApprox(m*a);

View File

@ -425,7 +425,11 @@ template<class R_> struct Contained_in_simplex : private Store_kernel<R_> {
}
m(d,i)=1;
}
if (!LA::solve(a,CGAL_MOVE(m),CGAL_MOVE(b))) return false;
// If the simplex has full dimension, there must be a solution, only the signs need to be checked.
if (n == d+1)
LA::solve(a,CGAL_MOVE(m),CGAL_MOVE(b));
else if (!LA::solve_and_check(a,CGAL_MOVE(m),CGAL_MOVE(b)))
return false;
for(int i=0;i<n;++i){
if (a[i]<0) return false;
}
@ -683,7 +687,6 @@ template <class R_> struct Construct_circumcenter : Store_kernel<R_> {
typedef typename LAd::Vector Vec;
typename Get_functor<R_, Scalar_product_tag>::type sp(this->kernel());
int k=static_cast<int>(std::distance(f,e));
int d=pd(p0);
Matrix m(k,k);
Vec b(k);
Vec l(k);

View File

@ -35,6 +35,7 @@
#include <CGAL/tags.h>
#include <CGAL/IO/io_tags.h>
#include <CGAL/IO/Color.h>
#include <CGAL/assertions.h>
namespace CGAL {