diff --git a/Surface_mesh_parameterization/include/CGAL/Taucs_solver_traits.h b/Surface_mesh_parameterization/include/CGAL/Taucs_solver_traits.h index 682637ad122..19aeb8cef85 100644 --- a/Surface_mesh_parameterization/include/CGAL/Taucs_solver_traits.h +++ b/Surface_mesh_parameterization/include/CGAL/Taucs_solver_traits.h @@ -27,10 +27,6 @@ #include #include -#include -#include -#include -#include CGAL_BEGIN_NAMESPACE @@ -88,6 +84,42 @@ public: taucs_logfile("stderr"); #endif +//#ifdef DEBUG_TRACE +// // Debug trace +// fprintf(stderr, "\n"); +// fprintf(stderr, "linear_solver:\n"); +// int n = A.row_dimension(); +// if (n < 20) // if small matrix, print it entirely +// { +// fprintf(stderr, "****************** A: ******************\n"); +// for (int i=0; i::min()); } - - /// Generate a temporary filename. See "man tmpnam". - /// This is a replacement for the standard tmpnam() function that is deprecated. - /// Note: this is a modified version of cupsTempFile(). - char * // Out - Filename or - tmpnam(char *filename) // In - Pointer to buffer - { - int fd; // File descriptor for temp file -#ifdef WIN32 - char tmpdir[1024]; // Windows temporary directory -#else - char *tmpdir; // TMPDIR environment var -#endif - struct timeval curtime; // Current time - static char buf[L_tmpnam] = ""; // Buffer if you pass in NULL - - // See if a filename was specified. - if (filename == NULL) - filename = buf; - - // Get temporary directory. -#ifdef WIN32 - if ((tmpdir = getenv("TEMP")) == NULL) - { - GetTempPath(sizeof(tmpdir), tmpdir); - } -#else - if ((tmpdir = getenv("TMPDIR")) == NULL) - { - // Put root temp files in restricted temp directory. - if (getuid() == 0) - tmpdir = "/tmp"; - else - tmpdir = "/var/tmp"; - } -#endif - - // Make the temporary name using the specified directory. - do - { - // Get the current time of day... - gettimeofday(&curtime, NULL); - - // Format a string using the hex time values... - snprintf(filename, L_tmpnam - 1, "%s/%08x%05x", tmpdir, - (int)curtime.tv_sec, (int)curtime.tv_usec); - - // Open the file in "exclusive" mode, making sure that we don't - // stomp on an existing file or someone's symlink crack. -#ifdef O_NOFOLLOW - fd = open(filename, O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW, 0600); -#else - fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0600); -#endif - } - while (fd < 0); - - // Close the temp file - it'll be reopened later as needed. - close(fd); - - // Return the temp filename. - return (filename); - } - -}; // Taucs_solver_traits +}; CGAL_END_NAMESPACE