~ubuntu-branches/ubuntu/precise/psicode/precise

« back to all changes in this revision

Viewing changes to src/bin/input/oe_osrr_float.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 <stdio.h>
2
 
 
3
 
#include "defines.h"
4
 
#define EXTERN
5
 
#include "global.h"
6
 
 
7
 
#include "float.h"
8
 
 
9
 
void OI_OSrecurs_float(FLOAT** OIX, FLOAT** OIY, FLOAT** OIZ, FLOAT PA[3], FLOAT PB[3],
10
 
                 FLOAT gamma, int lmaxi, int lmaxj)
11
 
{
12
 
  int i,j,k;
13
 
  FLOAT pp = 1/(2*gamma);
14
 
 
15
 
  OIX[0][0] = OIY[0][0] = OIZ[0][0] = 1.0;
16
 
 
17
 
  if (!lmaxi && !lmaxj)
18
 
    return;
19
 
 
20
 
        /* Upward recursion in j for i=0 */
21
 
  if (lmaxj) {
22
 
    OIX[0][1] = PB[0];
23
 
    OIY[0][1] = PB[1];
24
 
    OIZ[0][1] = PB[2];
25
 
  }
26
 
 
27
 
  for(j=1;j<lmaxj;j++) {
28
 
    OIX[0][j+1] = PB[0]*OIX[0][j];
29
 
    OIY[0][j+1] = PB[1]*OIY[0][j];
30
 
    OIZ[0][j+1] = PB[2]*OIZ[0][j];
31
 
    OIX[0][j+1] += j*pp*OIX[0][j-1];
32
 
    OIY[0][j+1] += j*pp*OIY[0][j-1];
33
 
    OIZ[0][j+1] += j*pp*OIZ[0][j-1];
34
 
  }
35
 
 
36
 
        /* Upward recursion in i for all j's */
37
 
 
38
 
  if (lmaxi) {
39
 
    OIX[1][0] = PA[0];
40
 
    OIY[1][0] = PA[1];
41
 
    OIZ[1][0] = PA[2];
42
 
  }
43
 
  for(j=1;j<=lmaxj;j++) {
44
 
    OIX[1][j] = PA[0]*OIX[0][j];
45
 
    OIY[1][j] = PA[1]*OIY[0][j];
46
 
    OIZ[1][j] = PA[2]*OIZ[0][j];
47
 
    OIX[1][j] += j*pp*OIX[0][j-1];
48
 
    OIY[1][j] += j*pp*OIY[0][j-1];
49
 
    OIZ[1][j] += j*pp*OIZ[0][j-1];
50
 
  }
51
 
  for(i=1;i<lmaxi;i++) {
52
 
    OIX[i+1][0] = PA[0]*OIX[i][0];
53
 
    OIY[i+1][0] = PA[1]*OIY[i][0];
54
 
    OIZ[i+1][0] = PA[2]*OIZ[i][0];
55
 
    OIX[i+1][0] += i*pp*OIX[i-1][0];
56
 
    OIY[i+1][0] += i*pp*OIY[i-1][0];
57
 
    OIZ[i+1][0] += i*pp*OIZ[i-1][0];
58
 
    for(j=1;j<=lmaxj;j++) {
59
 
      OIX[i+1][j] = PA[0]*OIX[i][j];
60
 
      OIY[i+1][j] = PA[1]*OIY[i][j];
61
 
      OIZ[i+1][j] = PA[2]*OIZ[i][j];
62
 
      OIX[i+1][j] += i*pp*OIX[i-1][j];
63
 
      OIY[i+1][j] += i*pp*OIY[i-1][j];
64
 
      OIZ[i+1][j] += i*pp*OIZ[i-1][j];
65
 
      OIX[i+1][j] += j*pp*OIX[i][j-1];
66
 
      OIY[i+1][j] += j*pp*OIY[i][j-1];
67
 
      OIZ[i+1][j] += j*pp*OIZ[i][j-1];
68
 
    }
69
 
  }
70
 
 
71
 
  return;
72
 
}