00001 /* Copyright (C) 2001 Stefan Buehler <sbuehler@uni-bremen.de> 00002 00003 This program is free software; you can redistribute it and/or modify it 00004 under the terms of the GNU General Public License as published by the 00005 Free Software Foundation; either version 2, or (at your option) any 00006 later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 00016 USA. */ 00017 00029 #include "matpackI.h" 00030 #include "array.h" 00031 00041 VectorView VectorView::operator=(const Array<Numeric>& v) 00042 { 00043 // cout << "Assigning VectorView from Array<Numeric>.\n"; 00044 00045 // Check that sizes are compatible: 00046 assert(mrange.mextent==v.nelem()); 00047 00048 // Iterators for Array: 00049 Array<Numeric>::const_iterator i=v.begin(); 00050 const Array<Numeric>::const_iterator e=v.end(); 00051 // Iterator for Vector: 00052 Iterator1D target = begin(); 00053 00054 for ( ; i!=e ; ++i,++target ) 00055 *target = *i; 00056 00057 return *this; 00058 } 00059