Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MLIP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Tadah
MLIP
Commits
eff5f7c9
Commit
eff5f7c9
authored
11 months ago
by
Marcin Kirsz
Browse files
Options
Downloads
Patches
Plain Diff
Counting structures
parent
382a22e1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#37187
passed
11 months ago
Stage: build.debug
Stage: run.unit.tests
Stage: build_release
Stage: trigger
Pipeline: Tadah.MLIP
#37188
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
structure.cpp
+0
-1
0 additions, 1 deletion
structure.cpp
structure.h
+1
-1
1 addition, 1 deletion
structure.h
structure_db.cpp
+5
-5
5 additions, 5 deletions
structure_db.cpp
structure_db.h
+2
-2
2 additions, 2 deletions
structure_db.h
with
8 additions
and
9 deletions
structure.cpp
+
0
−
1
View file @
eff5f7c9
...
@@ -199,7 +199,6 @@ int Structure::next_structure(std::ifstream &ifs) {
...
@@ -199,7 +199,6 @@ int Structure::next_structure(std::ifstream &ifs) {
while
(
std
::
getline
(
ifs
,
line
))
{
while
(
std
::
getline
(
ifs
,
line
))
{
if
(
line
.
empty
())
break
;
if
(
line
.
empty
())
break
;
if
(
line
==
"
\r
"
)
break
;
// detects windows newline
if
(
line
==
"
\r
"
)
break
;
// detects windows newline
}
}
return
0
;
return
0
;
}
}
This diff is collapsed.
Click to expand it.
structure.h
+
1
−
1
View file @
eff5f7c9
...
@@ -259,7 +259,7 @@ struct Structure {
...
@@ -259,7 +259,7 @@ struct Structure {
// move iterator forward to the next structure
// move iterator forward to the next structure
// return 0 if success
// return 0 if success
// return 1 if there is no more structures
// return 1 if there is no more structures
static
int
next_structure
(
std
::
ifstream
&
ifs
)
const
;
static
int
next_structure
(
std
::
ifstream
&
ifs
);
private
:
private
:
const
static
size_t
w
=
15
;
// controls output width
const
static
size_t
w
=
15
;
// controls output width
...
...
This diff is collapsed.
Click to expand it.
structure_db.cpp
+
5
−
5
View file @
eff5f7c9
...
@@ -78,14 +78,14 @@ std::unordered_set<Element> StructureDB::get_unique_elements() {
...
@@ -78,14 +78,14 @@ std::unordered_set<Element> StructureDB::get_unique_elements() {
st
.
unique_elements
.
begin
(),
st
.
unique_elements
.
end
());
st
.
unique_elements
.
begin
(),
st
.
unique_elements
.
end
());
return
s
;
return
s
;
}
}
int
StructureDB
::
count_structures
(
const
Config
&
c
)
{
int
StructureDB
::
count_structures
(
const
Config
&
c
onfig
)
{
int
count
=
0
;
int
count
=
0
;
for
(
const
std
::
string
&
s
:
config
(
"DBFILE"
))
{
for
(
const
std
::
string
&
fn
:
config
(
"DBFILE"
))
{
count
+=
count_structures
(
fn
)
''
count
+=
count_structures
(
fn
)
;
}
}
return
count
;
return
count
;
}
}
int
StructureDB
::
count_structures
(
const
std
::
string
fn
)
const
{
int
StructureDB
::
count_structures
(
const
std
::
string
fn
){
int
count
=
0
;
int
count
=
0
;
std
::
ifstream
ifs
(
fn
);
std
::
ifstream
ifs
(
fn
);
...
@@ -93,7 +93,7 @@ int StructureDB::count_structures(const std::string fn) const {
...
@@ -93,7 +93,7 @@ int StructureDB::count_structures(const std::string fn) const {
throw
std
::
runtime_error
(
"DBFILE does not exist: "
+
fn
);
throw
std
::
runtime_error
(
"DBFILE does not exist: "
+
fn
);
}
}
while
(
Structure
::
next_structure
(
ifs
))
{
while
(
!
Structure
::
next_structure
(
ifs
))
{
count
++
;
count
++
;
}
}
...
...
This diff is collapsed.
Click to expand it.
structure_db.h
+
2
−
2
View file @
eff5f7c9
...
@@ -124,7 +124,7 @@ struct StructureDB {
...
@@ -124,7 +124,7 @@ struct StructureDB {
/** Return unique elements for all Structures */
/** Return unique elements for all Structures */
std
::
unordered_set
<
Element
>
get_unique_elements
();
std
::
unordered_set
<
Element
>
get_unique_elements
();
static
int
count_structures
(
const
Config
&
c
)
const
;
static
int
count_structures
(
const
Config
&
c
);
static
int
count_structures
(
const
std
::
string
fn
)
const
;
static
int
count_structures
(
const
std
::
string
fn
);
};
};
#endif
#endif
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