1 /* Copyright (c) 2015  Gerald Knizia
2  *
3  * This file is part of the IboView program (see: http://www.iboview.org)
4  *
5  * IboView 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, version 3.
8  *
9  * IboView is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with bfint (LICENSE). If not, see http://www.gnu.org/licenses/
16  *
17  * Please see IboView documentation in README.txt for:
18  * -- A list of included external software and their licenses. The included
19  *    external software's copyright is not touched by this agreement.
20  * -- Notes on re-distribution and contributions to/further development of
21  *    the IboView software
22  */
23 
24 /* IrAmrr.h v20141030 CET [storm, Gerald Knizia] */
25 #ifndef IR_RR_H
26 #define IR_RR_H
27 
28 // IrAmrr -- Angular Momentum Recurrence Relations.
29 //
30 // This is generated code. Changes made here will be lost!
31 
32 #include <stddef.h> // for size_t
33 #include "CxDefs.h" // for assert and RESTRICT
34 #ifndef IR_RP
35    #define IR_RP RESTRICT // restricted pointer
36 #endif
37 
38 namespace ir {
39    unsigned const
40       MaxLa = 6,
41       MaxLc = 6;
42 
43    // number of cartesian components with angular momentum <= l
nCartX(int l)44    inline size_t nCartX(int l) { return static_cast<size_t>((l+1)*(l+2)*(l+3)/6); }
45    // number of cartesians components with angular momentum == l
nCartY(int l)46    inline size_t nCartY(int l) { return static_cast<size_t>((l+1)*(l+2)/2); }
47    // number of solid harmonic components with angular momentum <= l
nSlmX(int l)48    inline size_t nSlmX(int l) { return static_cast<size_t>((l+1)*(l+1)); }
49    // number of solid harmonic components with angular momentum == l
nSlmY(int l)50    inline size_t nSlmY(int l) { return static_cast<size_t>(2*l+1); }
51    // index of solid harmonic component l,c (c = 0 .. 2*l+1) within 0..nSlmX(l).
iSlcX(int l,unsigned c)52    inline size_t iSlcX(int l, unsigned c) { return static_cast<size_t>(l*l + c); }
53 
54    typedef unsigned short
55       cart_vec_t,
56       cart_index_t;
57 
58    void OsrrA(double *IR_RP pOut, double *IR_RP pGm, unsigned lab, double PmAx, double PmAy, double PmAz, double PmQx, double PmQy, double PmQz, double rho, double InvEta);
59    void ShTrN(double *IR_RP pOut, double const *IR_RP pIn, size_t N, unsigned l);
60    void OsrrB_3c_shc(double *IR_RP pOut, double const *IR_RP pIn, double *IR_RP pMem, int la, unsigned lab, unsigned lc, double fPmQx, double fPmQy, double fPmQz, double InvEtaABC, double riz);
61    void OsrrB_3c_cac(double *IR_RP pOut, double const *IR_RP pIn, double *IR_RP pMem, int la, unsigned lab, unsigned lc, double fPmQx, double fPmQy, double fPmQz, double InvEtaABC, double riz);
62    void ShTrN_Indirect(double *IR_RP pOut, size_t so, double const *IR_RP pIn, size_t si, unsigned la, cart_index_t const *ii, size_t N, size_t M);
63    void ShTrA_XY(double *IR_RP pOut, double const *IR_RP pIn, unsigned la, unsigned lab, size_t M);
64    void ShTrA_XfY(double *IR_RP pOut, double const *IR_RP pIn, unsigned la, unsigned lab, size_t M);
65    void ShTrA_YY(double *IR_RP pOut, double const *IR_RP pIn, unsigned la, unsigned lab, size_t M);
66    void OsrrC(double *IR_RP pOut, size_t sa, size_t sb, double const *IR_RP p0Z, double AmBx, double AmBy, double AmBz, unsigned lb, size_t nCount);
67    void ShTrN_TN(double *IR_RP pOut, double const *IR_RP pIn, size_t N, unsigned l);
68    void AmrrDerivA1(double *IR_RP pOut, double const *IR_RP p0Z, double const *IR_RP p2Z, unsigned lab, unsigned la, size_t nCount);
69    void AmrrDerivA2(double *IR_RP pOut, double const *IR_RP p0Z, double const *IR_RP p2Z, double const *IR_RP p4Z, unsigned lab, unsigned la, size_t nCount);
70    void AmrrDerivA0L(double *IR_RP pOut, double const *IR_RP p2Z, double const *IR_RP p4Z, unsigned lab, unsigned la, size_t nCount);
71    void OsrrC_dB1(double *IR_RP pOut, size_t sa, size_t sb, size_t sd, double const *IR_RP p0Z, double const *IR_RP p2Z, double AmBx, double AmBy, double AmBz, unsigned lb, size_t nCount);
72    void OsrrC_dB2(double *IR_RP pOut, size_t sa, size_t sb, size_t sd, double const *IR_RP p0Z, double const *IR_RP p2Z, double const *IR_RP p4Z, double AmBx, double AmBy, double AmBz, unsigned lb, size_t nCount);
73    void OsrrC_dB0L(double *IR_RP pOut, size_t sa, size_t sb, double const *IR_RP p2Z, double const *IR_RP p4Z, double AmBx, double AmBy, double AmBz, unsigned lb, size_t nCount);
74    void CaTrN(double *IR_RP pOut, double const *IR_RP pIn, size_t N, unsigned l);
75    void ShellMdrr(double *IR_RP pOut, double const *IR_RP pIn, double Rx, double Ry, double Rz, unsigned lab);
76    void ShellLaplace(double *IR_RP pOut, double const *IR_RP pIn, unsigned LaplaceOrder, unsigned lab);
77 
78    extern unsigned char iCartPow[84][3];
79 }
80 
81 
82 #endif // IR_RR_H
83