~ubuntu-branches/ubuntu/quantal/psicode/quantal

« back to all changes in this revision

Viewing changes to src/bin/ccsort/c_sort.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <libdpd/dpd.h>
2
 
#include "MOInfo.h"
3
 
#include "Params.h"
4
 
#define EXTERN
5
 
#include "globals.h"
6
 
 
7
 
void c_sort(void)
8
 
{
9
 
  dpdbuf4 C, D;
10
 
 
11
 
  if(params.ref == 2) { /** UHF **/
12
 
 
13
 
    /* <ia||jb> = <ia|jb> - <ia|bj> = <ia|jb> - <ij|ba> */
14
 
 
15
 
    /*** AA ***/
16
 
    dpd_buf4_init(&C, CC_CINTS, 0, 20, 20, 20, 20, 0, "C <IA|JB>");
17
 
    dpd_buf4_copy(&C, CC_CINTS, "C <IA||JB>");
18
 
    dpd_buf4_close(&C);
19
 
    dpd_buf4_init(&D, CC_DINTS, 0, 0, 5, 0, 5, 0, "D <IJ|AB>");
20
 
    dpd_buf4_sort(&D, CC_TMP0, psqr, 20, 20, "D <IJ|AB> (IB,JA)");
21
 
    dpd_buf4_close(&D);
22
 
    dpd_buf4_init(&D, CC_TMP0, 0, 20, 20, 20, 20, 0, "D <IJ|AB> (IB,JA)");
23
 
    dpd_buf4_init(&C, CC_CINTS, 0, 20, 20, 20, 20, 0, "C <IA||JB>");
24
 
    dpd_buf4_axpy(&D, &C, -1);
25
 
    dpd_buf4_close(&D);
26
 
    dpd_buf4_close(&C);
27
 
 
28
 
    /* <IA||JB> (IA,BJ) (Wmbej.c) */
29
 
    dpd_buf4_init(&C, CC_CINTS, 0, 20, 20, 20, 20, 0, "C <IA||JB>");
30
 
    dpd_buf4_sort(&C, CC_CINTS, pqsr, 20, 21, "C <IA||JB> (IA,BJ)");
31
 
    dpd_buf4_close(&C);
32
 
 
33
 
    /*** BB ***/
34
 
    dpd_buf4_init(&C, CC_CINTS, 0, 30, 30, 30, 30, 0, "C <ia|jb>");
35
 
    dpd_buf4_copy(&C, CC_CINTS, "C <ia||jb>");
36
 
    dpd_buf4_close(&C);
37
 
 
38
 
    dpd_buf4_init(&D, CC_DINTS, 0, 10, 15, 10, 15, 0, "D <ij|ab>");
39
 
    dpd_buf4_sort(&D, CC_TMP0, psqr, 30, 30, "D <ij|ab> (ib,ja)");
40
 
    dpd_buf4_close(&D);
41
 
    dpd_buf4_init(&D, CC_TMP0, 0, 30, 30, 30, 30, 0, "D <ij|ab> (ib,ja)");
42
 
    dpd_buf4_init(&C, CC_CINTS, 0, 30, 30, 30, 30, 0, "C <ia||jb>");
43
 
    dpd_buf4_axpy(&D, &C, -1);
44
 
    dpd_buf4_close(&D);
45
 
    dpd_buf4_close(&C);
46
 
 
47
 
    /* <ia||jb> (ia,bj) (Wmbej.c) */
48
 
    dpd_buf4_init(&C, CC_CINTS, 0, 30, 30, 30, 30, 0, "C <ia||jb>");
49
 
    dpd_buf4_sort(&C, CC_CINTS, pqsr, 30, 31, "C <ia||jb> (ia,bj)");
50
 
    dpd_buf4_close(&C);
51
 
 
52
 
    /*** AB ***/
53
 
 
54
 
    /* <Ai|Bj> (iA,Bj) (Wmbej.c) */
55
 
    dpd_buf4_init(&C, CC_CINTS, 0, 26, 26, 26, 26, 0, "C <Ai|Bj>");
56
 
    dpd_buf4_sort(&C, CC_CINTS, qpsr, 27, 27, "C <iA|jB>");
57
 
    dpd_buf4_sort(&C, CC_CINTS, qprs, 27, 26, "C <Ai|Bj> (iA,Bj)");
58
 
    dpd_buf4_close(&C);
59
 
 
60
 
    /* <Ia|Jb> (Ia,bJ) (Wmbej.c) */
61
 
    dpd_buf4_init(&C, CC_CINTS, 0, 24, 24, 24, 24, 0, "C <Ia|Jb>");
62
 
    dpd_buf4_sort(&C, CC_CINTS, pqsr, 24, 25, "C <Ia|Jb> (Ia,bJ)");
63
 
    dpd_buf4_close(&C);
64
 
 
65
 
  }
66
 
  else { /** RHF/ROHF **/
67
 
    /* <ia||jb> = <ia|jb> - <ia|bj> = <ia|jb> - <ij|ba> */
68
 
    dpd_buf4_init(&C, CC_CINTS, 0, 10, 10, 10, 10, 0, "C <ia|jb>");
69
 
    dpd_buf4_copy(&C, CC_CINTS, "C <ia||jb>");
70
 
    dpd_buf4_close(&C);
71
 
 
72
 
    dpd_buf4_init(&D, CC_DINTS, 0, 0, 5, 0, 5, 0, "D <ij|ab>");
73
 
    dpd_buf4_sort(&D, CC_TMP0, psqr, 10, 10, "D <ij|ab> (ib,ja)");
74
 
    dpd_buf4_close(&D);
75
 
    dpd_buf4_init(&D, CC_TMP0, 0, 10, 10, 10, 10, 0, "D <ij|ab> (ib,ja)");
76
 
    dpd_buf4_init(&C, CC_CINTS, 0, 10, 10, 10, 10, 0, "C <ia||jb>");
77
 
    dpd_buf4_axpy(&D, &C, -1);
78
 
    dpd_buf4_close(&D);
79
 
    dpd_buf4_close(&C);
80
 
 
81
 
    /* <ia|jb> (bi,ja) */
82
 
    dpd_buf4_init(&C, CC_CINTS, 0, 10, 10, 10, 10, 0, "C <ia|jb>");
83
 
    dpd_buf4_sort(&C, CC_CINTS, sprq, 11, 10, "C <ia|jb> (bi,ja)");
84
 
    dpd_buf4_close(&C);
85
 
 
86
 
    /* <ia||jb> (bi,ja) */
87
 
    dpd_buf4_init(&C, CC_CINTS, 0, 10, 10, 10, 10, 0, "C <ia||jb>");
88
 
    dpd_buf4_sort(&C, CC_CINTS, sprq, 11, 10, "C <ia||jb> (bi,ja)");
89
 
    dpd_buf4_close(&C);
90
 
 
91
 
    /* <ia|jb> (ia,bj) */
92
 
    dpd_buf4_init(&C, CC_CINTS, 0, 10, 10, 10, 10, 0, "C <ia|jb>");
93
 
    dpd_buf4_sort(&C, CC_CINTS, pqsr, 10, 11, "C <ia|jb> (ia,bj)");
94
 
    dpd_buf4_close(&C);
95
 
 
96
 
    /* <ia||jb> (ia,bj) (Wmbej.c) */
97
 
    dpd_buf4_init(&C, CC_CINTS, 0, 10, 10, 10, 10, 0, "C <ia||jb>");
98
 
    dpd_buf4_sort(&C, CC_CINTS, pqsr, 10, 11, "C <ia||jb> (ia,bj)");
99
 
    dpd_buf4_close(&C);
100
 
 
101
 
    /* <ai|bj> (cchbar/Wabei_RHF.c) */
102
 
    dpd_buf4_init(&C, CC_CINTS, 0, 10, 10, 10, 10, 0, "C <ia|jb>");
103
 
    dpd_buf4_sort(&C, CC_CINTS, qpsr, 11, 11, "C <ai|bj>");
104
 
    dpd_buf4_close(&C);
105
 
 
106
 
  }
107
 
 
108
 
}