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

« back to all changes in this revision

Viewing changes to src/lib/libchkpt/ua2a.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 CHKPT
 
4
*/
 
5
 
 
6
#include <cstdlib>
 
7
#include <psifiles.h>
 
8
#include <libpsio/psio.hpp>
 
9
extern "C" {
 
10
        #include <libchkpt/chkpt.h>
 
11
}
 
12
#include <libchkpt/chkpt.hpp>
 
13
 
 
14
using namespace psi;
 
15
 
 
16
int *Chkpt::rd_ua2a(void)
 
17
{
 
18
        int *ua2a;
 
19
        int num_unique_atoms;
 
20
        char *keyword;
 
21
        keyword = build_keyword("Unique atom -> full atom map");
 
22
 
 
23
        num_unique_atoms = rd_num_unique_atom();
 
24
        ua2a = array<int>(num_unique_atoms);
 
25
 
 
26
        psio->read_entry(PSIF_CHKPT, keyword, (char *) ua2a, num_unique_atoms*sizeof(int));
 
27
 
 
28
        free(keyword);
 
29
        return ua2a;
 
30
}
 
31
 
 
32
void Chkpt::wt_ua2a(int *ua2a)
 
33
{
 
34
        int num_unique_atoms;
 
35
        char *keyword;
 
36
        keyword = build_keyword("Unique atom -> full atom map");
 
37
 
 
38
        num_unique_atoms = rd_num_unique_atom();
 
39
 
 
40
        psio->write_entry(PSIF_CHKPT, keyword, (char *) ua2a, num_unique_atoms*sizeof(int));
 
41
 
 
42
        free(keyword);
 
43
}
 
44
 
 
45
extern "C" {
 
46
/*!
 
47
** int *chkpt_rd_ua2a()
 
48
** Reads in a mapping array from the symmetry-unique atom
 
49
** list to the full atom list
 
50
**
 
51
** returns: ua2a = Read in an array num_unique_atom long
 
52
** 
 
53
** \ingroup CHKPT
 
54
*/
 
55
        int *chkpt_rd_ua2a(void)
 
56
        {
 
57
                return _default_chkpt_lib_->rd_ua2a();
 
58
        }
 
59
 
 
60
/*!
 
61
** void chkpt_wt_ua2a(int *)
 
62
** Writes out a mapping array from the symmetry-unique atom
 
63
** list to the full atom list
 
64
**
 
65
** \param ua2a = An array num_unique_atom long
 
66
**
 
67
** returns: none
 
68
*/
 
69
        void chkpt_wt_ua2a(int *ua2a)
 
70
        {
 
71
                _default_chkpt_lib_->wt_ua2a(ua2a);
 
72
        }
 
73
}