File: GridIterator.h

package info (click to toggle)
stopt 5.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,772 kB
  • sloc: cpp: 70,373; python: 5,942; makefile: 67; sh: 57
file content (61 lines) | stat: -rw-r--r-- 1,682 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright (C) 2016 EDF
// All Rights Reserved
// This code is published under the GNU Lesser General Public License (GNU LGPL)
#ifndef GRIDITERATOR_H
#define GRIDITERATOR_H
#include <Eigen/Dense>

/**  \file GridIterator.h
 *   \brief Defines an iterator on the points of a grid
 *   \author Xavier Warin
 */
namespace StOpt
{

/// \class  GridIterator  GridIterator.h
///    Iterator on a given grid
class GridIterator
{

public :

    /// \brief Constructor
    GridIterator() {}

    /// \brief Destructor
    virtual ~GridIterator() {}

    /// \brief get current  coordinates
    virtual  Eigen::ArrayXd  getCoordinate() const = 0 ;

    /// \brief Check if the iterator is valid
    virtual  bool isValid(void) const = 0;

    /// \brief iterate on point
    virtual void next() = 0;

    /// \brief iterate jumping some point
    /// \param p_incr  increment in the jump
    virtual void nextInc(const int &p_incr) = 0;

    /// \brief get counter  : the integer associated the current point
    virtual int getCount() const = 0;

    /// \brief Permits to  jump to a given place given the number of processors (permits to use MPI and openmp)
    /// \param  p_rank    processor rank
    /// \param  p_nbProc  number of processor
    /// \param  p_jump    increment jump for iterator
    virtual void jumpToAndInc(const int &p_rank, const int &p_nbProc, const int &p_jump) = 0;

    /// \brief return relative position
    virtual int  getRelativePosition() const = 0 ;

    /// \brief return number of points treated
    virtual  int getNbPointRelative() const = 0 ;

    /// \brief Reset the interpolator
    virtual void reset() = 0 ;

};
}
#endif /* GRIDITERATOR_H */