ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dmat33.cpp
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Author: David Fournier
5  * Copyright (c) 2008-2012 Regents of the University of California
6  */
11 #include "fvar.hpp"
12 #include <cassert>
13 #include <climits>
14 
15 //class banded_symmetric_dmatrix;
16 
21 ostream& operator<<(const ostream& ofs1, const banded_symmetric_dmatrix& S1)
22 {
23  std::streamsize width = ofs1.width();
24  assert(width <= INT_MAX);
25  int w= (int)width;
26  ostream& ofs=(ostream&) ofs1;
28  int imin=S.indexmin();
29  int imax=S.indexmax();
30  int bw=S.bandwidth();
31  int i1;
32  int j1;
33  for (int i=imin;i<=imax;i++)
34  {
35  for (int j=imin;j<=imax;j++)
36  {
37  if (j<=i)
38  {
39  j1=j;
40  i1=i;
41  }
42  else
43  {
44  j1=i;
45  i1=j;
46  }
47  if ( (i1-j1) < bw)
48  ofs << setw(w) << S(i1,j1) << " ";
49  else
50  ofs << setw(w) << 0.0 << " ";
51  }
52  ofs << endl;
53  }
54  return ofs;
55 }
Description not yet available.
Definition: fvar.hpp:7981
int indexmax(void) const
Definition: fvar.hpp:7999
prnstream & endl(prnstream &)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
ostream & operator<<(const ostream &_s, preshowpoint p)
Description not yet available.
Definition: admanip.cpp:48
#define w
int indexmin(void) const
Definition: fvar.hpp:7995
int bandwidth(void) const
Definition: fvar.hpp:7991