Coverage Report

Created: 2026-07-30 06:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openbabel/include/openbabel/molchrg.h
Line
Count
Source
1
/**********************************************************************
2
molchrg.h - Assign Gasteiger partial charges.
3
4
Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc.
5
Some portions Copyright (C) 2001-2005 by Geoffrey R. Hutchison
6
7
This file is part of the Open Babel project.
8
For more information, see <http://openbabel.org/>
9
10
This program is free software; you can redistribute it and/or modify
11
it under the terms of the GNU General Public License as published by
12
the Free Software Foundation version 2 of the License.
13
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
GNU General Public License for more details.
18
***********************************************************************/
19
20
#ifndef OB_MOLCHRG_H
21
#define OB_MOLCHRG_H
22
23
#include <openbabel/babelconfig.h>
24
#include <vector>
25
26
namespace OpenBabel
27
{
28
29
  // Foward declarations
30
  class OBMol;
31
  class OBAtom;
32
33
//! \class GasteigerState molchrg.h <openbabel/molchrg.h>
34
//! \brief Helper class for OBGastChrg which stores the Gasteiger states of a given atom
35
class OBAPI GasteigerState
36
{
37
public:
38
    GasteigerState();
39
105k
    ~GasteigerState() {}
40
41
    void SetValues(double _a,double _b,double _c,double _q)
42
23.9k
    {
43
23.9k
        a = _a;
44
23.9k
        b = _b;
45
23.9k
        c = _c;
46
23.9k
        denom=a+b+c;
47
23.9k
        q = _q;
48
23.9k
    }
49
50
    double a, b, c;
51
    double denom;
52
    double chi;
53
    double q;
54
};
55
56
// class introduction in molchrg.cpp
57
class OBAPI OBGastChrg
58
{
59
  std::vector <GasteigerState*> _gsv; //!< vector of internal GasteigerState (for each atom)
60
61
    void InitialPartialCharges(OBMol &);
62
    bool GasteigerSigmaChi(OBAtom *,double &,double &,double &);
63
64
public:
65
926
    OBGastChrg()    {}
66
    ~OBGastChrg();
67
68
    //! Assign partial charges to this OBMol, setting each OBAtom partial charge
69
    bool AssignPartialCharges(OBMol &);
70
    //! Resize the internal GasteigerState vector to match the size of the molecule
71
    void GSVResize(int);
72
};
73
74
}
75
76
9.90k
#define OB_GASTEIGER_DENOM  20.02
77
1.56k
#define OB_GASTEIGER_DAMP   0.5
78
1.82k
#define OB_GASTEIGER_ITERS  6
79
80
#endif // OB_MOLCHRG_H
81
82
//! \file molchrg.h
83
//! \brief Assign Gasteiger partial charges.