MPQC 2.3.1
formula.h
1//
2// formula.h --- class for calculation molecular formulae
3//
4// Copyright (C) 1997 Limit Point Systems, Inc.
5//
6// Author: Edward Seidl <seidl@janed.com>
7// Maintainer: LPS
8//
9// This file is part of the SC Toolkit.
10//
11// The SC Toolkit is free software; you can redistribute it and/or modify
12// it under the terms of the GNU Library General Public License as published by
13// the Free Software Foundation; either version 2, or (at your option)
14// any later version.
15//
16// The SC Toolkit is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU Library General Public License for more details.
20//
21// You should have received a copy of the GNU Library General Public License
22// along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24//
25
26#ifndef _chemistry_molecule_formula_h
27#define _chemistry_molecule_formula_h
28
29#ifdef __GNUC__
30#pragma interface
31#endif
32
33#include <chemistry/molecule/molecule.h>
34
35namespace sc {
36
41 private:
42 int natomtypes_;
43 int *Z_, *nZ_;
44 char *form_;
45
46 void compute_atomtypes(const Molecule *m);
47 void compute_form(const Molecule *m);
48 public:
51 MolecularFormula(const Molecule *m);
52
54
56 const char * formula() const;
58 int natomtypes();
60 int Z(int itype);
62 int nZ(int itype);
63};
64
65}
66
67#endif
The MolecularFormula class is used to calculate the molecular formula of a Molecule.
Definition: formula.h:40
int nZ(int itype)
Returns number of atoms of given atomtypeindex.
const char * formula() const
Returns a null terminated string containing the molecular formula.
int Z(int itype)
Returns atomic number of given atomtypeindex.
MolecularFormula(const Ref< Molecule > &m)
Constructors. The argument must be nonnull.
int natomtypes()
Returns the number of atomtypes.
The Molecule class contains information about molecules.
Definition: molecule.h:128
A template class that maintains references counts.
Definition: ref.h:332

Generated at Thu Jan 20 2022 00:00:00 for MPQC 2.3.1 using the documentation package Doxygen 1.9.4.