AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects Version of the Day
AbstractLinAlgPack_COOMatrixOutFunc.cpp
00001 #if 0
00002 
00003 // @HEADER
00004 // ***********************************************************************
00005 // 
00006 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
00007 //                  Copyright (2003) Sandia Corporation
00008 // 
00009 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00010 // license for use of this work by or on behalf of the U.S. Government.
00011 // 
00012 // This library is free software; you can redistribute it and/or modify
00013 // it under the terms of the GNU Lesser General Public License as
00014 // published by the Free Software Foundation; either version 2.1 of the
00015 // License, or (at your option) any later version.
00016 //  
00017 // This library is distributed in the hope that it will be useful, but
00018 // WITHOUT ANY WARRANTY; without even the implied warranty of
00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 // Lesser General Public License for more details.
00021 //  
00022 // You should have received a copy of the GNU Lesser General Public
00023 // License along with this library; if not, write to the Free Software
00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 // USA
00026 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 
00027 // 
00028 // ***********************************************************************
00029 // @HEADER
00030 
00031 #include "AbstractLinAlgPack_COOMatrixOutFunc.hpp"
00032 #include "AbstractLinAlgPack_COOMatrixClass.hpp"
00033 
00034 std::ostream& AbstractLinAlgPack::output(std::ostream& o, const COOMatrix& coom) {
00035 
00036   o << coom.rows() << " " << coom.cols() << " " << coom.nz() << "\n";
00037 
00038   const COOMatrix::value_type
00039     *itr_val    = coom.const_val(),
00040     *itr_val_end  = coom.const_val() + coom.nz();
00041   const COOMatrix::indice_type
00042     *itr_ivect  = coom.const_ivect(),
00043     *itr_jvect  = coom.const_jvect();
00044 
00045   for(; itr_val != itr_val_end; ++itr_val, ++itr_ivect, ++itr_jvect)
00046     o << *itr_val << ":" << *itr_ivect << ":" << *itr_jvect << " ";
00047   o << "\n";
00048 
00049   return o;
00050 }
00051 
00052 #endif // 0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends