forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14126 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
bf26b12668
commit
b2c2e38ba3
|
@ -1,36 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "STUBS", "STUBS.vcproj", "{FD83089F-1BF6-455F-9BEA-BB1C21FC137C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LAMMPS", "LAMMPS.vcproj", "{74AC9767-A52F-47BD-BB26-07C739DA3EA5}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug_STUBS|Win32 = Debug_STUBS|Win32
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release_STUBS|Win32 = Release_STUBS|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{FD83089F-1BF6-455F-9BEA-BB1C21FC137C}.Debug_STUBS|Win32.ActiveCfg = Debug_STUBS|Win32
|
||||
{FD83089F-1BF6-455F-9BEA-BB1C21FC137C}.Debug_STUBS|Win32.Build.0 = Debug_STUBS|Win32
|
||||
{FD83089F-1BF6-455F-9BEA-BB1C21FC137C}.Debug|Win32.ActiveCfg = Debug_STUBS|Win32
|
||||
{FD83089F-1BF6-455F-9BEA-BB1C21FC137C}.Debug|Win32.Build.0 = Debug_STUBS|Win32
|
||||
{FD83089F-1BF6-455F-9BEA-BB1C21FC137C}.Release_STUBS|Win32.ActiveCfg = Release_STUBS|Win32
|
||||
{FD83089F-1BF6-455F-9BEA-BB1C21FC137C}.Release_STUBS|Win32.Build.0 = Release_STUBS|Win32
|
||||
{FD83089F-1BF6-455F-9BEA-BB1C21FC137C}.Release|Win32.ActiveCfg = Release_STUBS|Win32
|
||||
{FD83089F-1BF6-455F-9BEA-BB1C21FC137C}.Release|Win32.Build.0 = Release_STUBS|Win32
|
||||
{74AC9767-A52F-47BD-BB26-07C739DA3EA5}.Debug_STUBS|Win32.ActiveCfg = Debug_STUBS|Win32
|
||||
{74AC9767-A52F-47BD-BB26-07C739DA3EA5}.Debug_STUBS|Win32.Build.0 = Debug_STUBS|Win32
|
||||
{74AC9767-A52F-47BD-BB26-07C739DA3EA5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{74AC9767-A52F-47BD-BB26-07C739DA3EA5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{74AC9767-A52F-47BD-BB26-07C739DA3EA5}.Release_STUBS|Win32.ActiveCfg = Release_STUBS|Win32
|
||||
{74AC9767-A52F-47BD-BB26-07C739DA3EA5}.Release_STUBS|Win32.Build.0 = Release_STUBS|Win32
|
||||
{74AC9767-A52F-47BD-BB26-07C739DA3EA5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{74AC9767-A52F-47BD-BB26-07C739DA3EA5}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -1,78 +0,0 @@
|
|||
INSTRUCTIONS FOR COMPILING LAMMPS WITH VISUAL STUDIO 2005
|
||||
|
||||
The provided project
|
||||
|
||||
LAMMPS.vcproj
|
||||
|
||||
includes the minimal package set: KSPACE, MANYBODY, MOLECULE.
|
||||
|
||||
The package set may be reconfiured with the help of the supplied VS
|
||||
macro (see below).
|
||||
|
||||
The project has configurations to compile either with MPI support or
|
||||
with MPI stubs.
|
||||
|
||||
To compile with MPI:
|
||||
|
||||
1. Install MPICH for Windows, specify the corresponding include and
|
||||
lib directories in MSVS/Tools/Options/Projects and Solutions/VC++
|
||||
Directories
|
||||
|
||||
2. Compile LAMMPS using Debug or Release configurations from the
|
||||
provided projects
|
||||
|
||||
To compile with MPI STUBS
|
||||
|
||||
1. Compile STUBS.vcproj
|
||||
|
||||
2. Compile LAMMPS using Debug_STUBS or Release_STUBS configurations
|
||||
from the provided project
|
||||
|
||||
To run the code you may need mpich and fftw213 dlls accessible by the
|
||||
system search (they may be copied to Windows/system32 directory). The
|
||||
fftw213 dlls can be found in vs9/extra/fftw213 or downloaded from the
|
||||
fftw site
|
||||
|
||||
To customise the packages via a Visual Basic macro:
|
||||
|
||||
1. Load LAMMPS solution in Visual Studio IDE
|
||||
2. Select in the main menu "Tools/Macros/Load Macro Project..."
|
||||
and load the file src/WINDOWS/LAMMPS.vsmacros
|
||||
3. In the "Macro Explorer" on the right panel open LAMMPS and LAMMPS_settings
|
||||
4. Double click on "ManagePackages" to run the configuration
|
||||
macro. Please note that the window for running macro sometimes
|
||||
opens in the background, so use Alt-TAB to locate it.
|
||||
5. Configure a custom set of packages and press Ok. Wait till the
|
||||
macro completes.
|
||||
6. Rebuild the LAMMPS project
|
||||
|
||||
Before the first build or after an update from LAMMPS src repository
|
||||
it is recommended to run "ManagePackages" macro an check "Refresh file
|
||||
list in src filter" to get an up to date list of source files in the
|
||||
"src" project filter. This may be needed as the file composition in
|
||||
src may change between LAMMPS releases.
|
||||
|
||||
Some of the packages were not tested to be compatible with VS compiler
|
||||
or require additional libraries. They are marked with asterics in the
|
||||
package list displayed when the macro is running. If you wish to try
|
||||
those packages, install them using the macro and then change the
|
||||
project properties (libraries, includes, etc.) manually.
|
||||
|
||||
Please note that "ManagePackages" macro works on the project named
|
||||
LAMMPS. So if you rename the LAMMPS project and still want to use
|
||||
automatic package configuration, please specify the new name in the
|
||||
line "Dim LAMMPS_project_name As String =" at the beginning of the
|
||||
macro code.
|
||||
|
||||
The default package options such as the path to include and library
|
||||
files, description, etc can also be changed by editing the
|
||||
"ManagePackages" macro code. To do this right click on
|
||||
"ManagePackages" in the "Macro Explorer" and select Edit. Then go to
|
||||
the section named
|
||||
|
||||
"===================== Custom Package options ========================",
|
||||
|
||||
find the required package and change its properties by modyfing the
|
||||
corresponding PKG_OPTS(...) entry.
|
||||
|
||||
|
|
@ -1,156 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="STUBS"
|
||||
ProjectGUID="{FD83089F-1BF6-455F-9BEA-BB1C21FC137C}"
|
||||
RootNamespace="stubs"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug_STUBS|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="extra"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release_STUBS|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="extra"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\STUBS\mpi.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\STUBS\mpi.h"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -1,372 +0,0 @@
|
|||
/*****************************************************************************
|
||||
* dirent.h - dirent API for Microsoft Visual Studio
|
||||
*
|
||||
* Copyright (C) 2006 Toni Ronkko
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* ``Software''), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Mar 15, 2011, Toni Ronkko
|
||||
* Defined FILE_ATTRIBUTE_DEVICE for MSVC 6.0.
|
||||
*
|
||||
* Aug 11, 2010, Toni Ronkko
|
||||
* Added d_type and d_namlen fields to dirent structure. The former is
|
||||
* especially useful for determining whether directory entry represents a
|
||||
* file or a directory. For more information, see
|
||||
* http://www.delorie.com/gnu/docs/glibc/libc_270.html
|
||||
*
|
||||
* Aug 11, 2010, Toni Ronkko
|
||||
* Improved conformance to the standards. For example, errno is now set
|
||||
* properly on failure and assert() is never used. Thanks to Peter Brockam
|
||||
* for suggestions.
|
||||
*
|
||||
* Aug 11, 2010, Toni Ronkko
|
||||
* Fixed a bug in rewinddir(): when using relative directory names, change
|
||||
* of working directory no longer causes rewinddir() to fail.
|
||||
*
|
||||
* Dec 15, 2009, John Cunningham
|
||||
* Added rewinddir member function
|
||||
*
|
||||
* Jan 18, 2008, Toni Ronkko
|
||||
* Using FindFirstFileA and WIN32_FIND_DATAA to avoid converting string
|
||||
* between multi-byte and unicode representations. This makes the
|
||||
* code simpler and also allows the code to be compiled under MingW. Thanks
|
||||
* to Azriel Fasten for the suggestion.
|
||||
*
|
||||
* Mar 4, 2007, Toni Ronkko
|
||||
* Bug fix: due to the strncpy_s() function this file only compiled in
|
||||
* Visual Studio 2005. Using the new string functions only when the
|
||||
* compiler version allows.
|
||||
*
|
||||
* Nov 2, 2006, Toni Ronkko
|
||||
* Major update: removed support for Watcom C, MS-DOS and Turbo C to
|
||||
* simplify the file, updated the code to compile cleanly on Visual
|
||||
* Studio 2005 with both unicode and multi-byte character strings,
|
||||
* removed rewinddir() as it had a bug.
|
||||
*
|
||||
* Aug 20, 2006, Toni Ronkko
|
||||
* Removed all remarks about MSVC 1.0, which is antiqued now. Simplified
|
||||
* comments by removing SGML tags.
|
||||
*
|
||||
* May 14 2002, Toni Ronkko
|
||||
* Embedded the function definitions directly to the header so that no
|
||||
* source modules need to be included in the Visual Studio project. Removed
|
||||
* all the dependencies to other projects so that this very header can be
|
||||
* used independently.
|
||||
*
|
||||
* May 28 1998, Toni Ronkko
|
||||
* First version.
|
||||
*****************************************************************************/
|
||||
#ifndef DIRENT_H
|
||||
#define DIRENT_H
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* Entries missing from MSVC 6.0 */
|
||||
#if !defined(FILE_ATTRIBUTE_DEVICE)
|
||||
# define FILE_ATTRIBUTE_DEVICE 0x40
|
||||
#endif
|
||||
|
||||
/* File type and permission flags for stat() */
|
||||
#if defined(_MSC_VER) && !defined(S_IREAD)
|
||||
# define S_IFMT _S_IFMT /* file type mask */
|
||||
# define S_IFDIR _S_IFDIR /* directory */
|
||||
# define S_IFCHR _S_IFCHR /* character device */
|
||||
# define S_IFFIFO _S_IFFIFO /* pipe */
|
||||
# define S_IFREG _S_IFREG /* regular file */
|
||||
# define S_IREAD _S_IREAD /* read permission */
|
||||
# define S_IWRITE _S_IWRITE /* write permission */
|
||||
# define S_IEXEC _S_IEXEC /* execute permission */
|
||||
#endif
|
||||
#define S_IFBLK 0 /* block device */
|
||||
#define S_IFLNK 0 /* link */
|
||||
#define S_IFSOCK 0 /* socket */
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# define S_IRUSR S_IREAD /* read, user */
|
||||
# define S_IWUSR S_IWRITE /* write, user */
|
||||
# define S_IXUSR 0 /* execute, user */
|
||||
# define S_IRGRP 0 /* read, group */
|
||||
# define S_IWGRP 0 /* write, group */
|
||||
# define S_IXGRP 0 /* execute, group */
|
||||
# define S_IROTH 0 /* read, others */
|
||||
# define S_IWOTH 0 /* write, others */
|
||||
# define S_IXOTH 0 /* execute, others */
|
||||
#endif
|
||||
|
||||
/* Indicates that d_type field is available in dirent structure */
|
||||
#define _DIRENT_HAVE_D_TYPE
|
||||
|
||||
/* File type flags for d_type */
|
||||
#define DT_UNKNOWN 0
|
||||
#define DT_REG S_IFREG
|
||||
#define DT_DIR S_IFDIR
|
||||
#define DT_FIFO S_IFFIFO
|
||||
#define DT_SOCK S_IFSOCK
|
||||
#define DT_CHR S_IFCHR
|
||||
#define DT_BLK S_IFBLK
|
||||
|
||||
/* Macros for converting between st_mode and d_type */
|
||||
#define IFTODT(mode) ((mode) & S_IFMT)
|
||||
#define DTTOIF(type) (type)
|
||||
|
||||
/*
|
||||
* File type macros. Note that block devices, sockets and links cannot be
|
||||
* distinguished on Windows and the macros S_ISBLK, S_ISSOCK and S_ISLNK are
|
||||
* only defined for compatibility. These macros should always return false
|
||||
* on Windows.
|
||||
*/
|
||||
#define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFFIFO)
|
||||
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
|
||||
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
|
||||
#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
|
||||
#define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
|
||||
#define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR)
|
||||
#define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct dirent
|
||||
{
|
||||
char d_name[MAX_PATH + 1]; /* File name */
|
||||
size_t d_namlen; /* Length of name without \0 */
|
||||
int d_type; /* File type */
|
||||
} dirent;
|
||||
|
||||
|
||||
typedef struct DIR
|
||||
{
|
||||
dirent curentry; /* Current directory entry */
|
||||
WIN32_FIND_DATAA find_data; /* Private file data */
|
||||
int cached; /* True if data is valid */
|
||||
HANDLE search_handle; /* Win32 search handle */
|
||||
char patt[MAX_PATH + 3]; /* Initial directory name */
|
||||
} DIR;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static DIR *opendir(const char *dirname);
|
||||
static struct dirent *readdir(DIR *dirp);
|
||||
static int closedir(DIR *dirp);
|
||||
static void rewinddir(DIR* dirp);
|
||||
|
||||
|
||||
/* Use the new safe string functions introduced in Visual Studio 2005 */
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
# define DIRENT_STRNCPY(dest,src,size) strncpy_s((dest),(size),(src),_TRUNCATE)
|
||||
#else
|
||||
# define DIRENT_STRNCPY(dest,src,size) strncpy((dest),(src),(size))
|
||||
#endif
|
||||
|
||||
/* Set errno variable */
|
||||
#if defined(_MSC_VER)
|
||||
#define DIRENT_SET_ERRNO(x) _set_errno (x)
|
||||
#else
|
||||
#define DIRENT_SET_ERRNO(x) (errno = (x))
|
||||
#endif
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Open directory stream DIRNAME for read and return a pointer to the
|
||||
* internal working area that is used to retrieve individual directory
|
||||
* entries.
|
||||
*/
|
||||
static DIR *opendir(const char *dirname)
|
||||
{
|
||||
DIR *dirp;
|
||||
|
||||
/* ensure that the resulting search pattern will be a valid file name */
|
||||
if (dirname == NULL) {
|
||||
DIRENT_SET_ERRNO (ENOENT);
|
||||
return NULL;
|
||||
}
|
||||
if (strlen (dirname) + 3 >= MAX_PATH) {
|
||||
DIRENT_SET_ERRNO (ENAMETOOLONG);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* construct new DIR structure */
|
||||
dirp = (DIR*) malloc (sizeof (struct DIR));
|
||||
if (dirp != NULL) {
|
||||
int error;
|
||||
|
||||
/*
|
||||
* Convert relative directory name to an absolute one. This
|
||||
* allows rewinddir() to function correctly when the current working
|
||||
* directory is changed between opendir() and rewinddir().
|
||||
*/
|
||||
if (GetFullPathNameA (dirname, MAX_PATH, dirp->patt, NULL)) {
|
||||
char *p;
|
||||
|
||||
/* append the search pattern "\\*\0" to the directory name */
|
||||
p = strchr (dirp->patt, '\0');
|
||||
if (dirp->patt < p && *(p-1) != '\\' && *(p-1) != ':') {
|
||||
*p++ = '\\';
|
||||
}
|
||||
*p++ = '*';
|
||||
*p = '\0';
|
||||
|
||||
/* open directory stream and retrieve the first entry */
|
||||
dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->find_data);
|
||||
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
|
||||
/* a directory entry is now waiting in memory */
|
||||
dirp->cached = 1;
|
||||
error = 0;
|
||||
} else {
|
||||
/* search pattern is not a directory name? */
|
||||
DIRENT_SET_ERRNO (ENOENT);
|
||||
error = 1;
|
||||
}
|
||||
} else {
|
||||
/* buffer too small */
|
||||
DIRENT_SET_ERRNO (ENOMEM);
|
||||
error = 1;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
free (dirp);
|
||||
dirp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return dirp;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Read a directory entry, and return a pointer to a dirent structure
|
||||
* containing the name of the entry in d_name field. Individual directory
|
||||
* entries returned by this very function include regular files,
|
||||
* sub-directories, pseudo-directories "." and "..", but also volume labels,
|
||||
* hidden files and system files may be returned.
|
||||
*/
|
||||
static struct dirent *readdir(DIR *dirp)
|
||||
{
|
||||
DWORD attr;
|
||||
if (dirp == NULL) {
|
||||
/* directory stream did not open */
|
||||
DIRENT_SET_ERRNO (EBADF);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* get next directory entry */
|
||||
if (dirp->cached != 0) {
|
||||
/* a valid directory entry already in memory */
|
||||
dirp->cached = 0;
|
||||
} else {
|
||||
/* get the next directory entry from stream */
|
||||
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
|
||||
return NULL;
|
||||
}
|
||||
if (FindNextFileA (dirp->search_handle, &dirp->find_data) == FALSE) {
|
||||
/* the very last entry has been processed or an error occured */
|
||||
FindClose (dirp->search_handle);
|
||||
dirp->search_handle = INVALID_HANDLE_VALUE;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* copy as a multibyte character string */
|
||||
DIRENT_STRNCPY ( dirp->curentry.d_name,
|
||||
dirp->find_data.cFileName,
|
||||
sizeof(dirp->curentry.d_name) );
|
||||
dirp->curentry.d_name[MAX_PATH] = '\0';
|
||||
|
||||
/* compute the length of name */
|
||||
dirp->curentry.d_namlen = strlen (dirp->curentry.d_name);
|
||||
|
||||
/* determine file type */
|
||||
attr = dirp->find_data.dwFileAttributes;
|
||||
if ((attr & FILE_ATTRIBUTE_DEVICE) != 0) {
|
||||
dirp->curentry.d_type = DT_CHR;
|
||||
} else if ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) {
|
||||
dirp->curentry.d_type = DT_DIR;
|
||||
} else {
|
||||
dirp->curentry.d_type = DT_REG;
|
||||
}
|
||||
return &dirp->curentry;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Close directory stream opened by opendir() function. Close of the
|
||||
* directory stream invalidates the DIR structure as well as any previously
|
||||
* read directory entry.
|
||||
*/
|
||||
static int closedir(DIR *dirp)
|
||||
{
|
||||
if (dirp == NULL) {
|
||||
/* invalid directory stream */
|
||||
DIRENT_SET_ERRNO (EBADF);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* release search handle */
|
||||
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
|
||||
FindClose (dirp->search_handle);
|
||||
dirp->search_handle = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
/* release directory structure */
|
||||
free (dirp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Resets the position of the directory stream to which dirp refers to the
|
||||
* beginning of the directory. It also causes the directory stream to refer
|
||||
* to the current state of the corresponding directory, as a call to opendir()
|
||||
* would have done. If dirp does not refer to a directory stream, the effect
|
||||
* is undefined.
|
||||
*/
|
||||
static void rewinddir(DIR* dirp)
|
||||
{
|
||||
if (dirp != NULL) {
|
||||
/* release search handle */
|
||||
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
|
||||
FindClose (dirp->search_handle);
|
||||
}
|
||||
|
||||
/* open new search handle and retrieve the first entry */
|
||||
dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->find_data);
|
||||
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
|
||||
/* a directory entry is now waiting in memory */
|
||||
dirp->cached = 1;
|
||||
} else {
|
||||
/* failed to re-open directory: no directory entry in memory */
|
||||
dirp->cached = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /*DIRENT_H*/
|
|
@ -1,19 +0,0 @@
|
|||
# ifndef ERF_H
|
||||
# define ERF_H
|
||||
|
||||
# ifdef _WIN32
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
double erf(double x);
|
||||
double erfc(double x);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
# endif
|
|
@ -1,345 +0,0 @@
|
|||
/*
|
||||
* Copied from OpenBSD project (src/lib/libm/src/s_erf.c)
|
||||
* Specialized for 32-bit little endian architectures.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
* Developed at SunPro, a Sun Microsystems, Inc. business.
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software is freely granted, provided that this notice
|
||||
* is preserved.
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
/* double erf(double x)
|
||||
* double erfc(double x)
|
||||
* x
|
||||
* 2 |\
|
||||
* erf(x) = --------- | exp(-t*t)dt
|
||||
* sqrt(pi) \|
|
||||
* 0
|
||||
*
|
||||
* erfc(x) = 1-erf(x)
|
||||
* Note that
|
||||
* erf(-x) = -erf(x)
|
||||
* erfc(-x) = 2 - erfc(x)
|
||||
*
|
||||
* Method:
|
||||
* 1. For |x| in [0, 0.84375]
|
||||
* erf(x) = x + x*R(x^2)
|
||||
* erfc(x) = 1 - erf(x) if x in [-.84375,0.25]
|
||||
* = 0.5 + ((0.5-x)-x*R) if x in [0.25,0.84375]
|
||||
* where R = P/Q where P is an odd poly of degree 8 and
|
||||
* Q is an odd poly of degree 10.
|
||||
* -57.90
|
||||
* | R - (erf(x)-x)/x | <= 2
|
||||
*
|
||||
*
|
||||
* Remark. The formula is derived by noting
|
||||
* erf(x) = (2/sqrt(pi))*(x - x^3/3 + x^5/10 - x^7/42 + ....)
|
||||
* and that
|
||||
* 2/sqrt(pi) = 1.128379167095512573896158903121545171688
|
||||
* is close to one. The interval is chosen because the fix
|
||||
* point of erf(x) is near 0.6174 (i.e., erf(x)=x when x is
|
||||
* near 0.6174), and by some experiment, 0.84375 is chosen to
|
||||
* guarantee the error is less than one ulp for erf.
|
||||
*
|
||||
* 2. For |x| in [0.84375,1.25], let s = |x| - 1, and
|
||||
* c = 0.84506291151 rounded to single (24 bits)
|
||||
* erf(x) = sign(x) * (c + P1(s)/Q1(s))
|
||||
* erfc(x) = (1-c) - P1(s)/Q1(s) if x > 0
|
||||
* 1+(c+P1(s)/Q1(s)) if x < 0
|
||||
* |P1/Q1 - (erf(|x|)-c)| <= 2**-59.06
|
||||
* Remark: here we use the taylor series expansion at x=1.
|
||||
* erf(1+s) = erf(1) + s*Poly(s)
|
||||
* = 0.845.. + P1(s)/Q1(s)
|
||||
* That is, we use rational approximation to approximate
|
||||
* erf(1+s) - (c = (single)0.84506291151)
|
||||
* Note that |P1/Q1|< 0.078 for x in [0.84375,1.25]
|
||||
* where
|
||||
* P1(s) = degree 6 poly in s
|
||||
* Q1(s) = degree 6 poly in s
|
||||
*
|
||||
* 3. For x in [1.25,1/0.35(~2.857143)],
|
||||
* erfc(x) = (1/x)*exp(-x*x-0.5625+R1/S1)
|
||||
* erf(x) = 1 - erfc(x)
|
||||
* where
|
||||
* R1(z) = degree 7 poly in z, (z=1/x^2)
|
||||
* S1(z) = degree 8 poly in z
|
||||
*
|
||||
* 4. For x in [1/0.35,28]
|
||||
* erfc(x) = (1/x)*exp(-x*x-0.5625+R2/S2) if x > 0
|
||||
* = 2.0 - (1/x)*exp(-x*x-0.5625+R2/S2) if -6<x<0
|
||||
* = 2.0 - tiny (if x <= -6)
|
||||
* erf(x) = sign(x)*(1.0 - erfc(x)) if x < 6, else
|
||||
* erf(x) = sign(x)*(1.0 - tiny)
|
||||
* where
|
||||
* R2(z) = degree 6 poly in z, (z=1/x^2)
|
||||
* S2(z) = degree 7 poly in z
|
||||
*
|
||||
* Note1:
|
||||
* To compute exp(-x*x-0.5625+R/S), let s be a single
|
||||
* precision number and s := x; then
|
||||
* -x*x = -s*s + (s-x)*(s+x)
|
||||
* exp(-x*x-0.5626+R/S) =
|
||||
* exp(-s*s-0.5625)*exp((s-x)*(s+x)+R/S);
|
||||
* Note2:
|
||||
* Here 4 and 5 make use of the asymptotic series
|
||||
* exp(-x*x)
|
||||
* erfc(x) ~ ---------- * ( 1 + Poly(1/x^2) )
|
||||
* x*sqrt(pi)
|
||||
* We use rational approximation to approximate
|
||||
* g(s)=f(1/x^2) = log(erfc(x)*x) - x*x + 0.5625
|
||||
* Here is the error bound for R1/S1 and R2/S2
|
||||
* |R1/S1 - f(x)| < 2**(-62.57)
|
||||
* |R2/S2 - f(x)| < 2**(-61.52)
|
||||
*
|
||||
* 5. For inf > x >= 28
|
||||
* erf(x) = sign(x) *(1 - tiny) (raise inexact)
|
||||
* erfc(x) = tiny*tiny (raise underflow) if x > 0
|
||||
* = 2 - tiny if x<0
|
||||
*
|
||||
* 7. Special case:
|
||||
* erf(0) = 0, erf(inf) = 1, erf(-inf) = -1,
|
||||
* erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2,
|
||||
* erfc/erf(NaN) is NaN
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
//extern "C" {
|
||||
|
||||
/* assume 32 bit int */
|
||||
|
||||
typedef int int32_t;
|
||||
typedef unsigned int u_int32_t;
|
||||
|
||||
/* assume little endian */
|
||||
typedef union
|
||||
{
|
||||
double value;
|
||||
struct
|
||||
{
|
||||
u_int32_t lsw;
|
||||
u_int32_t msw;
|
||||
} parts;
|
||||
} ieee_double_shape_type;
|
||||
|
||||
|
||||
/* Get the more significant 32 bit int from a double. */
|
||||
|
||||
#define GET_HIGH_WORD(i,d) \
|
||||
do { \
|
||||
ieee_double_shape_type gh_u; \
|
||||
gh_u.value = (d); \
|
||||
(i) = gh_u.parts.msw; \
|
||||
} while (0)
|
||||
|
||||
|
||||
/* Set the less significant 32 bits of a double from an int. */
|
||||
|
||||
#define SET_LOW_WORD(d,v) \
|
||||
do { \
|
||||
ieee_double_shape_type sl_u; \
|
||||
sl_u.value = (d); \
|
||||
sl_u.parts.lsw = (v); \
|
||||
(d) = sl_u.value; \
|
||||
} while (0)
|
||||
|
||||
|
||||
/* Eliminate reference to internal OpenBSD call */
|
||||
|
||||
#define __ieee754_exp(X) exp(X)
|
||||
|
||||
|
||||
static const double
|
||||
tiny = 1e-300,
|
||||
half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
|
||||
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
|
||||
two = 2.00000000000000000000e+00, /* 0x40000000, 0x00000000 */
|
||||
/* c = (float)0.84506291151 */
|
||||
erx = 8.45062911510467529297e-01, /* 0x3FEB0AC1, 0x60000000 */
|
||||
/*
|
||||
* Coefficients for approximation to erf on [0,0.84375]
|
||||
*/
|
||||
efx = 1.28379167095512586316e-01, /* 0x3FC06EBA, 0x8214DB69 */
|
||||
efx8= 1.02703333676410069053e+00, /* 0x3FF06EBA, 0x8214DB69 */
|
||||
pp0 = 1.28379167095512558561e-01, /* 0x3FC06EBA, 0x8214DB68 */
|
||||
pp1 = -3.25042107247001499370e-01, /* 0xBFD4CD7D, 0x691CB913 */
|
||||
pp2 = -2.84817495755985104766e-02, /* 0xBF9D2A51, 0xDBD7194F */
|
||||
pp3 = -5.77027029648944159157e-03, /* 0xBF77A291, 0x236668E4 */
|
||||
pp4 = -2.37630166566501626084e-05, /* 0xBEF8EAD6, 0x120016AC */
|
||||
qq1 = 3.97917223959155352819e-01, /* 0x3FD97779, 0xCDDADC09 */
|
||||
qq2 = 6.50222499887672944485e-02, /* 0x3FB0A54C, 0x5536CEBA */
|
||||
qq3 = 5.08130628187576562776e-03, /* 0x3F74D022, 0xC4D36B0F */
|
||||
qq4 = 1.32494738004321644526e-04, /* 0x3F215DC9, 0x221C1A10 */
|
||||
qq5 = -3.96022827877536812320e-06, /* 0xBED09C43, 0x42A26120 */
|
||||
/*
|
||||
* Coefficients for approximation to erf in [0.84375,1.25]
|
||||
*/
|
||||
pa0 = -2.36211856075265944077e-03, /* 0xBF6359B8, 0xBEF77538 */
|
||||
pa1 = 4.14856118683748331666e-01, /* 0x3FDA8D00, 0xAD92B34D */
|
||||
pa2 = -3.72207876035701323847e-01, /* 0xBFD7D240, 0xFBB8C3F1 */
|
||||
pa3 = 3.18346619901161753674e-01, /* 0x3FD45FCA, 0x805120E4 */
|
||||
pa4 = -1.10894694282396677476e-01, /* 0xBFBC6398, 0x3D3E28EC */
|
||||
pa5 = 3.54783043256182359371e-02, /* 0x3FA22A36, 0x599795EB */
|
||||
pa6 = -2.16637559486879084300e-03, /* 0xBF61BF38, 0x0A96073F */
|
||||
qa1 = 1.06420880400844228286e-01, /* 0x3FBB3E66, 0x18EEE323 */
|
||||
qa2 = 5.40397917702171048937e-01, /* 0x3FE14AF0, 0x92EB6F33 */
|
||||
qa3 = 7.18286544141962662868e-02, /* 0x3FB2635C, 0xD99FE9A7 */
|
||||
qa4 = 1.26171219808761642112e-01, /* 0x3FC02660, 0xE763351F */
|
||||
qa5 = 1.36370839120290507362e-02, /* 0x3F8BEDC2, 0x6B51DD1C */
|
||||
qa6 = 1.19844998467991074170e-02, /* 0x3F888B54, 0x5735151D */
|
||||
/*
|
||||
* Coefficients for approximation to erfc in [1.25,1/0.35]
|
||||
*/
|
||||
ra0 = -9.86494403484714822705e-03, /* 0xBF843412, 0x600D6435 */
|
||||
ra1 = -6.93858572707181764372e-01, /* 0xBFE63416, 0xE4BA7360 */
|
||||
ra2 = -1.05586262253232909814e+01, /* 0xC0251E04, 0x41B0E726 */
|
||||
ra3 = -6.23753324503260060396e+01, /* 0xC04F300A, 0xE4CBA38D */
|
||||
ra4 = -1.62396669462573470355e+02, /* 0xC0644CB1, 0x84282266 */
|
||||
ra5 = -1.84605092906711035994e+02, /* 0xC067135C, 0xEBCCABB2 */
|
||||
ra6 = -8.12874355063065934246e+01, /* 0xC0545265, 0x57E4D2F2 */
|
||||
ra7 = -9.81432934416914548592e+00, /* 0xC023A0EF, 0xC69AC25C */
|
||||
sa1 = 1.96512716674392571292e+01, /* 0x4033A6B9, 0xBD707687 */
|
||||
sa2 = 1.37657754143519042600e+02, /* 0x4061350C, 0x526AE721 */
|
||||
sa3 = 4.34565877475229228821e+02, /* 0x407B290D, 0xD58A1A71 */
|
||||
sa4 = 6.45387271733267880336e+02, /* 0x40842B19, 0x21EC2868 */
|
||||
sa5 = 4.29008140027567833386e+02, /* 0x407AD021, 0x57700314 */
|
||||
sa6 = 1.08635005541779435134e+02, /* 0x405B28A3, 0xEE48AE2C */
|
||||
sa7 = 6.57024977031928170135e+00, /* 0x401A47EF, 0x8E484A93 */
|
||||
sa8 = -6.04244152148580987438e-02, /* 0xBFAEEFF2, 0xEE749A62 */
|
||||
/*
|
||||
* Coefficients for approximation to erfc in [1/.35,28]
|
||||
*/
|
||||
rb0 = -9.86494292470009928597e-03, /* 0xBF843412, 0x39E86F4A */
|
||||
rb1 = -7.99283237680523006574e-01, /* 0xBFE993BA, 0x70C285DE */
|
||||
rb2 = -1.77579549177547519889e+01, /* 0xC031C209, 0x555F995A */
|
||||
rb3 = -1.60636384855821916062e+02, /* 0xC064145D, 0x43C5ED98 */
|
||||
rb4 = -6.37566443368389627722e+02, /* 0xC083EC88, 0x1375F228 */
|
||||
rb5 = -1.02509513161107724954e+03, /* 0xC0900461, 0x6A2E5992 */
|
||||
rb6 = -4.83519191608651397019e+02, /* 0xC07E384E, 0x9BDC383F */
|
||||
sb1 = 3.03380607434824582924e+01, /* 0x403E568B, 0x261D5190 */
|
||||
sb2 = 3.25792512996573918826e+02, /* 0x40745CAE, 0x221B9F0A */
|
||||
sb3 = 1.53672958608443695994e+03, /* 0x409802EB, 0x189D5118 */
|
||||
sb4 = 3.19985821950859553908e+03, /* 0x40A8FFB7, 0x688C246A */
|
||||
sb5 = 2.55305040643316442583e+03, /* 0x40A3F219, 0xCEDF3BE6 */
|
||||
sb6 = 4.74528541206955367215e+02, /* 0x407DA874, 0xE79FE763 */
|
||||
sb7 = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */
|
||||
|
||||
double erf(double x)
|
||||
{
|
||||
int32_t hx,ix,i;
|
||||
double R,S,P,Q,s,y,z,r;
|
||||
GET_HIGH_WORD(hx,x);
|
||||
ix = hx&0x7fffffff;
|
||||
if(ix>=0x7ff00000) { /* erf(nan)=nan */
|
||||
i = ((u_int32_t)hx>>31)<<1;
|
||||
return (double)(1-i)+one/x; /* erf(+-inf)=+-1 */
|
||||
}
|
||||
|
||||
if(ix < 0x3feb0000) { /* |x|<0.84375 */
|
||||
if(ix < 0x3e300000) { /* |x|<2**-28 */
|
||||
if (ix < 0x00800000)
|
||||
return 0.125*(8.0*x+efx8*x); /*avoid underflow */
|
||||
return x + efx*x;
|
||||
}
|
||||
z = x*x;
|
||||
r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
|
||||
s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
|
||||
y = r/s;
|
||||
return x + x*y;
|
||||
}
|
||||
if(ix < 0x3ff40000) { /* 0.84375 <= |x| < 1.25 */
|
||||
s = fabs(x)-one;
|
||||
P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
|
||||
Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
|
||||
if(hx>=0) return erx + P/Q; else return -erx - P/Q;
|
||||
}
|
||||
if (ix >= 0x40180000) { /* inf>|x|>=6 */
|
||||
if(hx>=0) return one-tiny; else return tiny-one;
|
||||
}
|
||||
x = fabs(x);
|
||||
s = one/(x*x);
|
||||
if(ix< 0x4006DB6E) { /* |x| < 1/0.35 */
|
||||
R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
|
||||
ra5+s*(ra6+s*ra7))))));
|
||||
S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
|
||||
sa5+s*(sa6+s*(sa7+s*sa8)))))));
|
||||
} else { /* |x| >= 1/0.35 */
|
||||
R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
|
||||
rb5+s*rb6)))));
|
||||
S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
|
||||
sb5+s*(sb6+s*sb7))))));
|
||||
}
|
||||
z = x;
|
||||
SET_LOW_WORD(z,0);
|
||||
r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
|
||||
if(hx>=0) return one-r/x; else return r/x-one;
|
||||
}
|
||||
|
||||
double erfc(double x)
|
||||
{
|
||||
int32_t hx,ix;
|
||||
double R,S,P,Q,s,y,z,r;
|
||||
GET_HIGH_WORD(hx,x);
|
||||
ix = hx&0x7fffffff;
|
||||
if(ix>=0x7ff00000) { /* erfc(nan)=nan */
|
||||
/* erfc(+-inf)=0,2 */
|
||||
return (double)(((u_int32_t)hx>>31)<<1)+one/x;
|
||||
}
|
||||
|
||||
if(ix < 0x3feb0000) { /* |x|<0.84375 */
|
||||
if(ix < 0x3c700000) /* |x|<2**-56 */
|
||||
return one-x;
|
||||
z = x*x;
|
||||
r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
|
||||
s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
|
||||
y = r/s;
|
||||
if(hx < 0x3fd00000) { /* x<1/4 */
|
||||
return one-(x+x*y);
|
||||
} else {
|
||||
r = x*y;
|
||||
r += (x-half);
|
||||
return half - r ;
|
||||
}
|
||||
}
|
||||
if(ix < 0x3ff40000) { /* 0.84375 <= |x| < 1.25 */
|
||||
s = fabs(x)-one;
|
||||
P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
|
||||
Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
|
||||
if(hx>=0) {
|
||||
z = one-erx; return z - P/Q;
|
||||
} else {
|
||||
z = erx+P/Q; return one+z;
|
||||
}
|
||||
}
|
||||
if (ix < 0x403c0000) { /* |x|<28 */
|
||||
x = fabs(x);
|
||||
s = one/(x*x);
|
||||
if(ix< 0x4006DB6D) { /* |x| < 1/.35 ~ 2.857143*/
|
||||
R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
|
||||
ra5+s*(ra6+s*ra7))))));
|
||||
S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
|
||||
sa5+s*(sa6+s*(sa7+s*sa8)))))));
|
||||
} else { /* |x| >= 1/.35 ~ 2.857143 */
|
||||
if(hx<0&&ix>=0x40180000) return two-tiny;/* x < -6 */
|
||||
R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
|
||||
rb5+s*rb6)))));
|
||||
S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
|
||||
sb5+s*(sb6+s*sb7))))));
|
||||
}
|
||||
z = x;
|
||||
SET_LOW_WORD(z,0);
|
||||
r = __ieee754_exp(-z*z-0.5625)*
|
||||
__ieee754_exp((z-x)*(z+x)+R/S);
|
||||
if(hx>0) return r/x; else return two-r/x;
|
||||
} else {
|
||||
if(hx>0) return tiny*tiny; else return two-tiny;
|
||||
}
|
||||
}
|
||||
|
||||
//}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,421 +0,0 @@
|
|||
/* -*- C -*- */
|
||||
/*
|
||||
* Copyright (c) 1997-1999, 2003 Massachusetts Institute of Technology
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* fftw.h -- system-wide definitions */
|
||||
/* $Id: fftw.h,v 1.1 2011/06/10 17:15:07 morozov Exp $ */
|
||||
|
||||
#ifndef FFTW_H
|
||||
#define FFTW_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Define for using single precision */
|
||||
/*
|
||||
* If you can, use configure --enable-float instead of changing this
|
||||
* flag directly
|
||||
*/
|
||||
/* #undef FFTW_ENABLE_FLOAT */
|
||||
|
||||
/* our real numbers */
|
||||
#ifdef FFTW_ENABLE_FLOAT
|
||||
typedef float fftw_real;
|
||||
#else
|
||||
typedef double fftw_real;
|
||||
#endif
|
||||
|
||||
/*********************************************
|
||||
* Complex numbers and operations
|
||||
*********************************************/
|
||||
typedef struct {
|
||||
fftw_real re, im;
|
||||
} fftw_complex;
|
||||
#define c_re(c) ((c).re)
|
||||
#define c_im(c) ((c).im)
|
||||
|
||||
typedef enum {
|
||||
FFTW_FORWARD = -1, FFTW_BACKWARD = 1
|
||||
} fftw_direction;
|
||||
|
||||
/* backward compatibility with FFTW-1.3 */
|
||||
typedef fftw_complex FFTW_COMPLEX;
|
||||
typedef fftw_real FFTW_REAL;
|
||||
|
||||
#ifndef FFTW_1_0_COMPATIBILITY
|
||||
#define FFTW_1_0_COMPATIBILITY 0
|
||||
#endif
|
||||
|
||||
#if FFTW_1_0_COMPATIBILITY
|
||||
/* backward compatibility with FFTW-1.0 */
|
||||
#define REAL fftw_real
|
||||
#define COMPLEX fftw_complex
|
||||
#endif
|
||||
|
||||
/*********************************************
|
||||
* Success or failure status
|
||||
*********************************************/
|
||||
|
||||
typedef enum {
|
||||
FFTW_SUCCESS = 0, FFTW_FAILURE = -1
|
||||
} fftw_status;
|
||||
|
||||
/*********************************************
|
||||
* Codelets
|
||||
*********************************************/
|
||||
typedef void (fftw_notw_codelet)
|
||||
(const fftw_complex *, fftw_complex *, int, int);
|
||||
typedef void (fftw_twiddle_codelet)
|
||||
(fftw_complex *, const fftw_complex *, int,
|
||||
int, int);
|
||||
typedef void (fftw_generic_codelet)
|
||||
(fftw_complex *, const fftw_complex *, int,
|
||||
int, int, int);
|
||||
typedef void (fftw_real2hc_codelet)
|
||||
(const fftw_real *, fftw_real *, fftw_real *,
|
||||
int, int, int);
|
||||
typedef void (fftw_hc2real_codelet)
|
||||
(const fftw_real *, const fftw_real *,
|
||||
fftw_real *, int, int, int);
|
||||
typedef void (fftw_hc2hc_codelet)
|
||||
(fftw_real *, const fftw_complex *,
|
||||
int, int, int);
|
||||
typedef void (fftw_rgeneric_codelet)
|
||||
(fftw_real *, const fftw_complex *, int,
|
||||
int, int, int);
|
||||
|
||||
/*********************************************
|
||||
* Configurations
|
||||
*********************************************/
|
||||
/*
|
||||
* A configuration is a database of all known codelets
|
||||
*/
|
||||
|
||||
enum fftw_node_type {
|
||||
FFTW_NOTW, FFTW_TWIDDLE, FFTW_GENERIC, FFTW_RADER,
|
||||
FFTW_REAL2HC, FFTW_HC2REAL, FFTW_HC2HC, FFTW_RGENERIC
|
||||
};
|
||||
|
||||
/* description of a codelet */
|
||||
typedef struct {
|
||||
const char *name; /* name of the codelet */
|
||||
void (*codelet) (); /* pointer to the codelet itself */
|
||||
int size; /* size of the codelet */
|
||||
fftw_direction dir; /* direction */
|
||||
enum fftw_node_type type; /* TWIDDLE or NO_TWIDDLE */
|
||||
int signature; /* unique id */
|
||||
int ntwiddle; /* number of twiddle factors */
|
||||
const int *twiddle_order; /*
|
||||
* array that determines the order
|
||||
* in which the codelet expects
|
||||
* the twiddle factors
|
||||
*/
|
||||
} fftw_codelet_desc;
|
||||
|
||||
/* On Win32, you need to do funny things to access global variables
|
||||
in shared libraries. Thanks to Andrew Sterian for this hack. */
|
||||
#ifdef HAVE_WIN32
|
||||
# if defined(BUILD_FFTW_DLL)
|
||||
# define DL_IMPORT(type) __declspec(dllexport) type
|
||||
# elif defined(USE_FFTW_DLL)
|
||||
# define DL_IMPORT(type) __declspec(dllimport) type
|
||||
# else
|
||||
# define DL_IMPORT(type) type
|
||||
# endif
|
||||
#else
|
||||
# define DL_IMPORT(type) type
|
||||
#endif
|
||||
|
||||
extern DL_IMPORT(const char *) fftw_version;
|
||||
|
||||
/*****************************
|
||||
* Plans
|
||||
*****************************/
|
||||
/*
|
||||
* A plan is a sequence of reductions to compute a FFT of
|
||||
* a given size. At each step, the FFT algorithm can:
|
||||
*
|
||||
* 1) apply a notw codelet, or
|
||||
* 2) recurse and apply a twiddle codelet, or
|
||||
* 3) apply the generic codelet.
|
||||
*/
|
||||
|
||||
/* structure that contains twiddle factors */
|
||||
typedef struct fftw_twiddle_struct {
|
||||
int n;
|
||||
const fftw_codelet_desc *cdesc;
|
||||
fftw_complex *twarray;
|
||||
struct fftw_twiddle_struct *next;
|
||||
int refcnt;
|
||||
} fftw_twiddle;
|
||||
|
||||
typedef struct fftw_rader_data_struct {
|
||||
struct fftw_plan_struct *plan;
|
||||
fftw_complex *omega;
|
||||
int g, ginv;
|
||||
int p, flags, refcount;
|
||||
struct fftw_rader_data_struct *next;
|
||||
fftw_codelet_desc *cdesc;
|
||||
} fftw_rader_data;
|
||||
|
||||
typedef void (fftw_rader_codelet)
|
||||
(fftw_complex *, const fftw_complex *, int,
|
||||
int, int, fftw_rader_data *);
|
||||
|
||||
/* structure that holds all the data needed for a given step */
|
||||
typedef struct fftw_plan_node_struct {
|
||||
enum fftw_node_type type;
|
||||
|
||||
union {
|
||||
/* nodes of type FFTW_NOTW */
|
||||
struct {
|
||||
int size;
|
||||
fftw_notw_codelet *codelet;
|
||||
const fftw_codelet_desc *codelet_desc;
|
||||
} notw;
|
||||
|
||||
/* nodes of type FFTW_TWIDDLE */
|
||||
struct {
|
||||
int size;
|
||||
fftw_twiddle_codelet *codelet;
|
||||
fftw_twiddle *tw;
|
||||
struct fftw_plan_node_struct *recurse;
|
||||
const fftw_codelet_desc *codelet_desc;
|
||||
} twiddle;
|
||||
|
||||
/* nodes of type FFTW_GENERIC */
|
||||
struct {
|
||||
int size;
|
||||
fftw_generic_codelet *codelet;
|
||||
fftw_twiddle *tw;
|
||||
struct fftw_plan_node_struct *recurse;
|
||||
} generic;
|
||||
|
||||
/* nodes of type FFTW_RADER */
|
||||
struct {
|
||||
int size;
|
||||
fftw_rader_codelet *codelet;
|
||||
fftw_rader_data *rader_data;
|
||||
fftw_twiddle *tw;
|
||||
struct fftw_plan_node_struct *recurse;
|
||||
} rader;
|
||||
|
||||
/* nodes of type FFTW_REAL2HC */
|
||||
struct {
|
||||
int size;
|
||||
fftw_real2hc_codelet *codelet;
|
||||
const fftw_codelet_desc *codelet_desc;
|
||||
} real2hc;
|
||||
|
||||
/* nodes of type FFTW_HC2REAL */
|
||||
struct {
|
||||
int size;
|
||||
fftw_hc2real_codelet *codelet;
|
||||
const fftw_codelet_desc *codelet_desc;
|
||||
} hc2real;
|
||||
|
||||
/* nodes of type FFTW_HC2HC */
|
||||
struct {
|
||||
int size;
|
||||
fftw_direction dir;
|
||||
fftw_hc2hc_codelet *codelet;
|
||||
fftw_twiddle *tw;
|
||||
struct fftw_plan_node_struct *recurse;
|
||||
const fftw_codelet_desc *codelet_desc;
|
||||
} hc2hc;
|
||||
|
||||
/* nodes of type FFTW_RGENERIC */
|
||||
struct {
|
||||
int size;
|
||||
fftw_direction dir;
|
||||
fftw_rgeneric_codelet *codelet;
|
||||
fftw_twiddle *tw;
|
||||
struct fftw_plan_node_struct *recurse;
|
||||
} rgeneric;
|
||||
} nodeu;
|
||||
|
||||
int refcnt;
|
||||
} fftw_plan_node;
|
||||
|
||||
typedef enum {
|
||||
FFTW_NORMAL_RECURSE = 0,
|
||||
FFTW_VECTOR_RECURSE = 1
|
||||
} fftw_recurse_kind;
|
||||
|
||||
struct fftw_plan_struct {
|
||||
int n;
|
||||
int refcnt;
|
||||
fftw_direction dir;
|
||||
int flags;
|
||||
int wisdom_signature;
|
||||
enum fftw_node_type wisdom_type;
|
||||
struct fftw_plan_struct *next;
|
||||
fftw_plan_node *root;
|
||||
double cost;
|
||||
fftw_recurse_kind recurse_kind;
|
||||
int vector_size;
|
||||
};
|
||||
|
||||
typedef struct fftw_plan_struct *fftw_plan;
|
||||
|
||||
/* flags for the planner */
|
||||
#define FFTW_ESTIMATE (0)
|
||||
#define FFTW_MEASURE (1)
|
||||
|
||||
#define FFTW_OUT_OF_PLACE (0)
|
||||
#define FFTW_IN_PLACE (8)
|
||||
#define FFTW_USE_WISDOM (16)
|
||||
|
||||
#define FFTW_THREADSAFE (128) /* guarantee plan is read-only so that the
|
||||
same plan can be used in parallel by
|
||||
multiple threads */
|
||||
|
||||
#define FFTWND_FORCE_BUFFERED (256) /* internal flag, forces buffering
|
||||
in fftwnd transforms */
|
||||
|
||||
#define FFTW_NO_VECTOR_RECURSE (512) /* internal flag, prevents use
|
||||
of vector recursion */
|
||||
|
||||
extern fftw_plan fftw_create_plan_specific(int n, fftw_direction dir,
|
||||
int flags,
|
||||
fftw_complex *in, int istride,
|
||||
fftw_complex *out, int ostride);
|
||||
#define FFTW_HAS_PLAN_SPECIFIC
|
||||
extern fftw_plan fftw_create_plan(int n, fftw_direction dir, int flags);
|
||||
extern void fftw_print_plan(fftw_plan plan);
|
||||
extern void fftw_destroy_plan(fftw_plan plan);
|
||||
extern void fftw(fftw_plan plan, int howmany, fftw_complex *in, int istride,
|
||||
int idist, fftw_complex *out, int ostride, int odist);
|
||||
extern void fftw_one(fftw_plan plan, fftw_complex *in, fftw_complex *out);
|
||||
extern void fftw_die(const char *s);
|
||||
extern void *fftw_malloc(size_t n);
|
||||
extern void fftw_free(void *p);
|
||||
extern void fftw_check_memory_leaks(void);
|
||||
extern void fftw_print_max_memory_usage(void);
|
||||
|
||||
typedef void *(*fftw_malloc_type_function) (size_t n);
|
||||
typedef void (*fftw_free_type_function) (void *p);
|
||||
typedef void (*fftw_die_type_function) (const char *errString);
|
||||
extern DL_IMPORT(fftw_malloc_type_function) fftw_malloc_hook;
|
||||
extern DL_IMPORT(fftw_free_type_function) fftw_free_hook;
|
||||
extern DL_IMPORT(fftw_die_type_function) fftw_die_hook;
|
||||
|
||||
extern size_t fftw_sizeof_fftw_real(void);
|
||||
|
||||
/* Wisdom: */
|
||||
/*
|
||||
* define this symbol so that users know we are using a version of FFTW
|
||||
* with wisdom
|
||||
*/
|
||||
#define FFTW_HAS_WISDOM
|
||||
extern void fftw_forget_wisdom(void);
|
||||
extern void fftw_export_wisdom(void (*emitter) (char c, void *), void *data);
|
||||
extern fftw_status fftw_import_wisdom(int (*g) (void *), void *data);
|
||||
extern void fftw_export_wisdom_to_file(FILE *output_file);
|
||||
extern fftw_status fftw_import_wisdom_from_file(FILE *input_file);
|
||||
extern char *fftw_export_wisdom_to_string(void);
|
||||
extern fftw_status fftw_import_wisdom_from_string(const char *input_string);
|
||||
|
||||
/*
|
||||
* define symbol so we know this function is available (it is not in
|
||||
* older FFTWs)
|
||||
*/
|
||||
#define FFTW_HAS_FPRINT_PLAN
|
||||
extern void fftw_fprint_plan(FILE *f, fftw_plan plan);
|
||||
|
||||
/*****************************
|
||||
* N-dimensional code
|
||||
*****************************/
|
||||
typedef struct {
|
||||
int is_in_place; /* 1 if for in-place FFTs, 0 otherwise */
|
||||
|
||||
int rank; /*
|
||||
* the rank (number of dimensions) of the
|
||||
* array to be FFTed
|
||||
*/
|
||||
int *n; /*
|
||||
* the dimensions of the array to the
|
||||
* FFTed
|
||||
*/
|
||||
fftw_direction dir;
|
||||
|
||||
int *n_before; /*
|
||||
* n_before[i] = product of n[j] for j < i
|
||||
*/
|
||||
int *n_after; /* n_after[i] = product of n[j] for j > i */
|
||||
|
||||
fftw_plan *plans; /* 1d fftw plans for each dimension */
|
||||
|
||||
int nbuffers, nwork;
|
||||
fftw_complex *work; /*
|
||||
* work array big enough to hold
|
||||
* nbuffers+1 of the largest dimension
|
||||
* (has nwork elements)
|
||||
*/
|
||||
} fftwnd_data;
|
||||
|
||||
typedef fftwnd_data *fftwnd_plan;
|
||||
|
||||
/* Initializing the FFTWND plan: */
|
||||
extern fftwnd_plan fftw2d_create_plan(int nx, int ny, fftw_direction dir,
|
||||
int flags);
|
||||
extern fftwnd_plan fftw3d_create_plan(int nx, int ny, int nz,
|
||||
fftw_direction dir, int flags);
|
||||
extern fftwnd_plan fftwnd_create_plan(int rank, const int *n,
|
||||
fftw_direction dir,
|
||||
int flags);
|
||||
|
||||
extern fftwnd_plan fftw2d_create_plan_specific(int nx, int ny,
|
||||
fftw_direction dir,
|
||||
int flags,
|
||||
fftw_complex *in, int istride,
|
||||
fftw_complex *out, int ostride);
|
||||
extern fftwnd_plan fftw3d_create_plan_specific(int nx, int ny, int nz,
|
||||
fftw_direction dir, int flags,
|
||||
fftw_complex *in, int istride,
|
||||
fftw_complex *out, int ostride);
|
||||
extern fftwnd_plan fftwnd_create_plan_specific(int rank, const int *n,
|
||||
fftw_direction dir,
|
||||
int flags,
|
||||
fftw_complex *in, int istride,
|
||||
fftw_complex *out, int ostride);
|
||||
|
||||
/* Freeing the FFTWND plan: */
|
||||
extern void fftwnd_destroy_plan(fftwnd_plan plan);
|
||||
|
||||
/* Printing the plan: */
|
||||
extern void fftwnd_fprint_plan(FILE *f, fftwnd_plan p);
|
||||
extern void fftwnd_print_plan(fftwnd_plan p);
|
||||
#define FFTWND_HAS_PRINT_PLAN
|
||||
|
||||
/* Computing the N-Dimensional FFT */
|
||||
extern void fftwnd(fftwnd_plan plan, int howmany,
|
||||
fftw_complex *in, int istride, int idist,
|
||||
fftw_complex *out, int ostride, int odist);
|
||||
extern void fftwnd_one(fftwnd_plan p, fftw_complex *in, fftw_complex *out);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
||||
#endif /* __cplusplus */
|
||||
#endif /* FFTW_H */
|
|
@ -1,305 +0,0 @@
|
|||
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006 Alexander Chemeris
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _MSC_INTTYPES_H_ // [
|
||||
#define _MSC_INTTYPES_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
// 7.8 Format conversion of integer types
|
||||
|
||||
typedef struct {
|
||||
intmax_t quot;
|
||||
intmax_t rem;
|
||||
} imaxdiv_t;
|
||||
|
||||
// 7.8.1 Macros for format specifiers
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198
|
||||
|
||||
// The fprintf macros for signed integers are:
|
||||
#define PRId8 "d"
|
||||
#define PRIi8 "i"
|
||||
#define PRIdLEAST8 "d"
|
||||
#define PRIiLEAST8 "i"
|
||||
#define PRIdFAST8 "d"
|
||||
#define PRIiFAST8 "i"
|
||||
|
||||
#define PRId16 "hd"
|
||||
#define PRIi16 "hi"
|
||||
#define PRIdLEAST16 "hd"
|
||||
#define PRIiLEAST16 "hi"
|
||||
#define PRIdFAST16 "hd"
|
||||
#define PRIiFAST16 "hi"
|
||||
|
||||
#define PRId32 "I32d"
|
||||
#define PRIi32 "I32i"
|
||||
#define PRIdLEAST32 "I32d"
|
||||
#define PRIiLEAST32 "I32i"
|
||||
#define PRIdFAST32 "I32d"
|
||||
#define PRIiFAST32 "I32i"
|
||||
|
||||
#define PRId64 "I64d"
|
||||
#define PRIi64 "I64i"
|
||||
#define PRIdLEAST64 "I64d"
|
||||
#define PRIiLEAST64 "I64i"
|
||||
#define PRIdFAST64 "I64d"
|
||||
#define PRIiFAST64 "I64i"
|
||||
|
||||
#define PRIdMAX "I64d"
|
||||
#define PRIiMAX "I64i"
|
||||
|
||||
#define PRIdPTR "Id"
|
||||
#define PRIiPTR "Ii"
|
||||
|
||||
// The fprintf macros for unsigned integers are:
|
||||
#define PRIo8 "o"
|
||||
#define PRIu8 "u"
|
||||
#define PRIx8 "x"
|
||||
#define PRIX8 "X"
|
||||
#define PRIoLEAST8 "o"
|
||||
#define PRIuLEAST8 "u"
|
||||
#define PRIxLEAST8 "x"
|
||||
#define PRIXLEAST8 "X"
|
||||
#define PRIoFAST8 "o"
|
||||
#define PRIuFAST8 "u"
|
||||
#define PRIxFAST8 "x"
|
||||
#define PRIXFAST8 "X"
|
||||
|
||||
#define PRIo16 "ho"
|
||||
#define PRIu16 "hu"
|
||||
#define PRIx16 "hx"
|
||||
#define PRIX16 "hX"
|
||||
#define PRIoLEAST16 "ho"
|
||||
#define PRIuLEAST16 "hu"
|
||||
#define PRIxLEAST16 "hx"
|
||||
#define PRIXLEAST16 "hX"
|
||||
#define PRIoFAST16 "ho"
|
||||
#define PRIuFAST16 "hu"
|
||||
#define PRIxFAST16 "hx"
|
||||
#define PRIXFAST16 "hX"
|
||||
|
||||
#define PRIo32 "I32o"
|
||||
#define PRIu32 "I32u"
|
||||
#define PRIx32 "I32x"
|
||||
#define PRIX32 "I32X"
|
||||
#define PRIoLEAST32 "I32o"
|
||||
#define PRIuLEAST32 "I32u"
|
||||
#define PRIxLEAST32 "I32x"
|
||||
#define PRIXLEAST32 "I32X"
|
||||
#define PRIoFAST32 "I32o"
|
||||
#define PRIuFAST32 "I32u"
|
||||
#define PRIxFAST32 "I32x"
|
||||
#define PRIXFAST32 "I32X"
|
||||
|
||||
#define PRIo64 "I64o"
|
||||
#define PRIu64 "I64u"
|
||||
#define PRIx64 "I64x"
|
||||
#define PRIX64 "I64X"
|
||||
#define PRIoLEAST64 "I64o"
|
||||
#define PRIuLEAST64 "I64u"
|
||||
#define PRIxLEAST64 "I64x"
|
||||
#define PRIXLEAST64 "I64X"
|
||||
#define PRIoFAST64 "I64o"
|
||||
#define PRIuFAST64 "I64u"
|
||||
#define PRIxFAST64 "I64x"
|
||||
#define PRIXFAST64 "I64X"
|
||||
|
||||
#define PRIoMAX "I64o"
|
||||
#define PRIuMAX "I64u"
|
||||
#define PRIxMAX "I64x"
|
||||
#define PRIXMAX "I64X"
|
||||
|
||||
#define PRIoPTR "Io"
|
||||
#define PRIuPTR "Iu"
|
||||
#define PRIxPTR "Ix"
|
||||
#define PRIXPTR "IX"
|
||||
|
||||
// The fscanf macros for signed integers are:
|
||||
#define SCNd8 "d"
|
||||
#define SCNi8 "i"
|
||||
#define SCNdLEAST8 "d"
|
||||
#define SCNiLEAST8 "i"
|
||||
#define SCNdFAST8 "d"
|
||||
#define SCNiFAST8 "i"
|
||||
|
||||
#define SCNd16 "hd"
|
||||
#define SCNi16 "hi"
|
||||
#define SCNdLEAST16 "hd"
|
||||
#define SCNiLEAST16 "hi"
|
||||
#define SCNdFAST16 "hd"
|
||||
#define SCNiFAST16 "hi"
|
||||
|
||||
#define SCNd32 "ld"
|
||||
#define SCNi32 "li"
|
||||
#define SCNdLEAST32 "ld"
|
||||
#define SCNiLEAST32 "li"
|
||||
#define SCNdFAST32 "ld"
|
||||
#define SCNiFAST32 "li"
|
||||
|
||||
#define SCNd64 "I64d"
|
||||
#define SCNi64 "I64i"
|
||||
#define SCNdLEAST64 "I64d"
|
||||
#define SCNiLEAST64 "I64i"
|
||||
#define SCNdFAST64 "I64d"
|
||||
#define SCNiFAST64 "I64i"
|
||||
|
||||
#define SCNdMAX "I64d"
|
||||
#define SCNiMAX "I64i"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNdPTR "I64d"
|
||||
# define SCNiPTR "I64i"
|
||||
#else // _WIN64 ][
|
||||
# define SCNdPTR "ld"
|
||||
# define SCNiPTR "li"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// The fscanf macros for unsigned integers are:
|
||||
#define SCNo8 "o"
|
||||
#define SCNu8 "u"
|
||||
#define SCNx8 "x"
|
||||
#define SCNX8 "X"
|
||||
#define SCNoLEAST8 "o"
|
||||
#define SCNuLEAST8 "u"
|
||||
#define SCNxLEAST8 "x"
|
||||
#define SCNXLEAST8 "X"
|
||||
#define SCNoFAST8 "o"
|
||||
#define SCNuFAST8 "u"
|
||||
#define SCNxFAST8 "x"
|
||||
#define SCNXFAST8 "X"
|
||||
|
||||
#define SCNo16 "ho"
|
||||
#define SCNu16 "hu"
|
||||
#define SCNx16 "hx"
|
||||
#define SCNX16 "hX"
|
||||
#define SCNoLEAST16 "ho"
|
||||
#define SCNuLEAST16 "hu"
|
||||
#define SCNxLEAST16 "hx"
|
||||
#define SCNXLEAST16 "hX"
|
||||
#define SCNoFAST16 "ho"
|
||||
#define SCNuFAST16 "hu"
|
||||
#define SCNxFAST16 "hx"
|
||||
#define SCNXFAST16 "hX"
|
||||
|
||||
#define SCNo32 "lo"
|
||||
#define SCNu32 "lu"
|
||||
#define SCNx32 "lx"
|
||||
#define SCNX32 "lX"
|
||||
#define SCNoLEAST32 "lo"
|
||||
#define SCNuLEAST32 "lu"
|
||||
#define SCNxLEAST32 "lx"
|
||||
#define SCNXLEAST32 "lX"
|
||||
#define SCNoFAST32 "lo"
|
||||
#define SCNuFAST32 "lu"
|
||||
#define SCNxFAST32 "lx"
|
||||
#define SCNXFAST32 "lX"
|
||||
|
||||
#define SCNo64 "I64o"
|
||||
#define SCNu64 "I64u"
|
||||
#define SCNx64 "I64x"
|
||||
#define SCNX64 "I64X"
|
||||
#define SCNoLEAST64 "I64o"
|
||||
#define SCNuLEAST64 "I64u"
|
||||
#define SCNxLEAST64 "I64x"
|
||||
#define SCNXLEAST64 "I64X"
|
||||
#define SCNoFAST64 "I64o"
|
||||
#define SCNuFAST64 "I64u"
|
||||
#define SCNxFAST64 "I64x"
|
||||
#define SCNXFAST64 "I64X"
|
||||
|
||||
#define SCNoMAX "I64o"
|
||||
#define SCNuMAX "I64u"
|
||||
#define SCNxMAX "I64x"
|
||||
#define SCNXMAX "I64X"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNoPTR "I64o"
|
||||
# define SCNuPTR "I64u"
|
||||
# define SCNxPTR "I64x"
|
||||
# define SCNXPTR "I64X"
|
||||
#else // _WIN64 ][
|
||||
# define SCNoPTR "lo"
|
||||
# define SCNuPTR "lu"
|
||||
# define SCNxPTR "lx"
|
||||
# define SCNXPTR "lX"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
#endif // __STDC_FORMAT_MACROS ]
|
||||
|
||||
// 7.8.2 Functions for greatest-width integer types
|
||||
|
||||
// 7.8.2.1 The imaxabs function
|
||||
#define imaxabs _abs64
|
||||
|
||||
// 7.8.2.2 The imaxdiv function
|
||||
|
||||
// This is modified version of div() function from Microsoft's div.c found
|
||||
// in %MSVC.NET%\crt\src\div.c
|
||||
#ifdef STATIC_IMAXDIV // [
|
||||
static
|
||||
#else // STATIC_IMAXDIV ][
|
||||
_inline
|
||||
#endif // STATIC_IMAXDIV ]
|
||||
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
|
||||
{
|
||||
imaxdiv_t result;
|
||||
|
||||
result.quot = numer / denom;
|
||||
result.rem = numer % denom;
|
||||
|
||||
if (numer < 0 && result.rem > 0) {
|
||||
// did division wrong; must fix up
|
||||
++result.quot;
|
||||
result.rem -= denom;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 7.8.2.3 The strtoimax and strtoumax functions
|
||||
#define strtoimax _strtoi64
|
||||
#define strtoumax _strtoui64
|
||||
|
||||
// 7.8.2.4 The wcstoimax and wcstoumax functions
|
||||
#define wcstoimax _wcstoi64
|
||||
#define wcstoumax _wcstoui64
|
||||
|
||||
|
||||
#endif // _MSC_INTTYPES_H_ ]
|
|
@ -1,10 +0,0 @@
|
|||
#include "sleep.h"
|
||||
#include "windows.h"
|
||||
|
||||
void usleep (int x)
|
||||
{
|
||||
int y = x;
|
||||
y = x/1000;
|
||||
|
||||
Sleep(y);
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
void usleep(int x);
|
|
@ -1,247 +0,0 @@
|
|||
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006-2008 Alexander Chemeris
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _MSC_STDINT_H_ // [
|
||||
#define _MSC_STDINT_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
|
||||
// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
|
||||
// or compiler give many errors like this:
|
||||
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
# include <wchar.h>
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
// Define _W64 macros to mark types changing their size, like intptr_t.
|
||||
#ifndef _W64
|
||||
# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
|
||||
# define _W64 __w64
|
||||
# else
|
||||
# define _W64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
// 7.18.1 Integer types
|
||||
|
||||
// 7.18.1.1 Exact-width integer types
|
||||
|
||||
// Visual Studio 6 and Embedded Visual C++ 4 doesn't
|
||||
// realize that, e.g. char has the same size as __int8
|
||||
// so we give up on __intX for them.
|
||||
#if (_MSC_VER < 1300)
|
||||
typedef signed char int8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
#else
|
||||
typedef signed __int8 int8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
#endif
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
|
||||
|
||||
// 7.18.1.2 Minimum-width integer types
|
||||
typedef int8_t int_least8_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef int64_t int_least64_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
|
||||
// 7.18.1.3 Fastest minimum-width integer types
|
||||
typedef int8_t int_fast8_t;
|
||||
typedef int16_t int_fast16_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
typedef int64_t int_fast64_t;
|
||||
typedef uint8_t uint_fast8_t;
|
||||
typedef uint16_t uint_fast16_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
typedef uint64_t uint_fast64_t;
|
||||
|
||||
// 7.18.1.4 Integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
typedef signed __int64 intptr_t;
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else // _WIN64 ][
|
||||
typedef _W64 signed int intptr_t;
|
||||
typedef _W64 unsigned int uintptr_t;
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.1.5 Greatest-width integer types
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
|
||||
|
||||
// 7.18.2 Limits of specified-width integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
|
||||
|
||||
// 7.18.2.1 Limits of exact-width integer types
|
||||
#define INT8_MIN ((int8_t)_I8_MIN)
|
||||
#define INT8_MAX _I8_MAX
|
||||
#define INT16_MIN ((int16_t)_I16_MIN)
|
||||
#define INT16_MAX _I16_MAX
|
||||
#define INT32_MIN ((int32_t)_I32_MIN)
|
||||
#define INT32_MAX _I32_MAX
|
||||
#define INT64_MIN ((int64_t)_I64_MIN)
|
||||
#define INT64_MAX _I64_MAX
|
||||
#define UINT8_MAX _UI8_MAX
|
||||
#define UINT16_MAX _UI16_MAX
|
||||
#define UINT32_MAX _UI32_MAX
|
||||
#define UINT64_MAX _UI64_MAX
|
||||
|
||||
// 7.18.2.2 Limits of minimum-width integer types
|
||||
#define INT_LEAST8_MIN INT8_MIN
|
||||
#define INT_LEAST8_MAX INT8_MAX
|
||||
#define INT_LEAST16_MIN INT16_MIN
|
||||
#define INT_LEAST16_MAX INT16_MAX
|
||||
#define INT_LEAST32_MIN INT32_MIN
|
||||
#define INT_LEAST32_MAX INT32_MAX
|
||||
#define INT_LEAST64_MIN INT64_MIN
|
||||
#define INT_LEAST64_MAX INT64_MAX
|
||||
#define UINT_LEAST8_MAX UINT8_MAX
|
||||
#define UINT_LEAST16_MAX UINT16_MAX
|
||||
#define UINT_LEAST32_MAX UINT32_MAX
|
||||
#define UINT_LEAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.3 Limits of fastest minimum-width integer types
|
||||
#define INT_FAST8_MIN INT8_MIN
|
||||
#define INT_FAST8_MAX INT8_MAX
|
||||
#define INT_FAST16_MIN INT16_MIN
|
||||
#define INT_FAST16_MAX INT16_MAX
|
||||
#define INT_FAST32_MIN INT32_MIN
|
||||
#define INT_FAST32_MAX INT32_MAX
|
||||
#define INT_FAST64_MIN INT64_MIN
|
||||
#define INT_FAST64_MAX INT64_MAX
|
||||
#define UINT_FAST8_MAX UINT8_MAX
|
||||
#define UINT_FAST16_MAX UINT16_MAX
|
||||
#define UINT_FAST32_MAX UINT32_MAX
|
||||
#define UINT_FAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.4 Limits of integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
# define INTPTR_MIN INT64_MIN
|
||||
# define INTPTR_MAX INT64_MAX
|
||||
# define UINTPTR_MAX UINT64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define INTPTR_MIN INT32_MIN
|
||||
# define INTPTR_MAX INT32_MAX
|
||||
# define UINTPTR_MAX UINT32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.2.5 Limits of greatest-width integer types
|
||||
#define INTMAX_MIN INT64_MIN
|
||||
#define INTMAX_MAX INT64_MAX
|
||||
#define UINTMAX_MAX UINT64_MAX
|
||||
|
||||
// 7.18.3 Limits of other integer types
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define PTRDIFF_MIN _I64_MIN
|
||||
# define PTRDIFF_MAX _I64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define PTRDIFF_MIN _I32_MIN
|
||||
# define PTRDIFF_MAX _I32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
#define SIG_ATOMIC_MIN INT_MIN
|
||||
#define SIG_ATOMIC_MAX INT_MAX
|
||||
|
||||
#ifndef SIZE_MAX // [
|
||||
# ifdef _WIN64 // [
|
||||
# define SIZE_MAX _UI64_MAX
|
||||
# else // _WIN64 ][
|
||||
# define SIZE_MAX _UI32_MAX
|
||||
# endif // _WIN64 ]
|
||||
#endif // SIZE_MAX ]
|
||||
|
||||
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
|
||||
#ifndef WCHAR_MIN // [
|
||||
# define WCHAR_MIN 0
|
||||
#endif // WCHAR_MIN ]
|
||||
#ifndef WCHAR_MAX // [
|
||||
# define WCHAR_MAX _UI16_MAX
|
||||
#endif // WCHAR_MAX ]
|
||||
|
||||
#define WINT_MIN 0
|
||||
#define WINT_MAX _UI16_MAX
|
||||
|
||||
#endif // __STDC_LIMIT_MACROS ]
|
||||
|
||||
|
||||
// 7.18.4 Limits of other integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
|
||||
|
||||
// 7.18.4.1 Macros for minimum-width integer constants
|
||||
|
||||
#define INT8_C(val) val##i8
|
||||
#define INT16_C(val) val##i16
|
||||
#define INT32_C(val) val##i32
|
||||
#define INT64_C(val) val##i64
|
||||
|
||||
#define UINT8_C(val) val##ui8
|
||||
#define UINT16_C(val) val##ui16
|
||||
#define UINT32_C(val) val##ui32
|
||||
#define UINT64_C(val) val##ui64
|
||||
|
||||
// 7.18.4.2 Macros for greatest-width integer constants
|
||||
#define INTMAX_C INT64_C
|
||||
#define UINTMAX_C UINT64_C
|
||||
|
||||
#endif // __STDC_CONSTANT_MACROS ]
|
||||
|
||||
|
||||
#endif // _MSC_STDINT_H_ ]
|
|
@ -1,28 +0,0 @@
|
|||
#ifndef GETTIMEOFDAY_H
|
||||
#define GETTIMEOFDAY_H
|
||||
|
||||
//#include <config.h>
|
||||
#include <sys/timeb.h>
|
||||
//#include "../include/time.h"
|
||||
|
||||
|
||||
struct timeval
|
||||
{
|
||||
time_t tv_sec;
|
||||
time_t tv_usec;
|
||||
};
|
||||
|
||||
|
||||
__inline int gettimeofday(struct timeval *tp, void *tzp)
|
||||
{
|
||||
|
||||
struct _timeb timebuffer;
|
||||
|
||||
_ftime(&timebuffer);
|
||||
tp->tv_sec = timebuffer.time;
|
||||
tp->tv_usec = timebuffer.millitm * 1000;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* GETTIMEOFDAY_H */
|
|
@ -1 +0,0 @@
|
|||
# include <direct.h>
|
|
@ -1,9 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\MOLECULE\angle_charmm.h"
|
||||
#include "..\..\MOLECULE\angle_cosine.h"
|
||||
#include "..\..\MOLECULE\angle_cosine_delta.h"
|
||||
#include "..\..\MOLECULE\angle_cosine_periodic.h"
|
||||
#include "..\..\MOLECULE\angle_cosine_squared.h"
|
||||
#include "..\..\MOLECULE\angle_harmonic.h"
|
||||
#include "..\..\MOLECULE\angle_hybrid.h"
|
||||
#include "..\..\MOLECULE\angle_table.h"
|
|
@ -1,12 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\atom_vec_atomic.h"
|
||||
#include "..\..\atom_vec_charge.h"
|
||||
#include "..\..\atom_vec_ellipsoid.h"
|
||||
#include "..\..\atom_vec_hybrid.h"
|
||||
#include "..\..\atom_vec_line.h"
|
||||
#include "..\..\atom_vec_sphere.h"
|
||||
#include "..\..\atom_vec_tri.h"
|
||||
#include "..\..\MOLECULE\atom_vec_angle.h"
|
||||
#include "..\..\MOLECULE\atom_vec_bond.h"
|
||||
#include "..\..\MOLECULE\atom_vec_full.h"
|
||||
#include "..\..\MOLECULE\atom_vec_molecular.h"
|
|
@ -1,9 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\bond_hybrid.h"
|
||||
#include "..\..\MOLECULE\bond_fene.h"
|
||||
#include "..\..\MOLECULE\bond_fene_expand.h"
|
||||
#include "..\..\MOLECULE\bond_harmonic.h"
|
||||
#include "..\..\MOLECULE\bond_morse.h"
|
||||
#include "..\..\MOLECULE\bond_nonlinear.h"
|
||||
#include "..\..\MOLECULE\bond_quartic.h"
|
||||
#include "..\..\MOLECULE\bond_table.h"
|
|
@ -1,16 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\balance.h"
|
||||
#include "..\..\change_box.h"
|
||||
#include "..\..\create_atoms.h"
|
||||
#include "..\..\create_box.h"
|
||||
#include "..\..\delete_atoms.h"
|
||||
#include "..\..\delete_bonds.h"
|
||||
#include "..\..\displace_atoms.h"
|
||||
#include "..\..\minimize.h"
|
||||
#include "..\..\read_data.h"
|
||||
#include "..\..\read_restart.h"
|
||||
#include "..\..\replicate.h"
|
||||
#include "..\..\run.h"
|
||||
#include "..\..\set.h"
|
||||
#include "..\..\velocity.h"
|
||||
#include "..\..\write_restart.h"
|
|
@ -1,44 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\compute_angle_local.h"
|
||||
#include "..\..\compute_atom_molecule.h"
|
||||
#include "..\..\compute_bond_local.h"
|
||||
#include "..\..\compute_centro_atom.h"
|
||||
#include "..\..\compute_cluster_atom.h"
|
||||
#include "..\..\compute_cna_atom.h"
|
||||
#include "..\..\compute_com.h"
|
||||
#include "..\..\compute_com_molecule.h"
|
||||
#include "..\..\compute_coord_atom.h"
|
||||
#include "..\..\compute_dihedral_local.h"
|
||||
#include "..\..\compute_displace_atom.h"
|
||||
#include "..\..\compute_erotate_sphere.h"
|
||||
#include "..\..\compute_group_group.h"
|
||||
#include "..\..\compute_gyration.h"
|
||||
#include "..\..\compute_gyration_molecule.h"
|
||||
#include "..\..\compute_heat_flux.h"
|
||||
#include "..\..\compute_improper_local.h"
|
||||
#include "..\..\compute_ke.h"
|
||||
#include "..\..\compute_ke_atom.h"
|
||||
#include "..\..\compute_msd.h"
|
||||
#include "..\..\compute_msd_molecule.h"
|
||||
#include "..\..\compute_pair.h"
|
||||
#include "..\..\compute_pair_local.h"
|
||||
#include "..\..\compute_pe.h"
|
||||
#include "..\..\compute_pe_atom.h"
|
||||
#include "..\..\compute_pressure.h"
|
||||
#include "..\..\compute_property_atom.h"
|
||||
#include "..\..\compute_property_local.h"
|
||||
#include "..\..\compute_property_molecule.h"
|
||||
#include "..\..\compute_rdf.h"
|
||||
#include "..\..\compute_reduce.h"
|
||||
#include "..\..\compute_reduce_region.h"
|
||||
#include "..\..\compute_slice.h"
|
||||
#include "..\..\compute_stress_atom.h"
|
||||
#include "..\..\compute_temp.h"
|
||||
#include "..\..\compute_temp_com.h"
|
||||
#include "..\..\compute_temp_deform.h"
|
||||
#include "..\..\compute_temp_partial.h"
|
||||
#include "..\..\compute_temp_profile.h"
|
||||
#include "..\..\compute_temp_ramp.h"
|
||||
#include "..\..\compute_temp_region.h"
|
||||
#include "..\..\compute_temp_sphere.h"
|
||||
#include "..\..\compute_ti.h"
|
|
@ -1,7 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\MOLECULE\dihedral_charmm.h"
|
||||
#include "..\..\MOLECULE\dihedral_harmonic.h"
|
||||
#include "..\..\MOLECULE\dihedral_helix.h"
|
||||
#include "..\..\MOLECULE\dihedral_hybrid.h"
|
||||
#include "..\..\MOLECULE\dihedral_multi_harmonic.h"
|
||||
#include "..\..\MOLECULE\dihedral_opls.h"
|
|
@ -1,8 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\dump_atom.h"
|
||||
#include "..\..\dump_cfg.h"
|
||||
#include "..\..\dump_custom.h"
|
||||
#include "..\..\dump_dcd.h"
|
||||
#include "..\..\dump_image.h"
|
||||
#include "..\..\dump_local.h"
|
||||
#include "..\..\dump_xyz.h"
|
|
@ -1,69 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\fix_adapt.h"
|
||||
#include "..\..\fix_addforce.h"
|
||||
#include "..\..\fix_aveforce.h"
|
||||
#include "..\..\fix_ave_atom.h"
|
||||
#include "..\..\fix_ave_correlate.h"
|
||||
#include "..\..\fix_ave_histo.h"
|
||||
#include "..\..\fix_ave_spatial.h"
|
||||
#include "..\..\fix_ave_time.h"
|
||||
#include "..\..\fix_box_relax.h"
|
||||
#include "..\..\fix_deform.h"
|
||||
#include "..\..\fix_deposit.h"
|
||||
#include "..\..\fix_drag.h"
|
||||
#include "..\..\fix_dt_reset.h"
|
||||
#include "..\..\fix_efield.h"
|
||||
#include "..\..\fix_enforce2d.h"
|
||||
#include "..\..\fix_evaporate.h"
|
||||
#include "..\..\fix_external.h"
|
||||
#include "..\..\fix_gravity.h"
|
||||
#include "..\..\fix_heat.h"
|
||||
#include "..\..\fix_indent.h"
|
||||
#include "..\..\fix_langevin.h"
|
||||
#include "..\..\fix_lineforce.h"
|
||||
#include "..\..\fix_minimize.h"
|
||||
#include "..\..\fix_momentum.h"
|
||||
#include "..\..\fix_move.h"
|
||||
#include "..\..\fix_nph.h"
|
||||
#include "..\..\fix_nph_sphere.h"
|
||||
#include "..\..\fix_npt.h"
|
||||
#include "..\..\fix_npt_sphere.h"
|
||||
#include "..\..\fix_nve.h"
|
||||
#include "..\..\fix_nve_limit.h"
|
||||
#include "..\..\fix_nve_noforce.h"
|
||||
#include "..\..\fix_nve_sphere.h"
|
||||
#include "..\..\fix_nvt.h"
|
||||
#include "..\..\fix_nvt_sllod.h"
|
||||
#include "..\..\fix_nvt_sphere.h"
|
||||
#include "..\..\fix_orient_fcc.h"
|
||||
#include "..\..\fix_planeforce.h"
|
||||
#include "..\..\fix_press_berendsen.h"
|
||||
#include "..\..\fix_print.h"
|
||||
#include "..\..\fix_read_restart.h"
|
||||
#include "..\..\fix_recenter.h"
|
||||
#include "..\..\fix_respa.h"
|
||||
#include "..\..\fix_restrain.h"
|
||||
#include "..\..\fix_rigid.h"
|
||||
#include "..\..\fix_rigid_nve.h"
|
||||
#include "..\..\fix_rigid_nvt.h"
|
||||
#include "..\..\fix_setforce.h"
|
||||
#include "..\..\fix_shake.h"
|
||||
#include "..\..\fix_shear_history.h"
|
||||
#include "..\..\fix_spring.h"
|
||||
#include "..\..\fix_spring_rg.h"
|
||||
#include "..\..\fix_spring_self.h"
|
||||
#include "..\..\fix_store_force.h"
|
||||
#include "..\..\fix_store_state.h"
|
||||
#include "..\..\fix_temp_berendsen.h"
|
||||
#include "..\..\fix_temp_rescale.h"
|
||||
#include "..\..\fix_thermal_conductivity.h"
|
||||
#include "..\..\fix_tmd.h"
|
||||
#include "..\..\fix_ttm.h"
|
||||
#include "..\..\fix_viscosity.h"
|
||||
#include "..\..\fix_viscous.h"
|
||||
#include "..\..\fix_wall_harmonic.h"
|
||||
#include "..\..\fix_wall_lj126.h"
|
||||
#include "..\..\fix_wall_lj93.h"
|
||||
#include "..\..\fix_wall_reflect.h"
|
||||
#include "..\..\fix_wall_region.h"
|
||||
#include "..\..\MANYBODY\fix_qeq_comb.h"
|
|
@ -1,5 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\MOLECULE\improper_cvff.h"
|
||||
#include "..\..\MOLECULE\improper_harmonic.h"
|
||||
#include "..\..\MOLECULE\improper_hybrid.h"
|
||||
#include "..\..\MOLECULE\improper_umbrella.h"
|
|
@ -1,3 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\respa.h"
|
||||
#include "..\..\verlet.h"
|
|
@ -1,5 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\KSPACE\ewald.h"
|
||||
#include "..\..\KSPACE\pppm.h"
|
||||
#include "..\..\KSPACE\pppm_cg.h"
|
||||
#include "..\..\KSPACE\pppm_tip4p.h"
|
|
@ -1,6 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\min_cg.h"
|
||||
#include "..\..\min_fire.h"
|
||||
#include "..\..\min_hftn.h"
|
||||
#include "..\..\min_quickmin.h"
|
||||
#include "..\..\min_sd.h"
|
|
@ -1,49 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\pair_beck.h"
|
||||
#include "..\..\pair_born.h"
|
||||
#include "..\..\pair_born_coul_wolf.h"
|
||||
#include "..\..\pair_buck.h"
|
||||
#include "..\..\pair_buck_coul_cut.h"
|
||||
#include "..\..\pair_coul_cut.h"
|
||||
#include "..\..\pair_coul_debye.h"
|
||||
#include "..\..\pair_coul_wolf.h"
|
||||
#include "..\..\pair_dpd.h"
|
||||
#include "..\..\pair_dpd_tstat.h"
|
||||
#include "..\..\pair_gauss.h"
|
||||
#include "..\..\pair_hybrid.h"
|
||||
#include "..\..\pair_hybrid_overlay.h"
|
||||
#include "..\..\pair_lj96_cut.h"
|
||||
#include "..\..\pair_lj_cubic.h"
|
||||
#include "..\..\pair_lj_cut.h"
|
||||
#include "..\..\pair_lj_cut_coul_cut.h"
|
||||
#include "..\..\pair_lj_cut_coul_debye.h"
|
||||
#include "..\..\pair_lj_expand.h"
|
||||
#include "..\..\pair_lj_gromacs.h"
|
||||
#include "..\..\pair_lj_gromacs_coul_gromacs.h"
|
||||
#include "..\..\pair_lj_smooth.h"
|
||||
#include "..\..\pair_lj_smooth_linear.h"
|
||||
#include "..\..\pair_morse.h"
|
||||
#include "..\..\pair_soft.h"
|
||||
#include "..\..\pair_table.h"
|
||||
#include "..\..\pair_yukawa.h"
|
||||
#include "..\..\MANYBODY\pair_adp.h"
|
||||
#include "..\..\MANYBODY\pair_airebo.h"
|
||||
#include "..\..\MANYBODY\pair_comb.h"
|
||||
#include "..\..\MANYBODY\pair_eam.h"
|
||||
#include "..\..\MANYBODY\pair_eam_alloy.h"
|
||||
#include "..\..\MANYBODY\pair_eam_fs.h"
|
||||
#include "..\..\MANYBODY\pair_eim.h"
|
||||
#include "..\..\MANYBODY\pair_rebo.h"
|
||||
#include "..\..\MANYBODY\pair_sw.h"
|
||||
#include "..\..\MANYBODY\pair_tersoff.h"
|
||||
#include "..\..\MANYBODY\pair_tersoff_zbl.h"
|
||||
#include "..\..\KSPACE\pair_born_coul_long.h"
|
||||
#include "..\..\KSPACE\pair_buck_coul_long.h"
|
||||
#include "..\..\KSPACE\pair_coul_long.h"
|
||||
#include "..\..\KSPACE\pair_lj_charmm_coul_long.h"
|
||||
#include "..\..\KSPACE\pair_lj_cut_coul_long.h"
|
||||
#include "..\..\KSPACE\pair_lj_cut_coul_long_tip4p.h"
|
||||
#include "..\..\MOLECULE\pair_hbond_dreiding_lj.h"
|
||||
#include "..\..\MOLECULE\pair_hbond_dreiding_morse.h"
|
||||
#include "..\..\MOLECULE\pair_lj_charmm_coul_charmm.h"
|
||||
#include "..\..\MOLECULE\pair_lj_charmm_coul_charmm_implicit.h"
|
|
@ -1,9 +0,0 @@
|
|||
// File is generaged by ListModules() macro
|
||||
#include "..\..\region_block.h"
|
||||
#include "..\..\region_cone.h"
|
||||
#include "..\..\region_cylinder.h"
|
||||
#include "..\..\region_intersect.h"
|
||||
#include "..\..\region_plane.h"
|
||||
#include "..\..\region_prism.h"
|
||||
#include "..\..\region_sphere.h"
|
||||
#include "..\..\region_union.h"
|
|
@ -182,9 +182,6 @@ void FixWallRegion::post_force(int vflag)
|
|||
int i,m,n;
|
||||
double rinv,fx,fy,fz,tooclose;
|
||||
|
||||
eflag = 0;
|
||||
ewall[0] = ewall[1] = ewall[2] = ewall[3] = 0.0;
|
||||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
double *radius = atom->radius;
|
||||
|
@ -199,6 +196,11 @@ void FixWallRegion::post_force(int vflag)
|
|||
// region->match() insures particle is in region or on surface, else error
|
||||
// if returned contact dist r = 0, is on surface, also an error
|
||||
// in COLLOID case, r <= radius is an error
|
||||
// initilize ewall after region->prematch(),
|
||||
// so a dynamic region can access last timestep values
|
||||
|
||||
eflag = 0;
|
||||
ewall[0] = ewall[1] = ewall[2] = ewall[3] = 0.0;
|
||||
|
||||
for (i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit) {
|
||||
|
|
Loading…
Reference in New Issue