Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plumed AlphaFold
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Kurečka
Plumed AlphaFold
Commits
9821932d
There was an error fetching the commit references. Please try again later.
Commit
9821932d
authored
13 years ago
by
Giovanni Bussi
Browse files
Options
Downloads
Patches
Plain Diff
Added documentation
parent
f45b4149
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Tools.h
+15
-21
15 additions, 21 deletions
src/Tools.h
with
15 additions
and
21 deletions
src/Tools.h
+
15
−
21
View file @
9821932d
...
...
@@ -26,27 +26,33 @@ public:
static
bool
getParsedLine
(
std
::
FILE
*
fp
,
std
::
vector
<
std
::
string
>
&
line
);
/// Convert a string to a double, reading it
static
bool
convert
(
const
std
::
string
&
str
,
double
&
t
);
/// Convert a string to a int, reading it
static
bool
convert
(
const
std
::
string
&
str
,
int
&
t
);
/// Convert a string to a string (i.e. copy)
static
bool
convert
(
const
std
::
string
&
str
,
std
::
string
&
t
);
/// Convert an int to a string
static
void
convert
(
int
i
,
std
::
string
&
str
);
/// Remove trailing blanks
static
void
trim
(
std
::
string
&
s
);
/// Remove trailing comments
static
void
trimComments
(
std
::
string
&
s
);
/// Apply pbc for a unitary cell
static
double
pbc
(
double
);
/// Retrieve a key from a vector of options.
/// It finds a key starting with "key=" or equal to "key" and copy the
/// part after the = on s. E.g.:
/// line.push_back("aa=xx");
/// getKey(line,"aa",s);
/// will set s="xx"
static
bool
getKey
(
std
::
vector
<
std
::
string
>&
line
,
const
std
::
string
&
key
,
std
::
string
&
s
);
/// Find a keyword on the input line, eventually deleting it, and saving its value to val
template
<
class
T
>
static
bool
parse
(
std
::
vector
<
std
::
string
>&
line
,
const
std
::
string
&
key
,
T
&
val
);
/// Find a keyword on the input line, eventually deleting it, and saving its value to a vector
template
<
class
T
>
static
bool
parseVector
(
std
::
vector
<
std
::
string
>&
line
,
const
std
::
string
&
key
,
std
::
vector
<
T
>&
val
);
/// Find a keyword without arguments on the input line
static
bool
parseFlag
(
std
::
vector
<
std
::
string
>&
line
,
const
std
::
string
&
key
,
bool
&
val
);
template
<
class
T
>
static
double
getArray
(
void
*
,
int
,
int
,
double
);
template
<
class
T
>
static
double
getArray
(
void
*
,
void
*
,
void
*
,
int
,
int
,
double
);
};
template
<
class
T
>
...
...
@@ -85,18 +91,6 @@ bool Tools::parseFlag(std::vector<std::string>&line,const std::string&key,bool&v
return
true
;
}
template
<
class
T
>
double
Tools
::
getArray
(
void
*
p
,
int
iat
,
int
idim
,
double
scale
){
return
(
static_cast
<
T
*>
(
p
))[
3
*
iat
+
idim
]
*
scale
;
}
template
<
class
T
>
double
Tools
::
getArray
(
void
*
px
,
void
*
py
,
void
*
pz
,
int
iat
,
int
idim
,
double
scale
){
if
(
idim
==
0
)
return
(
static_cast
<
T
*>
(
px
))[
iat
]
*
scale
;
if
(
idim
==
1
)
return
(
static_cast
<
T
*>
(
py
))[
iat
]
*
scale
;
return
(
static_cast
<
T
*>
(
pz
))[
iat
]
*
scale
;
}
inline
double
Tools
::
pbc
(
double
x
){
return
x
-
floor
(
x
+
0.5
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment