spielwiese
Last change
on this file since d675c7 was
d675c7,
checked in by Rüdiger Stobbe <stobbe@…>, 27 years ago
|
"IteratedFor now handles the cases in which the mainvariable is not of
level 1.
"
git-svn-id: file:///usr/local/Singular/svn/trunk@38 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.1 1996-07-08 08:18:49 stobbe Exp $ |
---|
3 | |
---|
4 | #ifndef INCL_ITERFOR_H |
---|
5 | #define INCL_ITERFOR_H |
---|
6 | |
---|
7 | /* |
---|
8 | $Log: not supported by cvs2svn $ |
---|
9 | Revision 1.0 1996/05/17 10:59:40 stobbe |
---|
10 | Initial revision |
---|
11 | |
---|
12 | */ |
---|
13 | |
---|
14 | #include <iostream.h> |
---|
15 | |
---|
16 | class IteratedFor |
---|
17 | { |
---|
18 | private: |
---|
19 | int MAX; |
---|
20 | int FROM; |
---|
21 | int TO; |
---|
22 | int N; |
---|
23 | bool last; |
---|
24 | int * index; |
---|
25 | int * imax; |
---|
26 | void fill ( int from, int n ); |
---|
27 | public: |
---|
28 | IteratedFor( int from, int to, int max ); |
---|
29 | IteratedFor( const IteratedFor & ); |
---|
30 | ~IteratedFor(); |
---|
31 | IteratedFor& operator= ( const IteratedFor & ); |
---|
32 | int from() const { return FROM; } |
---|
33 | int to() const { return TO; } |
---|
34 | int n() const { return N; }; |
---|
35 | int max() const { return MAX; } |
---|
36 | void nextiteration(); |
---|
37 | void operator++ () { nextiteration(); } |
---|
38 | void operator++ ( int ) { nextiteration(); } |
---|
39 | bool iterations_left() const { return ! last; } |
---|
40 | int operator[] ( int ) const; |
---|
41 | }; |
---|
42 | |
---|
43 | ostream& operator<< ( ostream &, const IteratedFor & ); |
---|
44 | |
---|
45 | #endif /* INCL_ITERFOR_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.