<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>MPQC: r12ia.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <h1>r12ia.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//</span> <a name="l00002"></a>00002 <span class="comment">// r12ia.h</span> <a name="l00003"></a>00003 <span class="comment">//</span> <a name="l00004"></a>00004 <span class="comment">// Copyright (C) 2002 Edward Valeev</span> <a name="l00005"></a>00005 <span class="comment">//</span> <a name="l00006"></a>00006 <span class="comment">// Author: Edward Valeev <edward.valeev@chemistry.gatech.edu></span> <a name="l00007"></a>00007 <span class="comment">// Maintainer: EV</span> <a name="l00008"></a>00008 <span class="comment">//</span> <a name="l00009"></a>00009 <span class="comment">// This file is part of the SC Toolkit.</span> <a name="l00010"></a>00010 <span class="comment">//</span> <a name="l00011"></a>00011 <span class="comment">// The SC Toolkit is free software; you can redistribute it and/or modify</span> <a name="l00012"></a>00012 <span class="comment">// it under the terms of the GNU Library General Public License as published by</span> <a name="l00013"></a>00013 <span class="comment">// the Free Software Foundation; either version 2, or (at your option)</span> <a name="l00014"></a>00014 <span class="comment">// any later version.</span> <a name="l00015"></a>00015 <span class="comment">//</span> <a name="l00016"></a>00016 <span class="comment">// The SC Toolkit is distributed in the hope that it will be useful,</span> <a name="l00017"></a>00017 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00018"></a>00018 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <a name="l00019"></a>00019 <span class="comment">// GNU Library General Public License for more details.</span> <a name="l00020"></a>00020 <span class="comment">//</span> <a name="l00021"></a>00021 <span class="comment">// You should have received a copy of the GNU Library General Public License</span> <a name="l00022"></a>00022 <span class="comment">// along with the SC Toolkit; see the file COPYING.LIB. If not, write to</span> <a name="l00023"></a>00023 <span class="comment">// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.</span> <a name="l00024"></a>00024 <span class="comment">//</span> <a name="l00025"></a>00025 <span class="comment">// The U.S. Government is granted a limited license as per AL 91-7.</span> <a name="l00026"></a>00026 <span class="comment">//</span> <a name="l00027"></a>00027 <a name="l00028"></a>00028 <span class="preprocessor">#ifndef _chemistry_qc_mbptr12_r12ia_h</span> <a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define _chemistry_qc_mbptr12_r12ia_h</span> <a name="l00030"></a>00030 <span class="preprocessor"></span> <a name="l00031"></a>00031 <span class="preprocessor">#ifdef __GNUC__</span> <a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span> <a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#endif</span> <a name="l00034"></a>00034 <span class="preprocessor"></span> <a name="l00035"></a>00035 <span class="preprocessor">#include <vector></span> <a name="l00036"></a>00036 <span class="preprocessor">#include <util/ref/ref.h></span> <a name="l00037"></a>00037 <span class="preprocessor">#include <util/state/state.h></span> <a name="l00038"></a>00038 <span class="preprocessor">#include <util/state/statein.h></span> <a name="l00039"></a>00039 <span class="preprocessor">#include <util/state/stateout.h></span> <a name="l00040"></a>00040 <span class="preprocessor">#include <util/group/memory.h></span> <a name="l00041"></a>00041 <a name="l00042"></a>00042 <span class="keyword">using namespace </span>std; <a name="l00043"></a>00043 <a name="l00044"></a>00044 <span class="keyword">namespace </span>sc { <a name="l00045"></a>00045 <a name="l00047"></a>00047 <a name="l00070"></a><a class="code" href="classsc_1_1R12IntsAcc.html">00070</a> <span class="keyword">class </span><a class="code" href="classsc_1_1R12IntsAcc.html" title="R12IntsAcc accumulates transformed (MO) integrals stored as (ijxy) where i, j, x...">R12IntsAcc</a>: <span class="keyword">virtual</span> <span class="keyword">public</span> <a class="code" href="classsc_1_1SavableState.html" title="Base class for objects that can save/restore state.">SavableState</a> { <a name="l00071"></a>00071 <a name="l00072"></a>00072 <span class="keywordtype">int</span> num_te_types_; <span class="comment">// Number of types of integrals in a block (in R12 theories -- usually 3)</span> <a name="l00073"></a>00073 <a name="l00074"></a>00074 <span class="keyword">protected</span>: <a name="l00075"></a>00075 <span class="keywordtype">int</span> ni_, nj_; <a name="l00076"></a>00076 <span class="keywordtype">int</span> nx_, ny_; <a name="l00077"></a>00077 <span class="keywordtype">size_t</span> nxy_; <span class="comment">// nx_ * ny_ - the number of integrals of one type in a block</span> <a name="l00078"></a>00078 <span class="keywordtype">size_t</span> blksize_; <span class="comment">// the same in bytes</span> <a name="l00079"></a>00079 <span class="keywordtype">size_t</span> blocksize_; <span class="comment">// hence the size of the block of num_te_types of integrals is blksize_ * num_te_types</span> <a name="l00080"></a>00080 <a name="l00081"></a>00081 <span class="keywordtype">int</span> next_orbital_; <span class="comment">// The first index of the next batch to be stored</span> <a name="l00082"></a>00082 <span class="keywordtype">bool</span> committed_; <span class="comment">// Whether all data has been written out and ready to be read</span> <a name="l00083"></a>00083 <span class="keywordtype">bool</span> active_; <span class="comment">// Whether ready to read data</span> <a name="l00084"></a>00084 <a name="l00086"></a>00086 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#2e6a81bb0b3866094331f22c9020b1d3" title="total number of tasks">ntasks</a>() <span class="keyword">const</span> =0; <a name="l00088"></a>00088 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#e53c1cd34479be1a55e3c6ba4bcca631" title="ID of this task.">taskid</a>() <span class="keyword">const</span> =0; <a name="l00090"></a>00090 <span class="keywordtype">void</span> <a class="code" href="classsc_1_1R12IntsAcc.html#56f275eba386748e85b5c8620e4de1dd" title="The index of the first orbital in the next integrals batch to be stored.">inc_next_orbital</a>(<span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#4f407decbb8a95e7eafa8fa9828557cb" title="Rank of index space i.">ni</a>); <a name="l00091"></a>00091 <a name="l00092"></a>00092 <span class="keyword">public</span>: <a name="l00093"></a>00093 <a class="code" href="classsc_1_1R12IntsAcc.html" title="R12IntsAcc accumulates transformed (MO) integrals stored as (ijxy) where i, j, x...">R12IntsAcc</a>(<span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#103114d6027d488f5f3265cf192ef689" title="The number of types of integrals that are being handled together.">num_te_types</a>, <span class="keywordtype">int</span> ni, <span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#3234543f4162029c325fb5c854c33328" title="Rank of index space j.">nj</a>, <span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#e8a747739a241ccf69ef0bafc8f99dda" title="Rank of index space x.">nx</a>, <span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#f98cdeab6942f249b9b06a756306069f" title="Rank of index space y.">ny</a>); <a name="l00094"></a>00094 <a class="code" href="classsc_1_1R12IntsAcc.html" title="R12IntsAcc accumulates transformed (MO) integrals stored as (ijxy) where i, j, x...">R12IntsAcc</a>(<a class="code" href="classsc_1_1StateIn.html" title="Restores objects that derive from SavableState.">StateIn</a>&); <a name="l00095"></a>00095 ~<a class="code" href="classsc_1_1R12IntsAcc.html" title="R12IntsAcc accumulates transformed (MO) integrals stored as (ijxy) where i, j, x...">R12IntsAcc</a>(); <a name="l00096"></a>00096 <span class="keywordtype">void</span> <a class="code" href="classsc_1_1R12IntsAcc.html#ff229420e6823f3c0a6b5d7423081930" title="Save the base classes (with save_data_state) and the members in the same order that...">save_data_state</a>(<a class="code" href="classsc_1_1StateOut.html" title="Serializes objects that derive from SavableState.">StateOut</a>&); <a name="l00097"></a>00097 <a name="l00099"></a><a class="code" href="classsc_1_1R12IntsAcc.html#0aaf14d80bff5f6aad89c6fb2a0e4ea7">00099</a> <span class="keyword">enum</span> <a class="code" href="classsc_1_1R12IntsAcc.html#0aaf14d80bff5f6aad89c6fb2a0e4ea7" title="Types of two-body operators that R12IntsAcc understands.">tbint_type</a> { eri=0, r12=1, r12t1=2, r12t2=3}; <a name="l00100"></a>00100 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> max_num_te_types_ = 4; <a name="l00101"></a>00101 <a name="l00103"></a><a class="code" href="classsc_1_1R12IntsAcc.html#103114d6027d488f5f3265cf192ef689">00103</a> <span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#103114d6027d488f5f3265cf192ef689" title="The number of types of integrals that are being handled together.">num_te_types</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> num_te_types_; }; <a name="l00105"></a><a class="code" href="classsc_1_1R12IntsAcc.html#4f407decbb8a95e7eafa8fa9828557cb">00105</a> <span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#4f407decbb8a95e7eafa8fa9828557cb" title="Rank of index space i.">ni</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> ni_; } <a name="l00107"></a><a class="code" href="classsc_1_1R12IntsAcc.html#3234543f4162029c325fb5c854c33328">00107</a> <span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#3234543f4162029c325fb5c854c33328" title="Rank of index space j.">nj</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> nj_; } <a name="l00109"></a><a class="code" href="classsc_1_1R12IntsAcc.html#e8a747739a241ccf69ef0bafc8f99dda">00109</a> <span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#e8a747739a241ccf69ef0bafc8f99dda" title="Rank of index space x.">nx</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> nx_; } <a name="l00111"></a><a class="code" href="classsc_1_1R12IntsAcc.html#f98cdeab6942f249b9b06a756306069f">00111</a> <span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#f98cdeab6942f249b9b06a756306069f" title="Rank of index space y.">ny</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> ny_; } <a name="l00113"></a><a class="code" href="classsc_1_1R12IntsAcc.html#c6d6894062d87794215e1a9f60631a22">00113</a> <span class="keywordtype">size_t</span> <a class="code" href="classsc_1_1R12IntsAcc.html#c6d6894062d87794215e1a9f60631a22" title="Size of each block of the integrals of one type, in double words.">blocksize</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> blksize_; }; <a name="l00115"></a>00115 <span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#003a15c1804e38437eda18a993f6cfdb" title="The index of the first orbital in the next integrals batch to be stored.">next_orbital</a>() <span class="keyword">const</span>; <a name="l00116"></a>00116 <a name="l00129"></a>00129 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classsc_1_1R12IntsAcc.html#0e158dafcf2c4ab03fdc20c5f2d43085" title="Stores all pair block of integrals held in mem in a layout assumed throughout MBPT2_R12...">store_memorygrp</a>(<a class="code" href="classsc_1_1Ref.html">Ref<MemoryGrp></a>& mem, <span class="keywordtype">int</span> ni, <span class="keyword">const</span> <span class="keywordtype">size_t</span> blksize = 0) =0; <a name="l00133"></a>00133 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classsc_1_1R12IntsAcc.html#eef3cc221b4da98837587049f0c6b3d9" title="All member functions of this class and its children indices i and j don&#39;t include...">store_pair_block</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j, <span class="keywordtype">double</span> *ints)=0; <a name="l00135"></a>00135 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classsc_1_1R12IntsAcc.html#1137d2d9e8defbeccaee102b16b9cdaa" title="Commit the content of the accumulator for reading.">commit</a>(); <a name="l00137"></a><a class="code" href="classsc_1_1R12IntsAcc.html#6c2c34ce969bbf9f75be39225562f4bb">00137</a> <span class="keywordtype">bool</span> <a class="code" href="classsc_1_1R12IntsAcc.html#6c2c34ce969bbf9f75be39225562f4bb" title="Has the content of the accumulator been commited for reading?">is_committed</a>() { <span class="keywordflow">return</span> committed_; } <a name="l00139"></a>00139 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classsc_1_1R12IntsAcc.html#6e3175ec0a7550b5455b50361a4af166" title="Call before starting to read content.">activate</a>(); <a name="l00141"></a>00141 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classsc_1_1R12IntsAcc.html#d757038d76e066d0701ab83a963d02e5" title="Call when done reading content.">deactivate</a>(); <a name="l00143"></a><a class="code" href="classsc_1_1R12IntsAcc.html#6a59f7e381de8de55eb1b42abd14a38a">00143</a> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="classsc_1_1R12IntsAcc.html#6a59f7e381de8de55eb1b42abd14a38a" title="Check if can read content.">is_active</a>() { <span class="keywordflow">return</span> active_; } <a name="l00145"></a>00145 <span class="keyword">virtual</span> <span class="keywordtype">double</span>* <a class="code" href="classsc_1_1R12IntsAcc.html#602d34fd0dfc3880b94cc376db2122bd" title="Retrieves an ij pair block of integrals.">retrieve_pair_block</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j, <a class="code" href="classsc_1_1R12IntsAcc.html#0aaf14d80bff5f6aad89c6fb2a0e4ea7" title="Types of two-body operators that R12IntsAcc understands.">tbint_type</a> oper_type) =0; <a name="l00147"></a>00147 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classsc_1_1R12IntsAcc.html#78dfd72cb2939a0aaf9bbd47d3a6b37a" title="Releases an ij pair block of integrals (if needed).">release_pair_block</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j, <a class="code" href="classsc_1_1R12IntsAcc.html#0aaf14d80bff5f6aad89c6fb2a0e4ea7" title="Types of two-body operators that R12IntsAcc understands.">tbint_type</a> oper_type) =0; <a name="l00149"></a>00149 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classsc_1_1R12IntsAcc.html#b827b3eed2394cb818779c70d207cb63" title="Is this block stored locally?">is_local</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j) <span class="keyword">const</span> =0; <a name="l00151"></a>00151 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classsc_1_1R12IntsAcc.html#32bd6648a9794c5b4e7400c4e211b9c5" title="Is this block available to this task?">is_avail</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j) <span class="keyword">const</span> =0; <a name="l00153"></a>00153 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classsc_1_1R12IntsAcc.html#6568244564b1e1e0e8db07652db34716" title="Does this task have access to all the integrals?">has_access</a>(<span class="keywordtype">int</span> proc) <span class="keyword">const</span> =0; <a name="l00157"></a>00157 <span class="keywordtype">int</span> <a class="code" href="classsc_1_1R12IntsAcc.html#7b76123eb288225b8c4b5da97a87d819" title="Returns the total number of tasks with access to integrals.">tasks_with_access</a>(vector<int>& twa_map) <span class="keyword">const</span>; <a name="l00159"></a>00159 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classsc_1_1R12IntsAcc.html#7c7021b241a62e48d5a654d2c2aed120" title="Can this specialization be used in restarts?">can_restart</a>() <span class="keyword">const</span> =0; <a name="l00160"></a>00160 }; <a name="l00161"></a>00161 <a name="l00162"></a>00162 } <a name="l00163"></a>00163 <a name="l00164"></a>00164 <span class="preprocessor">#endif</span> <a name="l00165"></a>00165 <span class="preprocessor"></span> <a name="l00166"></a>00166 <span class="comment">// Local Variables:</span> <a name="l00167"></a>00167 <span class="comment">// mode: c++</span> <a name="l00168"></a>00168 <span class="comment">// c-file-style: "CLJ"</span> <a name="l00169"></a>00169 <span class="comment">// End:</span> </pre></div></div> <hr> <address> <small> Generated at Wed Oct 14 14:12:11 2009 for <a href="http://www.mpqc.org">MPQC</a> 2.3.1 using the documentation package <a href="http://www.doxygen.org">Doxygen</a> 1.5.9. </small> </address> </body> </html>