ADMB Documentation  11.1.1913
 All Classes Files Functions Variables Typedefs Friends Defines
dmat33.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: dmat33.cpp 1657 2014-02-19 23:22:28Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include "fvar.hpp"
00012 
00013 //class banded_symmetric_dmatrix;
00014 
00019 ostream& operator << (const ostream& ofs1,const banded_symmetric_dmatrix& S1)
00020 {
00021   int w=ofs1.width();
00022   ostream& ofs=(ostream&) ofs1;
00023   banded_symmetric_dmatrix& S=(banded_symmetric_dmatrix&)(S1);
00024   int imin=S.indexmin();
00025   int imax=S.indexmax();
00026   int bw=S.bandwidth();
00027   int i1;
00028   int j1;
00029   for (int i=imin;i<=imax;i++)
00030   {
00031     for (int j=imin;j<=imax;j++)
00032     {
00033       if (j<=i)
00034       {
00035         j1=j;
00036         i1=i;
00037       }
00038       else
00039       {
00040         j1=i;
00041         i1=j;
00042       }
00043       if ( (i1-j1) < bw)
00044         ofs << setw(w) << S(i1,j1) << " ";
00045       else
00046         ofs << setw(w) << 0.0 << " ";
00047     }
00048     ofs << endl;
00049   }
00050   return ofs;
00051 }