ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
dvect23.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include <fvar.hpp>
00012 
00017 ostream& operator<<(const ostream& _ofs, const pre_column_print& p)
00018 {
00019   ostream& ofs= (ostream&) _ofs;
00020   int mmin=p.ptr->indexmin();
00021   int mmax=p.ptr->indexmax();
00022   for (int i=mmin;i<=mmax;i++)
00023   {
00024     ofs << double((*(p.ptr))[i]) << endl;
00025   }
00026   return ofs;
00027 }
00028 
00033 pre_column_print column_print(const dvector& v)
00034 {
00035   return pre_column_print(v);
00036 }
00037 
00042 ostream& operator << (const ostream& _ofs, const pre_zero_print& p)
00043 {
00044   ostream& ofs= (ostream&) _ofs;
00045   int mmin=p.ptr->indexmin();
00046   int mmax=p.ptr->indexmax();
00047   for (int i=mmin;i<=mmax;i++)
00048   {
00049     double tmp= double((*(p.ptr))[i]);
00050     if (tmp ==0)
00051       ofs << "0 ";
00052     else
00053       ofs << tmp << " ";
00054   }
00055   return ofs;
00056 }
00057 
00062 pre_zero_print zero_print(const dvector& v)
00063 {
00064   return pre_zero_print(v);
00065 }