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
7f820449
Unverified
Commit
7f820449
authored
Dec 08, 2021
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
formatting
parent
ecb2cf5f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
27 deletions
+31
-27
include/cif++/AtomType.hpp
+14
-10
include/cif++/BondMap.hpp
+17
-17
src/AtomType.cpp
+0
-0
src/BondMap.cpp
+0
-0
No files found.
include/cif++/AtomType.hpp
View file @
7f820449
...
...
@@ -29,8 +29,8 @@
#pragma once
#include <cstdint>
#include <string>
#include <stdexcept>
#include <string>
namespace
mmcif
{
...
...
@@ -172,7 +172,8 @@ enum AtomType : uint8_t
// --------------------------------------------------------------------
// AtomTypeInfo
enum
RadiusType
{
enum
RadiusType
{
eRadiusCalculated
,
eRadiusEmpirical
,
eRadiusCovalentEmpirical
,
...
...
@@ -205,7 +206,7 @@ class AtomTypeTraits
{
public
:
AtomTypeTraits
(
AtomType
a
);
AtomTypeTraits
(
const
std
::
string
&
symbol
);
AtomTypeTraits
(
const
std
::
string
&
symbol
);
AtomType
type
()
const
{
return
mInfo
->
type
;
}
std
::
string
name
()
const
{
return
mInfo
->
name
;
}
...
...
@@ -214,8 +215,8 @@ class AtomTypeTraits
bool
isMetal
()
const
{
return
mInfo
->
metal
;
}
static
bool
isElement
(
const
std
::
string
&
symbol
);
static
bool
isMetal
(
const
std
::
string
&
symbol
);
static
bool
isElement
(
const
std
::
string
&
symbol
);
static
bool
isMetal
(
const
std
::
string
&
symbol
);
float
radius
(
RadiusType
type
=
eRadiusSingleBond
)
const
{
...
...
@@ -233,13 +234,16 @@ class AtomTypeTraits
};
// to get the Cval and Siva values, use this constant as charge:
enum
{
kWKSFVal
=
-
99
};
enum
{
kWKSFVal
=
-
99
};
const
SFData
&
wksf
(
int
charge
=
0
)
const
;
const
SFData
&
elsf
()
const
;
const
SFData
&
wksf
(
int
charge
=
0
)
const
;
const
SFData
&
elsf
()
const
;
private
:
const
struct
AtomTypeInfo
*
mInfo
;
const
struct
AtomTypeInfo
*
mInfo
;
};
}
}
// namespace mmcif
include/cif++/BondMap.hpp
View file @
7f820449
...
...
@@ -26,9 +26,9 @@
#pragma once
#include <unordered_map>
#include <filesystem>
#include <stdexcept>
#include <unordered_map>
#include "cif++/Structure.hpp"
...
...
@@ -38,24 +38,26 @@ namespace mmcif
class
BondMapException
:
public
std
::
runtime_error
{
public
:
BondMapException
(
const
std
::
string
&
msg
)
:
runtime_error
(
msg
)
{}
BondMapException
(
const
std
::
string
&
msg
)
:
runtime_error
(
msg
)
{
}
};
class
BondMap
{
public
:
BondMap
(
const
Structure
&
p
);
BondMap
(
const
Structure
&
p
);
BondMap
(
const
BondMap
&
)
=
delete
;
BondMap
&
operator
=
(
const
BondMap
&
)
=
delete
;
BondMap
(
const
BondMap
&
)
=
delete
;
BondMap
&
operator
=
(
const
BondMap
&
)
=
delete
;
bool
operator
()(
const
Atom
&
a
,
const
Atom
&
b
)
const
bool
operator
()(
const
Atom
&
a
,
const
Atom
&
b
)
const
{
return
isBonded
(
index
.
at
(
a
.
id
()),
index
.
at
(
b
.
id
()));
}
bool
is1_4
(
const
Atom
&
a
,
const
Atom
&
b
)
const
bool
is1_4
(
const
Atom
&
a
,
const
Atom
&
b
)
const
{
uint32_t
ixa
=
index
.
at
(
a
.
id
());
uint32_t
ixb
=
index
.
at
(
b
.
id
());
...
...
@@ -64,13 +66,12 @@ class BondMap
}
// links coming from the struct_conn records:
std
::
vector
<
std
::
string
>
linked
(
const
Atom
&
a
)
const
;
std
::
vector
<
std
::
string
>
linked
(
const
Atom
&
a
)
const
;
// This list of atomID's is comming from either CCD or the CCP4 dictionaries loaded
static
std
::
vector
<
std
::
string
>
atomIDsForCompound
(
const
std
::
string
&
compoundID
);
static
std
::
vector
<
std
::
string
>
atomIDsForCompound
(
const
std
::
string
&
compoundID
);
private
:
bool
isBonded
(
uint32_t
ai
,
uint32_t
bi
)
const
{
return
bond
.
count
(
key
(
ai
,
bi
))
!=
0
;
...
...
@@ -83,19 +84,18 @@ class BondMap
return
static_cast
<
uint64_t
>
(
a
)
|
(
static_cast
<
uint64_t
>
(
b
)
<<
32
);
}
std
::
tuple
<
uint32_t
,
uint32_t
>
dekey
(
uint64_t
k
)
const
std
::
tuple
<
uint32_t
,
uint32_t
>
dekey
(
uint64_t
k
)
const
{
return
std
::
make_tuple
(
static_cast
<
uint32_t
>
(
k
>>
32
),
static_cast
<
uint32_t
>
(
k
)
);
static_cast
<
uint32_t
>
(
k
));
}
uint32_t
dim
;
std
::
unordered_map
<
std
::
string
,
uint32_t
>
index
;
std
::
unordered_map
<
std
::
string
,
uint32_t
>
index
;
std
::
set
<
uint64_t
>
bond
,
bond_1_4
;
std
::
map
<
std
::
string
,
std
::
set
<
std
::
string
>>
link
;
std
::
map
<
std
::
string
,
std
::
set
<
std
::
string
>>
link
;
};
}
}
// namespace mmcif
src/AtomType.cpp
View file @
7f820449
This diff is collapsed.
Click to expand it.
src/BondMap.cpp
View file @
7f820449
This diff is collapsed.
Click to expand it.
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