LIBINT  2.1.0-stable
extract.h
1 /*
2  * This file is a part of Libint.
3  * Copyright (C) 2004-2014 Edward F. Valeev
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see http://www.gnu.org/licenses/.
17  *
18  */
19 
24 #ifndef _libint2_src_bin_libint_extract_h_
25 #define _libint2_src_bin_libint_extract_h_
26 
27 #include <string>
28 #include <list>
29 #include <smart_ptr.h>
30 
31 namespace libint2 {
32 
33  class DGVertex;
34 
37  public:
38  typedef SafePtr<DGVertex> VertexPtr;
39  typedef std::list<std::string> Symbols;
40 
43 
45  void operator()(const VertexPtr& v);
46 
48  const Symbols& symbols() const;
49 
50  private:
51  mutable Symbols symbols_;
52  // symbols are stored as a map
53  typedef std::map<std::string,bool> LabelMap;
54  LabelMap map_;
55  };
56 
58  class ExtractRR {
59  public:
60  typedef SafePtr<DGVertex> VertexPtr;
61  typedef RRStack::InstanceID RRid;
62  typedef std::list<RRid> RRList;
63 
64  ExtractRR() {}
65  ~ExtractRR() {}
66 
68  void operator()(const VertexPtr& v);
69 
71  const RRList& rrlist() const;
72 
73  private:
74  mutable RRList rrlist_;
75  // RRid are stored in a map
76  typedef std::map<RRid,bool> RRMap;
77  RRMap map_;
78  };
79 
80 };
81 
82 #endif // header guard
This class collects all unique RRs. It uses RRStack to get their InstanceID.
Definition: extract.h:58
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
This class collects labels of all external non-compile-time constants.
Definition: extract.h:36
const Symbols & symbols() const
return list of sorted symbols
Definition: extract.cc:68
void operator()(const VertexPtr &v)
try v
Definition: extract.cc:33