git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11996 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -896,7 +896,7 @@ void Input::partition()
|
||||
{
|
||||
if (narg < 3) error->all(FLERR,"Illegal partition command");
|
||||
|
||||
int yesflag=-1;
|
||||
int yesflag;
|
||||
if (strcmp(arg[0],"yes") == 0) yesflag = 1;
|
||||
else if (strcmp(arg[0],"no") == 0) yesflag = 0;
|
||||
else error->all(FLERR,"Illegal partition command");
|
||||
|
||||
@ -3656,41 +3656,6 @@ double Variable::constant(char *word)
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
read a floating point value from a string
|
||||
generate an error if not a legitimate floating point value
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double Variable::numeric(char *str)
|
||||
{
|
||||
int n = strlen(str);
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (isdigit(str[i])) continue;
|
||||
if (str[i] == '-' || str[i] == '+' || str[i] == '.') continue;
|
||||
if (str[i] == 'e' || str[i] == 'E') continue;
|
||||
error->all(FLERR,
|
||||
"Expected floating point parameter in variable definition");
|
||||
}
|
||||
|
||||
return atof(str);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
read an integer value from a string
|
||||
generate an error if not a legitimate integer value
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int Variable::inumeric(char *str)
|
||||
{
|
||||
int n = strlen(str);
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue;
|
||||
error->all(FLERR,"Expected integer parameter in variable definition");
|
||||
}
|
||||
|
||||
return atoi(str);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
find next comma in str
|
||||
skip commas inside one or more nested parenthesis
|
||||
|
||||
@ -90,8 +90,6 @@ class Variable : protected Pointers {
|
||||
void atom_vector(char *, Tree **, Tree **, int &);
|
||||
int is_constant(char *);
|
||||
double constant(char *);
|
||||
double numeric(char *);
|
||||
int inumeric(char *);
|
||||
char *find_next_comma(char *);
|
||||
void print_tree(Tree *, int);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user