mirror of https://github.com/CGAL/cgal
Missing std::
This commit is contained in:
parent
62b6bf5079
commit
3d1ee0cf13
|
|
@ -35,6 +35,7 @@
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <cstring>
|
||||||
#if defined (__BORLANDC__)
|
#if defined (__BORLANDC__)
|
||||||
#include <mem.h>
|
#include <mem.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -119,19 +120,19 @@ void Real::constructFromString(const char *str, const extLong& prec )
|
||||||
// Moreover, the value of prec is ignored (basically
|
// Moreover, the value of prec is ignored (basically
|
||||||
// assumed to be infinity).
|
// assumed to be infinity).
|
||||||
|
|
||||||
if (strchr(str, '/') != NULL) { // this is a rational number
|
if (std::strchr(str, '/') != NULL) { // this is a rational number
|
||||||
rep = new RealBigRat(BigRat(str));
|
rep = new RealBigRat(BigRat(str));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *e = strchr(str, 'e');
|
const char *e = std::strchr(str, 'e');
|
||||||
int dot = 0;
|
int dot = 0;
|
||||||
long e10 = 0;
|
long e10 = 0;
|
||||||
if (e != NULL)
|
if (e != NULL)
|
||||||
e10 = atol(e+1); // e10 is decimal precision of the input string
|
e10 = std::atol(e+1); // e10 is decimal precision of the input string
|
||||||
// i.e., input is A/10^{e10}.
|
// i.e., input is A/10^{e10}.
|
||||||
else {
|
else {
|
||||||
e = str + strlen(str);
|
e = str + std::strlen(str);
|
||||||
#ifdef CORE_DEBUG
|
#ifdef CORE_DEBUG
|
||||||
assert(*e == '\0');
|
assert(*e == '\0');
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -225,7 +226,7 @@ std::istream& operator >>(std::istream& i, Real& x) {
|
||||||
if (p - str == size) {
|
if (p - str == size) {
|
||||||
char *t = str;
|
char *t = str;
|
||||||
str = new char[size*2];
|
str = new char[size*2];
|
||||||
memcpy(str, t, size);
|
std::memcpy(str, t, size);
|
||||||
delete [] t;
|
delete [] t;
|
||||||
p = str + size;
|
p = str + size;
|
||||||
size *= 2;
|
size *= 2;
|
||||||
|
|
@ -251,7 +252,7 @@ std::istream& operator >>(std::istream& i, Real& x) {
|
||||||
int len = p - str;
|
int len = p - str;
|
||||||
char *t = str;
|
char *t = str;
|
||||||
str = new char[len + 1];
|
str = new char[len + 1];
|
||||||
memcpy(str, t, len);
|
std::memcpy(str, t, len);
|
||||||
delete [] t;
|
delete [] t;
|
||||||
p = str + len;
|
p = str + len;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ extLong& extLong::operator*= (const extLong& y) {
|
||||||
} else { // flag == 0 and y.flag == 0
|
} else { // flag == 0 and y.flag == 0
|
||||||
double d = double(val) * double(y.val);
|
double d = double(val) * double(y.val);
|
||||||
long p = val * y.val;
|
long p = val * y.val;
|
||||||
if (fabs(d - p) <= fabs(d) * relEps) {
|
if (std::fabs(d - p) <= std::fabs(d) * relEps) {
|
||||||
val = p;
|
val = p;
|
||||||
flag = 0;
|
flag = 0;
|
||||||
} else if (d > EXTLONG_MAX) {
|
} else if (d > EXTLONG_MAX) {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
//assert(std::numeric_limits<double>::has_infinity());
|
//assert(std::numeric_limits<double>::has_infinity());
|
||||||
if ( argc > 1 ) {
|
if ( argc > 1 ) {
|
||||||
int is_verbose = atoi(argv[1]);
|
int is_verbose = std::atoi(argv[1]);
|
||||||
if ( is_verbose == 0 ) {
|
if ( is_verbose == 0 ) {
|
||||||
verbose = false;
|
verbose = false;
|
||||||
} else verbose = true;
|
} else verbose = true;
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
// Making sure test doesn't fail if LEDA is not installed
|
// Making sure test doesn't fail if LEDA is not installed
|
||||||
#if ! defined(CGAL_USE_LEDA) && \
|
#if ! defined(CGAL_USE_LEDA) && \
|
||||||
|
|
@ -949,7 +950,7 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
if (argc < 1 || argc > 2) {
|
if (argc < 1 || argc > 2) {
|
||||||
std::cout << "usage: test data_file" << std::endl;
|
std::cout << "usage: test data_file" << std::endl;
|
||||||
exit(1);
|
std::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
test.start(argv[1]);
|
test.start(argv[1]);
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#ifdef CGAL_USE_QT
|
#ifdef CGAL_USE_QT
|
||||||
|
|
||||||
#include <CGAL/IO/Qt_widget_OpenGL.h>
|
#include <CGAL/IO/Qt_widget_OpenGL.h>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
@ -88,7 +89,7 @@ void Qt_widget_OpenGL::mouseMoveEvent(QMouseEvent* event) {
|
||||||
int y = event->y();
|
int y = event->y();
|
||||||
switch ( interaction) {
|
switch ( interaction) {
|
||||||
case SCALE:
|
case SCALE:
|
||||||
s *= exp( (x - mouse_x + mouse_y -y) * factor_s );
|
s *= std::exp( (x - mouse_x + mouse_y -y) * factor_s );
|
||||||
break;
|
break;
|
||||||
case ROTATE: {
|
case ROTATE: {
|
||||||
double old_x = 1.2 * (mouse_x - window_width/2) / window_radius;
|
double old_x = 1.2 * (mouse_x - window_width/2) / window_radius;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
#include <CGAL/MP_Float.h>
|
#include <CGAL/MP_Float.h>
|
||||||
#include <CGAL/Snap_rounding_traits_2.h>
|
#include <CGAL/Snap_rounding_traits_2.h>
|
||||||
#include <CGAL/Snap_rounding_2.h>
|
#include <CGAL/Snap_rounding_2.h>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
typedef CGAL::Quotient<CGAL::MP_Float> Number_Type;
|
typedef CGAL::Quotient<CGAL::MP_Float> Number_Type;
|
||||||
typedef CGAL::Cartesian<Number_Type> Rep;
|
typedef CGAL::Cartesian<Number_Type> Rep;
|
||||||
|
|
@ -18,14 +19,14 @@ void read_data(int argc,char *argv[],Number_Type &prec,std::list<Segment_2> &seg
|
||||||
|
|
||||||
if(argc != 2) {
|
if(argc != 2) {
|
||||||
std::cerr << "syntex: test <input file name>\n";
|
std::cerr << "syntex: test <input file name>\n";
|
||||||
exit(1);
|
std::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ifstream is(argv[1]);
|
std::ifstream is(argv[1]);
|
||||||
|
|
||||||
if(is.bad()) {
|
if(is.bad()) {
|
||||||
std::cerr << "Bad input file : " << argv[1] << std::endl;
|
std::cerr << "Bad input file : " << argv[1] << std::endl;
|
||||||
exit(1);
|
std::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
is >> number_of_segments;
|
is >> number_of_segments;
|
||||||
|
|
@ -34,7 +35,7 @@ void read_data(int argc,char *argv[],Number_Type &prec,std::list<Segment_2> &seg
|
||||||
|
|
||||||
if(number_of_segments < 1) {
|
if(number_of_segments < 1) {
|
||||||
std::cerr << "Bad input file(number of segments)" << argv[1] << std::endl;
|
std::cerr << "Bad input file(number of segments)" << argv[1] << std::endl;
|
||||||
exit(1);
|
std::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i = 0;i < number_of_segments;++i) {
|
for(i = 0;i < number_of_segments;++i) {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
#include <CGAL/Orthogonal_k_neighbor_search.h>
|
#include <CGAL/Orthogonal_k_neighbor_search.h>
|
||||||
#include <CGAL/Search_traits_2.h>
|
#include <CGAL/Search_traits_2.h>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
|
||||||
typedef CGAL::Simple_cartesian<double> K;
|
typedef CGAL::Simple_cartesian<double> K;
|
||||||
|
|
@ -30,7 +31,7 @@ int main() {
|
||||||
// report the N nearest neighbors and their distance
|
// report the N nearest neighbors and their distance
|
||||||
// This should sort all N points by increasing distance from origin
|
// This should sort all N points by increasing distance from origin
|
||||||
for(Neighbor_search::iterator it = search.begin(); it != search.end(); ++it){
|
for(Neighbor_search::iterator it = search.begin(); it != search.end(); ++it){
|
||||||
std::cout << it->first << " "<< sqrt(it->second) << std::endl;
|
std::cout << it->first << " "<< std::sqrt(it->second) << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include <CGAL/point_generators_2.h>
|
#include <CGAL/point_generators_2.h>
|
||||||
#include <CGAL/Search_traits_2.h>
|
#include <CGAL/Search_traits_2.h>
|
||||||
#include <CGAL/Orthogonal_k_neighbor_search.h>
|
#include <CGAL/Orthogonal_k_neighbor_search.h>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
typedef CGAL::Simple_cartesian<double> R;
|
typedef CGAL::Simple_cartesian<double> R;
|
||||||
typedef R::Point_2 Point_d;
|
typedef R::Point_2 Point_d;
|
||||||
|
|
@ -34,7 +35,7 @@ int main() {
|
||||||
// report the N nearest neighbors and their distance
|
// report the N nearest neighbors and their distance
|
||||||
// This should sort all N points by increasing distance from origin
|
// This should sort all N points by increasing distance from origin
|
||||||
for(Neighbor_search::iterator it = search.begin(); it != search.end(); ++it){
|
for(Neighbor_search::iterator it = search.begin(); it != search.end(); ++it){
|
||||||
std::cout << it->first << " "<< sqrt(it->second) << std::endl;
|
std::cout << it->first << " "<< std::sqrt(it->second) << std::endl;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,13 +102,13 @@ namespace CGAL {
|
||||||
pit = construct_it(p);
|
pit = construct_it(p);
|
||||||
if (power == FT(0)) {
|
if (power == FT(0)) {
|
||||||
for (unsigned int i = 0; qit != qe; ++qit, ++i)
|
for (unsigned int i = 0; qit != qe; ++qit, ++i)
|
||||||
if (the_weights[i] * fabs((*qit) - (*pit)) > distance)
|
if (the_weights[i] * std::fabs((*qit) - (*pit)) > distance)
|
||||||
distance = the_weights[i] * fabs((*qit)-(*pit));
|
distance = the_weights[i] * std::fabs((*qit)-(*pit));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for (unsigned int i = 0; qit != qe; ++qit, ++i)
|
for (unsigned int i = 0; qit != qe; ++qit, ++i)
|
||||||
distance +=
|
distance +=
|
||||||
the_weights[i] * pow(fabs((*qit)-(*pit)),power);
|
the_weights[i] * std::pow(std::fabs((*qit)-(*pit)),power);
|
||||||
return distance;
|
return distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -139,10 +139,10 @@ namespace CGAL {
|
||||||
for (unsigned int i = 0; qit != qe; ++qit, ++i) {
|
for (unsigned int i = 0; qit != qe; ++qit, ++i) {
|
||||||
if ((*qit) < r.min_coord(i))
|
if ((*qit) < r.min_coord(i))
|
||||||
distance += the_weights[i] *
|
distance += the_weights[i] *
|
||||||
pow(r.min_coord(i)-(*qit),power);
|
std::pow(r.min_coord(i)-(*qit),power);
|
||||||
if ((*qit) > r.max_coord(i))
|
if ((*qit) > r.max_coord(i))
|
||||||
distance += the_weights[i] *
|
distance += the_weights[i] *
|
||||||
pow((*qit)-r.max_coord(i),power);
|
std::pow((*qit)-r.max_coord(i),power);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return distance;
|
return distance;
|
||||||
|
|
@ -175,9 +175,9 @@ namespace CGAL {
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; qit != qe; ++qit, ++i) {
|
for (unsigned int i = 0; qit != qe; ++qit, ++i) {
|
||||||
if ((*qit) <= (r.min_coord(i)+r.max_coord(i))/FT(2.0))
|
if ((*qit) <= (r.min_coord(i)+r.max_coord(i))/FT(2.0))
|
||||||
distance += the_weights[i] * pow(r.max_coord(i)-(*qit),power);
|
distance += the_weights[i] * std::pow(r.max_coord(i)-(*qit),power);
|
||||||
else
|
else
|
||||||
distance += the_weights[i] * pow((*qit)-r.min_coord(i),power);
|
distance += the_weights[i] * std::pow((*qit)-r.min_coord(i),power);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return distance;
|
return distance;
|
||||||
|
|
@ -191,16 +191,16 @@ namespace CGAL {
|
||||||
FT new_dist;
|
FT new_dist;
|
||||||
if (power == FT(0))
|
if (power == FT(0))
|
||||||
{
|
{
|
||||||
if (the_weights[cutting_dimension]*fabs(new_off)
|
if (the_weights[cutting_dimension]*std::fabs(new_off)
|
||||||
> dist)
|
> dist)
|
||||||
new_dist=
|
new_dist=
|
||||||
the_weights[cutting_dimension]*fabs(new_off);
|
the_weights[cutting_dimension]*std::fabs(new_off);
|
||||||
else new_dist=dist;
|
else new_dist=dist;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
new_dist = dist + the_weights[cutting_dimension] *
|
new_dist = dist + the_weights[cutting_dimension] *
|
||||||
(pow(fabs(new_off),power)-pow(fabs(old_off),power));
|
(std::pow(std::fabs(new_off),power)-std::pow(std::fabs(old_off),power));
|
||||||
}
|
}
|
||||||
return new_dist;
|
return new_dist;
|
||||||
}
|
}
|
||||||
|
|
@ -210,7 +210,7 @@ namespace CGAL {
|
||||||
transformed_distance(FT d) const
|
transformed_distance(FT d) const
|
||||||
{
|
{
|
||||||
if (power <= FT(0)) return d;
|
if (power <= FT(0)) return d;
|
||||||
else return pow(d,power);
|
else return std::pow(d,power);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -219,7 +219,7 @@ namespace CGAL {
|
||||||
inverse_of_transformed_distance(FT d) const
|
inverse_of_transformed_distance(FT d) const
|
||||||
{
|
{
|
||||||
if (power <= FT(0)) return d;
|
if (power <= FT(0)) return d;
|
||||||
else return pow(d,1/power);
|
else return std::pow(d,1/power);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
#include <CGAL/Cartesian.h>
|
#include <CGAL/Cartesian.h>
|
||||||
#include <CGAL/Filtered_kernel.h>
|
#include <CGAL/Filtered_kernel.h>
|
||||||
|
|
@ -25,9 +26,9 @@ int main()
|
||||||
if (i!=11 && i!=12 && i!=17 && i!=18 && i!=20 && i!=21)
|
if (i!=11 && i!=12 && i!=17 && i!=18 && i!=20 && i!=21)
|
||||||
{
|
{
|
||||||
char name[80];
|
char name[80];
|
||||||
sprintf(name, "data/%d.vec.cin", i);
|
std::sprintf(name, "data/%d.vec.cin", i);
|
||||||
char namer[80];
|
char namer[80];
|
||||||
sprintf(namer, "data/%d.stl", i);
|
std::sprintf(namer, "data/%d.stl", i);
|
||||||
std::ifstream infile(name, std::ios::in);
|
std::ifstream infile(name, std::ios::in);
|
||||||
double iXSize, iYSize;
|
double iXSize, iYSize;
|
||||||
unsigned int x_samples, y_samples;
|
unsigned int x_samples, y_samples;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <cstdlib>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#include <CGAL/kdtree_d.h>
|
#include <CGAL/kdtree_d.h>
|
||||||
|
|
@ -35,7 +36,7 @@ int main()
|
||||||
CGAL::Kdtree_d<kd_interface> tree(2);
|
CGAL::Kdtree_d<kd_interface> tree(2);
|
||||||
points_list l, res;
|
points_list l, res;
|
||||||
|
|
||||||
srand( (unsigned)time(NULL) );
|
std::srand( (unsigned)time(NULL) );
|
||||||
|
|
||||||
std::cout << "Insering evenly 81 points in the square (0,0)-(10,10) ...\n\n";
|
std::cout << "Insering evenly 81 points in the square (0,0)-(10,10) ...\n\n";
|
||||||
for (int i=1; i<10; i++)
|
for (int i=1; i<10; i++)
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <cstdlib>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#include <CGAL/kdtree_d.h>
|
#include <CGAL/kdtree_d.h>
|
||||||
|
|
@ -38,7 +39,7 @@ typedef std::list<point> points_list;
|
||||||
|
|
||||||
inline double dblRand( void )
|
inline double dblRand( void )
|
||||||
{
|
{
|
||||||
return (double)rand() / (double)RAND_MAX;
|
return (double)std::rand() / (double)RAND_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
void random_points( int num, points_list &l )
|
void random_points( int num, points_list &l )
|
||||||
|
|
@ -59,7 +60,7 @@ int main()
|
||||||
{
|
{
|
||||||
CGAL::Kdtree_d<kd_interface> tree(3);
|
CGAL::Kdtree_d<kd_interface> tree(3);
|
||||||
|
|
||||||
srand( (unsigned)time(NULL) );
|
std::srand( (unsigned)time(NULL) );
|
||||||
|
|
||||||
std::cout << "Choosing randomly 30 points in the cube (0,0,0)-(10,10,10)\n" ;
|
std::cout << "Choosing randomly 30 points in the cube (0,0,0)-(10,10,10)\n" ;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <cstdlib>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#include <CGAL/kdtree_d.h>
|
#include <CGAL/kdtree_d.h>
|
||||||
|
|
@ -90,7 +91,7 @@ typedef std::list<point> points_list;
|
||||||
|
|
||||||
inline double dblRand( void )
|
inline double dblRand( void )
|
||||||
{
|
{
|
||||||
return (double)rand() / (double)RAND_MAX;
|
return (double)std::rand() / (double)RAND_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
void random_points( int num, points_list &l, int DIM)
|
void random_points( int num, points_list &l, int DIM)
|
||||||
|
|
@ -113,7 +114,7 @@ int main()
|
||||||
{
|
{
|
||||||
CGAL::Kdtree_d<kd_interface> tree(3);
|
CGAL::Kdtree_d<kd_interface> tree(3);
|
||||||
|
|
||||||
srand( (unsigned)time(NULL) );
|
std::srand( (unsigned)time(NULL) );
|
||||||
|
|
||||||
std::cout << "Choosing randomly 30 points in the cube (0,0,0)-(10,10,10)\n" ;
|
std::cout << "Choosing randomly 30 points in the cube (0,0,0)-(10,10,10)\n" ;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue