git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@937 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2007-10-03 16:22:30 +00:00
parent 92ff097469
commit 9be7620ace
96 changed files with 3347 additions and 3735 deletions

View File

@ -28,7 +28,7 @@ Memory::Memory(LAMMPS *lmp) : Pointers(lmp) {}
safe malloc
------------------------------------------------------------------------- */
void *Memory::smalloc(int n, char *name)
void *Memory::smalloc(int n, const char *name)
{
if (n == 0) return NULL;
void *ptr = malloc(n);
@ -54,7 +54,7 @@ void Memory::sfree(void *ptr)
safe realloc
------------------------------------------------------------------------- */
void *Memory::srealloc(void *ptr, int n, char *name)
void *Memory::srealloc(void *ptr, int n, const char *name)
{
if (n == 0) return NULL;
ptr = realloc(ptr,n);
@ -70,7 +70,7 @@ void *Memory::srealloc(void *ptr, int n, char *name)
create a 1d double array with index from nlo to nhi inclusive
------------------------------------------------------------------------- */
double *Memory::create_1d_double_array(int nlo, int nhi, char *name)
double *Memory::create_1d_double_array(int nlo, int nhi, const char *name)
{
int n = nhi - nlo + 1;
double *array = (double *) smalloc(n*sizeof(double),name);
@ -91,7 +91,7 @@ void Memory::destroy_1d_double_array(double *array, int offset)
create a 2d double array
------------------------------------------------------------------------- */
double **Memory::create_2d_double_array(int n1, int n2, char *name)
double **Memory::create_2d_double_array(int n1, int n2, const char *name)
{
double *data = (double *) smalloc(n1*n2*sizeof(double),name);
@ -125,7 +125,7 @@ void Memory::destroy_2d_double_array(double **array)
------------------------------------------------------------------------- */
double **Memory::grow_2d_double_array(double **array,
int n1, int n2, char *name)
int n1, int n2, const char *name)
{
if (array == NULL) return create_2d_double_array(n1,n2,name);
@ -147,7 +147,7 @@ double **Memory::grow_2d_double_array(double **array,
if either dim is 0, return NULL
------------------------------------------------------------------------- */
int **Memory::create_2d_int_array(int n1, int n2, char *name)
int **Memory::create_2d_int_array(int n1, int n2, const char *name)
{
if (n1 == 0 || n2 == 0) return NULL;
@ -182,7 +182,7 @@ void Memory::destroy_2d_int_array(int **array)
if either dim is 0, return NULL
------------------------------------------------------------------------- */
int **Memory::grow_2d_int_array(int **array, int n1, int n2, char *name)
int **Memory::grow_2d_int_array(int **array, int n1, int n2, const char *name)
{
if (n1 == 0 || n2 == 0) {
@ -208,7 +208,8 @@ int **Memory::grow_2d_int_array(int **array, int n1, int n2, char *name)
create a 2d double array with 2nd index from n2lo to n2hi inclusive
------------------------------------------------------------------------- */
double **Memory::create_2d_double_array(int n1, int n2lo, int n2hi, char *name)
double **Memory::create_2d_double_array(int n1, int n2lo, int n2hi,
const char *name)
{
int n2 = n2hi - n2lo + 1;
double **array = create_2d_double_array(n1,n2,name);
@ -232,7 +233,8 @@ void Memory::destroy_2d_double_array(double **array, int offset)
create a 3d double array
------------------------------------------------------------------------- */
double ***Memory::create_3d_double_array(int n1, int n2, int n3, char *name)
double ***Memory::create_3d_double_array(int n1, int n2, int n3,
const char *name)
{
int i,j;
@ -271,7 +273,8 @@ void Memory::destroy_3d_double_array(double ***array)
------------------------------------------------------------------------- */
double ***Memory::grow_3d_double_array(double ***array,
int n1, int n2, int n3, char *name)
int n1, int n2, int n3,
const char *name)
{
int i,j;
@ -303,7 +306,7 @@ double ***Memory::grow_3d_double_array(double ***array,
------------------------------------------------------------------------- */
double ***Memory::create_3d_double_array(int n1lo, int n1hi,
int n2, int n3, char *name)
int n2, int n3, const char *name)
{
int n1 = n1hi - n1lo + 1;
double ***array = create_3d_double_array(n1,n2,n3,name);
@ -328,7 +331,7 @@ void Memory::destroy_3d_double_array(double ***array, int offset)
double ***Memory::create_3d_double_array(int n1lo, int n1hi,
int n2lo, int n2hi,
int n3lo, int n3hi, char *name)
int n3lo, int n3hi, const char *name)
{
int n1 = n1hi - n1lo + 1;
int n2 = n2hi - n2lo + 1;
@ -358,7 +361,7 @@ void Memory::destroy_3d_double_array(double ***array, int n1_offset,
create a 3d int array
------------------------------------------------------------------------- */
int ***Memory::create_3d_int_array(int n1, int n2, int n3, char *name)
int ***Memory::create_3d_int_array(int n1, int n2, int n3, const char *name)
{
int i,j;
@ -394,7 +397,8 @@ void Memory::destroy_3d_int_array(int ***array)
create a 4d double array
------------------------------------------------------------------------- */
double ****Memory::create_4d_double_array(int n1, int n2, int n3, int n4, char *name)
double ****Memory::create_4d_double_array(int n1, int n2, int n3, int n4,
const char *name)
{
int i,j,k;