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

« back to all changes in this revision

Viewing changes to src/lib/libiwl/buf_flush.cc

  • 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
/*!
 
2
  \file
 
3
  \ingroup IWL
 
4
*/
 
5
#include <cstdio>
 
6
#include <libciomr/libciomr.h>
 
7
#include "iwl.h"
 
8
#include "iwl.hpp"
 
9
 
 
10
using namespace psi;
 
11
 
 
12
void IWL::flush(int lastbuf)
 
13
{
 
14
    int idx;
 
15
    Label *lblptr;
 
16
    Value *valptr;
 
17
 
 
18
    inbuf_ = idx_;
 
19
    lblptr = labels_;
 
20
    valptr = values_;
 
21
 
 
22
    idx = 4 * idx_;
 
23
 
 
24
    while (idx_ < ints_per_buf_) {
 
25
        lblptr[idx++] = 0;
 
26
        lblptr[idx++] = 0;
 
27
        lblptr[idx++] = 0;
 
28
        lblptr[idx++] = 0;
 
29
        valptr[idx_] = 0.0;
 
30
        idx_++;
 
31
    }
 
32
 
 
33
    if (lastbuf) lastbuf_ = 1;
 
34
    else lastbuf_ = 0;
 
35
 
 
36
    put();
 
37
    idx_ = 0;
 
38
}
 
39
 
 
40
extern "C" {
 
41
        
 
42
/*!
 
43
** iwl_buf_flush()
 
44
**
 
45
**      \param Buf     To be flushed buffer
 
46
**      \param lastbuf Flag for the last buffer
 
47
**
 
48
** Flush an Integrals With Labels Buffer
 
49
** All flushing should be done through this routine!
 
50
** David Sherrill, March 1995
 
51
** \ingroup IWL
 
52
*/
 
53
void iwl_buf_flush(struct iwlbuf *Buf, int lastbuf)
 
54
{
 
55
  int idx;
 
56
  Label *lblptr;
 
57
  Value *valptr;
 
58
  
 
59
  Buf->inbuf = Buf->idx;
 
60
  lblptr = Buf->labels;
 
61
  valptr = Buf->values;
 
62
  
 
63
  idx = 4 * Buf->idx;
 
64
 
 
65
  while (Buf->idx < Buf->ints_per_buf) {
 
66
    lblptr[idx++] = 0;
 
67
    lblptr[idx++] = 0;
 
68
    lblptr[idx++] = 0;
 
69
    lblptr[idx++] = 0;
 
70
    valptr[Buf->idx] = 0.0;
 
71
    Buf->idx++;
 
72
  }
 
73
  
 
74
  if (lastbuf) Buf->lastbuf = 1;
 
75
  else Buf->lastbuf = 0;
 
76
 
 
77
  iwl_buf_put(Buf);
 
78
  Buf->idx = 0;
 
79
}
 
80
 
 
81
} /* extern "C" */
 
 
b'\\ No newline at end of file'