Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
7fe9c87b
Commit
7fe9c87b
authored
Dec 07, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some small fixes for windows
parent
9b2ae6d7
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
13 deletions
+32
-13
include/cif++/parser.hpp
+6
-4
src/model.cpp
+3
-0
src/point.cpp
+11
-9
test/model-test.cpp
+6
-0
test/rename-compound-test.cpp
+6
-0
No files found.
include/cif++/parser.hpp
View file @
7fe9c87b
...
...
@@ -95,11 +95,13 @@ class sac_parser
{
auto
s
=
text
.
begin
();
bool
result
=
is_ordinary
(
*
s
++
)
;
while
(
result
and
s
!=
text
.
end
()
)
bool
result
=
true
;
for
(
auto
ch
:
text
)
{
result
=
is_non_blank
(
*
s
);
++
s
;
if
(
is_non_blank
(
ch
))
continue
;
result
=
false
;
break
;
}
// but be careful it does not contain e.g. stop_
...
...
src/model.cpp
View file @
7fe9c87b
...
...
@@ -1688,6 +1688,9 @@ atom &structure::emplace_atom(atom &&atom)
R
=
i
-
1
;
}
if
(
R
==
-
1
)
// msvc...
m_atom_index
.
insert
(
m_atom_index
.
begin
(),
m_atoms
.
size
());
else
m_atom_index
.
insert
(
m_atom_index
.
begin
()
+
R
+
1
,
m_atoms
.
size
());
// make sure the atom_type is known
...
...
src/point.cpp
View file @
7fe9c87b
...
...
@@ -87,17 +87,17 @@ class Matrix : public MatrixExpression<Matrix>
Matrix
&
operator
=
(
Matrix
&&
m
)
=
default
;
Matrix
&
operator
=
(
const
Matrix
&
m
)
=
default
;
uint32
_t
dim_m
()
const
{
return
m_m
;
}
uint32
_t
dim_n
()
const
{
return
m_n
;
}
size
_t
dim_m
()
const
{
return
m_m
;
}
size
_t
dim_n
()
const
{
return
m_n
;
}
double
operator
()(
uint32_t
i
,
uint32
_t
j
)
const
double
operator
()(
size_t
i
,
size
_t
j
)
const
{
assert
(
i
<
m_m
);
assert
(
j
<
m_n
);
return
m_data
[
i
*
m_n
+
j
];
}
double
&
operator
()(
uint32_t
i
,
uint32
_t
j
)
double
&
operator
()(
size_t
i
,
size
_t
j
)
{
assert
(
i
<
m_m
);
assert
(
j
<
m_n
);
...
...
@@ -105,7 +105,7 @@ class Matrix : public MatrixExpression<Matrix>
}
private
:
uint32
_t
m_m
=
0
,
m_n
=
0
;
size
_t
m_m
=
0
,
m_n
=
0
;
std
::
vector
<
double
>
m_data
;
};
...
...
@@ -522,15 +522,17 @@ quaternion align_points(const std::vector<point> &pa, const std::vector<point> &
point
nudge
(
point
p
,
float
offset
)
{
static
const
float
kPI_f
=
static_cast
<
float
>
(
kPI
);
static
std
::
random_device
rd
;
static
std
::
mt19937_64
rng
(
rd
());
std
::
uniform_real_distribution
<
float
>
randomAngle
(
0
,
2
*
kPI
);
std
::
normal_distribution
<>
randomOffset
(
0
,
offset
);
std
::
uniform_real_distribution
<
float
>
randomAngle
(
0
,
2
*
kPI
_f
);
std
::
normal_distribution
<
float
>
randomOffset
(
0
,
offset
);
float
theta
=
randomAngle
(
rng
);
float
phi1
=
randomAngle
(
rng
)
-
kPI
;
float
phi2
=
randomAngle
(
rng
)
-
kPI
;
float
phi1
=
randomAngle
(
rng
)
-
kPI
_f
;
float
phi2
=
randomAngle
(
rng
)
-
kPI
_f
;
quaternion
q
=
spherical
(
1.0
f
,
theta
,
phi1
,
phi2
);
...
...
test/model-test.cpp
View file @
7fe9c87b
...
...
@@ -58,6 +58,12 @@ bool init_unit_test()
// not a test, just initialize test dir
if
(
boost
::
unit_test
::
framework
::
master_test_suite
().
argc
==
2
)
gTestDir
=
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
[
1
];
else
{
while
(
not
gTestDir
.
empty
()
and
not
std
::
filesystem
::
exists
(
gTestDir
/
"test"
))
gTestDir
=
gTestDir
.
parent_path
();
gTestDir
/=
"test"
;
}
// do this now, avoids the need for installing
cif
::
add_file_resource
(
"mmcif_pdbx.dic"
,
gTestDir
/
".."
/
"rsrc"
/
"mmcif_pdbx.dic"
);
...
...
test/rename-compound-test.cpp
View file @
7fe9c87b
...
...
@@ -39,6 +39,12 @@ int main(int argc, char* argv[])
if
(
argc
==
3
)
testdir
=
argv
[
2
];
else
{
while
(
not
testdir
.
empty
()
and
not
std
::
filesystem
::
exists
(
testdir
/
"test"
))
testdir
=
testdir
.
parent_path
();
testdir
/=
"test"
;
}
if
(
std
::
filesystem
::
exists
(
testdir
/
".."
/
"data"
/
"ccd-subset.cif"
))
cif
::
add_file_resource
(
"components.cif"
,
testdir
/
".."
/
"data"
/
"ccd-subset.cif"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment