This commit is contained in:
Marc Pouget 2007-02-15 16:38:52 +00:00
parent 624c306fd3
commit f05e75b3f7
3 changed files with 34 additions and 13 deletions

View File

@ -1,13 +1,12 @@
To compile, you need support for lapack
Program blind_1pt
---------------------
takes as input a <inputPoints.txt> which is a xyz text file
it compute the fitting for this single entry and
it outputs results in the <output.txt> file and on the standard std::cout
Usage is : main <inputPoints.txt> <d_fitting>, <d_monge>"
Usage is : blind_1pt <inputPoints.txt> <d_fitting>, <d_monge>"
in_points are sampled on 0.1(x²+2y²)

View File

@ -1,3 +1,6 @@
// Copyright (c) 2007 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA.
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
@ -15,19 +18,35 @@
#ifndef CGAL_LAPACK_H
#define CGAL_LAPACK_H
#ifdef CGAL_USE_F2C
#define my_dgelss dgelss_
#else
#define my_dgelss dgelss
#endif
extern "C" {
int my_dgelss(int *m, int *n, int *nrhs,
double *a, int *lda, double *b, int *ldb, double *
s, double *rcond, int *rank, double *work, int *lwork,
int *info);
int dgelss(int *m, int *n, int *nrhs,
double *a, int *lda, double *b, int *ldb, double *
s, double *rcond, int *rank, double *work, int *lwork,
int *info);
int dgelss_(int *m, int *n, int *nrhs,
double *a, int *lda, double *b, int *ldb, double *
s, double *rcond, int *rank, double *work, int *lwork,
int *info);
}
namespace CGAL { namespace LAPACK {
inline
int dgelss(int *m, int *n, int *nrhs,
double *a, int *lda, double *b, int *ldb, double *
s, double *rcond, int *rank, double *work, int *lwork,
int *info)
{
#ifdef CGAL_USE_F2C
return dgelss_(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, info);
#else
return dgelss(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, info);
#endif
}
} }
namespace CGAL {
////////////////////////class Lapack_vector/////////////////////
@ -112,7 +131,7 @@ public:
FT rcond = -1;
my_dgelss(&m, &n, &nrhs, M.matrix(), &lda, B.vector(), &ldb, sing_values,
LAPACK::dgelss(&m, &n, &nrhs, M.matrix(), &lda, B.vector(), &ldb, sing_values,
&rcond, &rank, work, &lwork, &info);
assert(info==0);

View File

@ -1,3 +1,6 @@
// Copyright (c) 2007 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA.
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.