source: git/factory/fac_iterfor.h @ b973c0

spielwiese
Last change on this file since b973c0 was b973c0, checked in by Jens Schmidt <schmidt@…>, 27 years ago
#include <config.h> added git-svn-id: file:///usr/local/Singular/svn/trunk@136 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.3 KB
Line 
1// emacs edit mode for this file is -*- C++ -*-
2// $Id: fac_iterfor.h,v 1.3 1997-04-07 16:24:16 schmidt Exp $
3
4#ifndef INCL_ITERFOR_H
5#define INCL_ITERFOR_H
6
7/*
8$Log: not supported by cvs2svn $
9Revision 1.2  1997/03/27 09:43:47  schmidt
10stream-io wrapped by NOSTREAMIO
11
12Revision 1.1  1996/07/08 08:18:49  stobbe
13"IteratedFor now handles the cases in which the mainvariable is not of
14level 1.
15"
16
17Revision 1.0  1996/05/17 10:59:40  stobbe
18Initial revision
19
20*/
21
22#include <config.h>
23
24#ifndef NOSTREAMIO
25#include <iostream.h>
26#endif /* NOSTREAMIO */
27
28class IteratedFor
29{
30private:
31    int MAX;
32    int FROM;
33    int TO;
34    int N;
35    bool last;
36    int * index;
37    int * imax;
38    void fill ( int from, int n );
39public:
40    IteratedFor( int from, int to, int max );
41    IteratedFor( const IteratedFor & );
42    ~IteratedFor();
43    IteratedFor& operator= ( const IteratedFor & );
44    int from() const { return FROM; }
45    int to() const { return TO; }
46    int n() const { return N; };
47    int max() const { return MAX; }
48    void nextiteration();
49    void operator++ () { nextiteration(); }
50    void operator++ ( int ) { nextiteration(); }
51    bool iterations_left() const { return ! last; }
52    int operator[] ( int ) const;
53};
54
55#ifndef NOSTREAMIO
56ostream& operator<< ( ostream &, const IteratedFor & );
57#endif /* NOSTREAMIO */
58
59#endif /* INCL_ITERFOR_H */
Note: See TracBrowser for help on using the repository browser.