00001 /*************************************************************************** 00002 basemtxreader.cpp - description 00003 ------------------- 00004 begin : Tue Dec 2 2003 00005 copyright : (C) 2003 by Roman Geus 00006 email : roman.geus@psi.ch 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #include <fstream> 00019 #include "basemtxreader.h" 00020 00021 using namespace std; 00022 00023 BaseMtxReader::BaseMtxReader(string filename, const Epetra_Comm& Comm) 00024 : _comm(Comm) 00025 { 00026 _istr = new ifstream(filename.c_str()); 00027 _own_istr = true; 00028 } 00029 00030 BaseMtxReader::BaseMtxReader(istream& istr, const Epetra_Comm& Comm) 00031 : _comm(Comm) 00032 { 00033 _istr = &istr; _own_istr = false; 00034 } 00035 00036 BaseMtxReader::~BaseMtxReader(){ 00037 if (_own_istr) 00038 delete _istr; 00039 }