ARTS  1.0.222
matpackI.cc
Go to the documentation of this file.
1 /* Copyright (C) 2001 Stefan Buehler <sbuehler@uni-bremen.de>
2 
3  This program is free software; you can redistribute it and/or modify it
4  under the terms of the GNU General Public License as published by the
5  Free Software Foundation; either version 2, or (at your option) any
6  later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16  USA. */
17 
29 #include "matpackI.h"
30 #include "array.h"
31 
42 {
43  // cout << "Assigning VectorView from Array<Numeric>.\n";
44 
45  // Check that sizes are compatible:
46  assert(mrange.mextent==v.nelem());
47 
48  // Iterators for Array:
50  const Array<Numeric>::const_iterator e=v.end();
51  // Iterator for Vector:
52  Iterator1D target = begin();
53 
54  for ( ; i!=e ; ++i,++target )
55  *target = *i;
56 
57  return *this;
58 }
59 
ConstVectorView::mrange
Range mrange
The range of mdata that is actually used.
Definition: matpackI.h:265
array.h
This file contains the definition of Array.
matpackI.h
Array< Numeric >
Iterator1D
The iterator class for sub vectors.
Definition: matpackI.h:178
VectorView
The VectorView class.
Definition: matpackI.h:281
VectorView::begin
ConstIterator1D begin() const
Return const iterator to first element.
Definition: matpackI.h:1095
Range::mextent
Index mextent
The number of elements.
Definition: matpackI.h:171
VectorView::operator=
VectorView operator=(const ConstVectorView &v)
Assignment operator.
Definition: matpackI.h:1127
Array::nelem
Index nelem() const
Number of elements.
Definition: array.h:115