source: git/factory/fac_iterfor.h @ cd86ac

spielwiese
Last change on this file since cd86ac was 493c477, checked in by Jens Schmidt <schmidt@…>, 27 years ago
o header fixed git-svn-id: file:///usr/local/Singular/svn/trunk@404 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.0 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: fac_iterfor.h,v 1.4 1997-06-19 12:23:29 schmidt Exp $ */
3
4#ifndef INCL_FAC_ITERFOR_H
5#define INCL_FAC_ITERFOR_H
6
7#include <config.h>
8
9#ifndef NOSTREAMIO
10#include <iostream.h>
11#endif /* NOSTREAMIO */
12
13class IteratedFor
14{
15private:
16    int MAX;
17    int FROM;
18    int TO;
19    int N;
20    bool last;
21    int * index;
22    int * imax;
23    void fill ( int from, int n );
24public:
25    IteratedFor( int from, int to, int max );
26    IteratedFor( const IteratedFor & );
27    ~IteratedFor();
28    IteratedFor& operator= ( const IteratedFor & );
29    int from() const { return FROM; }
30    int to() const { return TO; }
31    int n() const { return N; };
32    int max() const { return MAX; }
33    void nextiteration();
34    void operator++ () { nextiteration(); }
35    void operator++ ( int ) { nextiteration(); }
36    bool iterations_left() const { return ! last; }
37    int operator[] ( int ) const;
38};
39
40#ifndef NOSTREAMIO
41ostream& operator<< ( ostream &, const IteratedFor & );
42#endif /* NOSTREAMIO */
43
44#endif /* ! INCL_FAC_ITERFOR_H */
Note: See TracBrowser for help on using the repository browser.