xc
ConstantJLayerConstRef.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. Pérez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //ConstantJLayerConstRef.h
22 
23 #ifndef CONSTANTJLAYERCONSTREF_H
24 #define CONSTANTJLAYERCONSTREF_H
25 
26 #include "Array3dRange.h"
27 
28 
30 //
33 template <class ARRAY_3D>
35  {
36  public:
37  typedef typename Array3dBoxConstRef<ARRAY_3D>::const_reference const_reference;
38 
39  explicit ConstantJLayerConstRef(const ARRAY_3D &m,const size_t &iLayer=1,const size_t &f= 1,const size_t &c= 1);
40  ConstantJLayerConstRef(const ARRAY_3D &m,const size_t &,const size_t &,const size_t &,const size_t &,const size_t &);
41  ConstantJLayerConstRef(const ARRAY_3D &t,const RangoIndice &layer_range,const size_t &f,const RangoIndice &column_range);
42  inline virtual ~ConstantJLayerConstRef(void) {}
43  virtual const_reference operator()(size_t iLayer=1,size_t col=1) const
44  { return Array3dBoxConstRef<ARRAY_3D>::operator()(iLayer,1,col); }
45  };
46 
47 template<class ARRAY_3D>
48 ConstantJLayerConstRef<ARRAY_3D>::ConstantJLayerConstRef(const ARRAY_3D &t,const size_t &iLayer,const size_t &f,const size_t &c)
49  : Array3dBoxConstRef<ARRAY_3D>(t,Array3dRange(RangoIndice(iLayer,t.getNumberOfLayers()),f,RangoIndice(c,t.getNumberOfColumns()))) {}
50 
51 template<class ARRAY_3D>
52 ConstantJLayerConstRef<ARRAY_3D>::ConstantJLayerConstRef(const ARRAY_3D &t,const size_t &f,const size_t &iLayer1,const size_t &c1,const size_t &iLayer2,const size_t &c2)
53  : Array3dBoxConstRef<ARRAY_3D>(t,Array3dRange(RangoIndice(iLayer1,iLayer2),f,RangoIndice(c1,c2))) {}
54 
55 template<class ARRAY_3D>
56 ConstantJLayerConstRef<ARRAY_3D>::ConstantJLayerConstRef(const ARRAY_3D &t,const RangoIndice &layer_range,const size_t &f,const RangoIndice &column_range)
57  : Array3dBoxConstRef<ARRAY_3D>(t,layer_range,f,column_range) {}
58 
59 #endif
Reference to a layer of the array which points have constant J index.
Definition: ConstantJLayerConstRef.h:34
Referencia a una "sub array 3D".
Definition: Array3dBoxConstRef.h:34
Rangos de variación de tres índices, se emplea en BoxConstRef.
Definition: Array3dRange.h:32
Rango de variación de un índice, se emplea en BoxConstRef.
Definition: RangoIndice.h:30