Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProMod3
Manage
Activity
Members
Plan
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
ProMod3
Commits
c0c46ec3
Commit
c0c46ec3
authored
Feb 3, 2016
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
make saving/loading or rotamer libraries faster
parent
f4a33960
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
sidechain/src/bb_dep_rotamer_lib.cc
+3
-8
3 additions, 8 deletions
sidechain/src/bb_dep_rotamer_lib.cc
sidechain/src/rotamer_lib.cc
+2
-6
2 additions, 6 deletions
sidechain/src/rotamer_lib.cc
sidechain/src/rotamer_lib_entry.hh
+0
-12
0 additions, 12 deletions
sidechain/src/rotamer_lib_entry.hh
with
5 additions
and
26 deletions
sidechain/src/bb_dep_rotamer_lib.cc
+
3
−
8
View file @
c0c46ec3
...
@@ -133,10 +133,7 @@ void BBDepRotamerLib::Save(const String& filename){
...
@@ -133,10 +133,7 @@ void BBDepRotamerLib::Save(const String& filename){
}
}
out_stream
.
write
(
reinterpret_cast
<
char
*>
(
&
total_num_rotamers_
),
sizeof
(
uint64_t
));
out_stream
.
write
(
reinterpret_cast
<
char
*>
(
&
total_num_rotamers_
),
sizeof
(
uint64_t
));
for
(
uint
i
=
0
;
i
<
total_num_rotamers_
;
++
i
){
out_stream
.
write
(
reinterpret_cast
<
char
*>
(
&
static_data_
[
0
]),
total_num_rotamers_
*
sizeof
(
RotamerLibEntry
));
out_stream
<<
static_data_
[
i
];
}
out_stream
.
close
();
out_stream
.
close
();
}
}
...
@@ -198,10 +195,8 @@ BBDepRotamerLibPtr BBDepRotamerLib::Load(const String& filename){
...
@@ -198,10 +195,8 @@ BBDepRotamerLibPtr BBDepRotamerLib::Load(const String& filename){
in_stream
.
read
(
reinterpret_cast
<
char
*>
(
&
p
->
total_num_rotamers_
),
sizeof
(
uint64_t
));
in_stream
.
read
(
reinterpret_cast
<
char
*>
(
&
p
->
total_num_rotamers_
),
sizeof
(
uint64_t
));
p
->
static_data_
=
new
RotamerLibEntry
[
p
->
total_num_rotamers_
];
p
->
static_data_
=
new
RotamerLibEntry
[
p
->
total_num_rotamers_
];
for
(
uint
i
=
0
;
i
<
p
->
total_num_rotamers_
;
++
i
){
in_stream
.
read
(
reinterpret_cast
<
char
*>
(
&
p
->
static_data_
[
0
]),
p
->
total_num_rotamers_
*
sizeof
(
RotamerLibEntry
));
in_stream
>>
p
->
static_data_
[
i
];
}
in_stream
.
close
();
return
p
;
return
p
;
}
}
...
...
...
...
This diff is collapsed.
Click to expand it.
sidechain/src/rotamer_lib.cc
+
2
−
6
View file @
c0c46ec3
...
@@ -57,9 +57,7 @@ void RotamerLib::Save(const String& filename){
...
@@ -57,9 +57,7 @@ void RotamerLib::Save(const String& filename){
}
}
out_stream
.
write
(
reinterpret_cast
<
char
*>
(
&
total_num_rotamers_
),
sizeof
(
uint64_t
));
out_stream
.
write
(
reinterpret_cast
<
char
*>
(
&
total_num_rotamers_
),
sizeof
(
uint64_t
));
for
(
uint
i
=
0
;
i
<
total_num_rotamers_
;
++
i
){
out_stream
.
write
(
reinterpret_cast
<
char
*>
(
&
static_data_
[
0
]),
total_num_rotamers_
*
sizeof
(
RotamerLibEntry
));
out_stream
<<
static_data_
[
i
];
}
out_stream
.
close
();
out_stream
.
close
();
}
}
...
@@ -112,9 +110,7 @@ RotamerLibPtr RotamerLib::Load(const String& filename){
...
@@ -112,9 +110,7 @@ RotamerLibPtr RotamerLib::Load(const String& filename){
in_stream
.
read
(
reinterpret_cast
<
char
*>
(
&
p
->
total_num_rotamers_
),
sizeof
(
uint64_t
));
in_stream
.
read
(
reinterpret_cast
<
char
*>
(
&
p
->
total_num_rotamers_
),
sizeof
(
uint64_t
));
p
->
static_data_
=
new
RotamerLibEntry
[
p
->
total_num_rotamers_
];
p
->
static_data_
=
new
RotamerLibEntry
[
p
->
total_num_rotamers_
];
for
(
uint
i
=
0
;
i
<
p
->
total_num_rotamers_
;
++
i
){
in_stream
.
read
(
reinterpret_cast
<
char
*>
(
&
p
->
static_data_
[
0
]),
p
->
total_num_rotamers_
*
sizeof
(
RotamerLibEntry
));
in_stream
>>
p
->
static_data_
[
i
];
}
in_stream
.
close
();
in_stream
.
close
();
return
p
;
return
p
;
}
}
...
...
...
...
This diff is collapsed.
Click to expand it.
sidechain/src/rotamer_lib_entry.hh
+
0
−
12
View file @
c0c46ec3
...
@@ -69,18 +69,6 @@ struct RotamerLibEntry{
...
@@ -69,18 +69,6 @@ struct RotamerLibEntry{
bool
SimilarDihedral
(
RotamerLibEntryPtr
other
,
uint
dihedral_idx
,
bool
SimilarDihedral
(
RotamerLibEntryPtr
other
,
uint
dihedral_idx
,
Real
thresh
,
const
String
&
res_name
);
Real
thresh
,
const
String
&
res_name
);
friend
std
::
ofstream
&
operator
<<
(
std
::
ofstream
&
os
,
RotamerLibEntry
&
entry
){
//assumes all variables being in memory in a consecutive order...
os
.
write
(
reinterpret_cast
<
char
*>
(
&
entry
.
probability
),
9
*
sizeof
(
Real
));
return
os
;
}
friend
std
::
ifstream
&
operator
>>
(
std
::
ifstream
&
is
,
RotamerLibEntry
&
entry
){
//assumes all variables being in memory in a consecutive order...
is
.
read
(
reinterpret_cast
<
char
*>
(
&
entry
.
probability
),
9
*
sizeof
(
Real
));
return
is
;
}
// portable serialization
// portable serialization
// (cleanly element by element with fixed-width base-types)
// (cleanly element by element with fixed-width base-types)
template
<
typename
DS
>
template
<
typename
DS
>
...
...
...
...
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
sign in
to comment