xc
ConstantKLayerConstRef.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 // Este software se distribuye con la esperanza de que sea útil, pero
13 // SIN GARANTÍA ALGUNA; ni siquiera la garantía implícita
14 // MERCANTIL o de APTITUD PARA UN PROPÓSITO DETERMINADO.
15 // Consulte los detalles DE LA LICENCIA PÚBLICA GENERAL GNU PARA OBTENER
16 // UNA INFORMACIÓN MÁS DETALLADA.
17 //
18 // DEBERÍA HABER RECIBIDO UNA COPIA DE LA LICENCIA PÚBLICA GENERAL GNU
19 // JUNTO A ESTE PROGRAMA.
20 // EN CASO CONTRARIO, CONSULTE <HTTP://WWW.GNU.ORG/LICENSES/>.
21 //----------------------------------------------------------------------------
22 //CONSTANTKLAYERCONSTREF.H
23 
24 #ifndef CONSTANTKLAYERCONSTREF_H
25 #define CONSTANTKLAYERCONSTREF_H
26 
27 #include "Array3dRange.h"
28 
29 
31 //
34 template <class ARRAY_3D>
36  {
37  public:
38  typedef typename Array3dBoxConstRef<ARRAY_3D>::const_reference const_reference;
39 
40  explicit ConstantKLayerConstRef(const ARRAY_3D &m,const size_t &c=1,const size_t &iLayer= 1,const size_t &f= 1);
41  ConstantKLayerConstRef(const ARRAY_3D &m,const size_t &,const size_t &,const size_t &,const size_t &,const size_t &);
42  ConstantKLayerConstRef(const ARRAY_3D &t,const RangoIndice &column_range,const RangoIndice &row_range,const size_t &c);
43  inline virtual ~ConstantKLayerConstRef(void) {}
44  virtual const_reference operator()(size_t iLayer=1,size_t iRow=1) const
45  { return Array3dBoxConstRef<ARRAY_3D>::operator()(iLayer,iRow,1); }
46  };
47 
48 template<class ARRAY_3D>
49 ConstantKLayerConstRef<ARRAY_3D>::ConstantKLayerConstRef(const ARRAY_3D &t,const size_t &c,const size_t &iLayer,const size_t &f)
50  : Array3dBoxConstRef<ARRAY_3D>(t,Array3dRange(RangoIndice(iLayer,t.getNumberOfLayers()),RangoIndice(f,t.getNumberOfRows()),c)) {}
51 
52 template<class ARRAY_3D>
53 ConstantKLayerConstRef<ARRAY_3D>::ConstantKLayerConstRef(const ARRAY_3D &t,const size_t &c,const size_t &iLayer1,const size_t &f1,const size_t &iLayer2,const size_t &f2)
54  : Array3dBoxConstRef<ARRAY_3D>(t,Array3dRange(RangoIndice(iLayer1,iLayer2),RangoIndice(f1,f2),c)) {}
55 
56 template<class ARRAY_3D>
57 ConstantKLayerConstRef<ARRAY_3D>::ConstantKLayerConstRef(const ARRAY_3D &t,const RangoIndice &column_range,const RangoIndice &row_range,const size_t &c)
58  : Array3dBoxConstRef<ARRAY_3D>(t,column_range,row_range,c)
59  {}
60 
61 #endif
Referencia a una "sub array 3D".
Definition: Array3dBoxConstRef.h:34
Reference to a layer of the array which points have constant K index.
Definition: ConstantKLayerConstRef.h:35
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