Statistics
| Revision:

root / trunk / src / linad99 / dmat33.cpp @ 1657

History | View | Annotate | Download (910 Bytes)

1
/*
2
 * $Id: dmat33.cpp 1657 2014-02-19 23:22:28Z johnoel $
3
 *
4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California
6
 */
7
/**
8
 * \file
9
 * Description not yet available.
10
 */
11
#include "fvar.hpp"
12

    
13
//class banded_symmetric_dmatrix;
14

    
15
/**
16
 * Description not yet available.
17
 * \param
18
 */
19
ostream& operator << (const ostream& ofs1,const banded_symmetric_dmatrix& S1)
20
{
21
  int w=ofs1.width();
22
  ostream& ofs=(ostream&) ofs1;
23
  banded_symmetric_dmatrix& S=(banded_symmetric_dmatrix&)(S1);
24
  int imin=S.indexmin();
25
  int imax=S.indexmax();
26
  int bw=S.bandwidth();
27
  int i1;
28
  int j1;
29
  for (int i=imin;i<=imax;i++)
30
  {
31
    for (int j=imin;j<=imax;j++)
32
    {
33
      if (j<=i)
34
      {
35
        j1=j;
36
        i1=i;
37
      }
38
      else
39
      {
40
        j1=i;
41
        i1=j;
42
      }
43
      if ( (i1-j1) < bw)
44
        ofs << setw(w) << S(i1,j1) << " ";
45
      else
46
        ofs << setw(w) << 0.0 << " ";
47
    }
48
    ofs << endl;
49
  }
50
  return ofs;
51
}