~ubuntu-branches/ubuntu/vivid/psicode/vivid

« back to all changes in this revision

Viewing changes to src/bin/cints/Tools/quartet_permutations.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2008-06-07 16:49:57 UTC
  • mfrom: (2.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080607164957-8pifvb133yjlkagn
Tags: 3.3.0-3
* debian/rules (DEB_MAKE_CHECK_TARGET): Do not abort test suite on
  failures.
* debian/rules (DEB_CONFIGURE_EXTRA_FLAGS): Set ${bindir} to /usr/lib/psi.
* debian/rules (install/psi3): Move psi3 file to /usr/bin.
* debian/patches/07_464867_move_executables.dpatch: New patch, add
  /usr/lib/psi to the $PATH, so that the moved executables are found.
  (closes: #464867)
* debian/patches/00list: Adjusted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
extern "C" {
 
2
#include<stdio.h>
 
3
#include<stdlib.h>
 
4
#include<memory.h>
 
5
#include<libciomr/libciomr.h>
 
6
#include<libint/libint.h>
 
7
 
 
8
#include"defines.h"
 
9
#define EXTERN
 
10
#include"global.h"
 
11
}
 
12
 
 
13
/*-------------------------------------
 
14
  Swap ket and bra of a 4-index buffer
 
15
 -------------------------------------*/
 
16
extern "C" void ijkl_to_klij(double *ijkl_buf, double *klij_buf, int nij, int nkl)
 
17
{
 
18
  int ijkl = 0;
 
19
  for(int ij=0; ij<nij; ij++) {
 
20
 
 
21
    int klij = ij;
 
22
    for(int kl=0; kl<nkl; kl++,ijkl++,klij+=nij)
 
23
        klij_buf[klij] = ijkl_buf[ijkl];
 
24
 
 
25
  }
 
26
  return;
 
27
}
 
28
 
 
29
extern "C" void ijkl_to_jikl(double *ijkl_buf, double *jikl_buf, int ni, int nj, int nkl)
 
30
{
 
31
  double* ijkl_ptr = ijkl_buf;
 
32
  for(int i=0; i<ni; i++) {
 
33
    for(int j=0; j<nj; j++) {      
 
34
      int ji = j*ni+i;
 
35
      double* jikl_ptr = jikl_buf + ji*nkl;
 
36
      for(int kl=0;kl<nkl;kl++,ijkl_ptr++,jikl_ptr++)
 
37
        *jikl_ptr = *ijkl_ptr;
 
38
    }
 
39
  }
 
40
}
 
41
 
 
42
extern "C" void ijkl_to_ijlk(double *ijkl_buf, double *ijlk_buf, int nij, int nk, int nl)
 
43
{
 
44
  double* ijkl_ptr = ijkl_buf;
 
45
  for(int ij=0; ij<nij; ij++) {
 
46
    double* ij_offset_ptr = ijlk_buf + ij*nk*nl;
 
47
    for(int k=0; k<nk; k++) {
 
48
      double* ijlk_ptr = ij_offset_ptr + k;
 
49
      for(int l=0;l<nl;l++,ijkl_ptr++,ijlk_ptr+=nk)
 
50
        *ijlk_ptr = *ijkl_ptr;
 
51
    }
 
52
  }
 
53
}
 
54