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

« back to all changes in this revision

Viewing changes to src/lib/libdpd/buf4_print.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2006-09-10 14:01:33 UTC
  • Revision ID: james.westby@ubuntu.com-20060910140133-ib2j86trekykfsfv
Tags: upstream-3.2.3
ImportĀ upstreamĀ versionĀ 3.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include "dpd.h"
 
3
 
 
4
/* dpd_buf4_print(): Prints out data for all irreps of a dpd
 
5
** four-index buffer.
 
6
**
 
7
** Arguments:
 
8
**   dpdbuf4 *Buf: A pointer to the dpdbuf to be printed.
 
9
**   FILE *outfile: The formatted output file stream.
 
10
**   int print_data: 0 = print buf4 parameters only; 1 = print matrices
 
11
*/
 
12
 
 
13
int dpd_buf4_print(dpdbuf4 *Buf, FILE *outfile, int print_data)
 
14
{
 
15
  int h, i, all_buf_irrep;
 
16
  dpdparams4 *Params;
 
17
 
 
18
  all_buf_irrep = Buf->file.my_irrep;
 
19
  Params = Buf->params;
 
20
 
 
21
  fprintf(outfile, "\n\tDPD Buf4 for file4: %s\n", Buf->file.label);
 
22
  fprintf(outfile, "\n\tDPD Parameters:\n");
 
23
  fprintf(outfile,   "\t---------------\n");
 
24
  fprintf(outfile,   "\tpqnum = %d   rsnum = %d\n",
 
25
          Params->pqnum, Params->rsnum);
 
26
  fprintf(outfile, "\t   Row and column dimensions for DPD Block:\n");
 
27
  fprintf(outfile, "\t   ----------------------------------------\n");
 
28
  for(i=0; i < Params->nirreps; i++)
 
29
    fprintf(outfile,   "\t   Irrep: %1d row = %5d\tcol = %5d\n", i,
 
30
            Params->rowtot[i], Params->coltot[i^all_buf_irrep]);
 
31
  fflush(outfile);
 
32
 
 
33
  if(print_data) {
 
34
    for(h=0; h < Buf->params->nirreps; h++) {
 
35
      fprintf(outfile, "\n\tFile %3d DPD Buf4: %s\n", Buf->file.filenum,
 
36
              Buf->file.label);
 
37
      fprintf(outfile,   "\tMatrix for Irrep %1d\n", h);
 
38
      fprintf(outfile,   "\t----------------------------------------\n");
 
39
      dpd_buf4_mat_irrep_init(Buf, h);
 
40
      dpd_buf4_mat_irrep_rd(Buf, h);
 
41
      dpd_4mat_irrep_print(Buf->matrix[h], Buf->params, h, all_buf_irrep, outfile);
 
42
      dpd_buf4_mat_irrep_close(Buf, h);
 
43
    }
 
44
  }
 
45
 
 
46
  return 0;
 
47
 
 
48
}