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

« back to all changes in this revision

Viewing changes to src/lib/libciomr/print_mat.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
/*!
 
2
** \file print_mat.c
 
3
** \ingroup (CIOMR)
 
4
*/
 
5
 
 
6
/* $Log: print_mat.c,v $
 
7
/* Revision 1.3  2002/06/01 18:23:54  sherrill
 
8
/* Upgrade doxygen documentation
 
9
/*
 
10
/* Revision 1.2  2002/04/19 21:48:06  sherrill
 
11
/* Remove some unused functions and do doxygen markup of libciomr.
 
12
/*
 
13
/* Revision 1.1.1.1  2000/02/04 22:53:21  evaleev
 
14
/* Started PSI 3 repository
 
15
/*
 
16
/* Revision 2.1  1991/06/15 18:29:43  seidl
 
17
/* *** empty log message ***
 
18
/* */
 
19
 
 
20
static char *rcsid = "$Id: print_mat.c,v 1.3 2002/06/01 18:23:54 sherrill Exp $";
 
21
 
 
22
#include "includes.h"
 
23
 
 
24
/*
 
25
** print_mat: Print a matrix a of dimensions mxn to file pointer out.
 
26
**
 
27
** \ingroup (CIOMR)
 
28
*/
 
29
void print_mat(double **a, int m, int n, FILE *out)
 
30
   {
 
31
      int ii,jj,kk,nn,ll;
 
32
      int i,j,k;
 
33
 
 
34
      ii=0;jj=0;
 
35
L200:
 
36
      ii++;
 
37
      jj++;
 
38
      kk=10*jj;
 
39
      nn=n;
 
40
      if (nn > kk) nn=kk;
 
41
      ll = 2*(nn-ii+1)+1;
 
42
      fprintf (out,"\n");
 
43
      for (i=ii; i <= nn; i++) fprintf(out,"       %5d",i);
 
44
      fprintf (out,"\n");
 
45
      for (i=0; i < m; i++) {
 
46
         fprintf (out,"\n%5d",i+1);
 
47
         for (j=ii-1; j < nn; j++) {
 
48
            fprintf (out,"%12.7f",a[i][j]);
 
49
            }
 
50
         }
 
51
      fprintf (out,"\n");
 
52
      if (n <= kk) {
 
53
         fflush(out);
 
54
         return;
 
55
         }
 
56
      ii=kk; goto L200;
 
57
      }