Last change
on this file since 787 was 785, checked in by ansari, 26 years ago |
Corrections,amelioration de TArray<T> - Reza 16/3/2000
|
File size:
1.1 KB
|
Rev | Line | |
---|
[785] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
| 2 | // Utility classes for template numerical arrays
|
---|
| 3 | // R. Ansari, C.Magneville 03/2000
|
---|
| 4 |
|
---|
| 5 | #ifndef UtilArray_SEEN
|
---|
| 6 | #define UtilArray_SEEN
|
---|
| 7 |
|
---|
| 8 | #include "machdefs.h"
|
---|
| 9 | #include <stdlib.h>
|
---|
| 10 |
|
---|
| 11 | namespace SOPHYA {
|
---|
| 12 |
|
---|
| 13 | /* Quelques utilitaires pour les tableaux (Array) */
|
---|
| 14 |
|
---|
| 15 | typedef double (* Arr_DoubleFunctionOfX) (double x);
|
---|
| 16 | typedef float (* Arr_FloatFunctionOfX) (float x);
|
---|
| 17 |
|
---|
| 18 | class Sequence {
|
---|
| 19 | public:
|
---|
| 20 | Sequence (double start=0., double step=1., Arr_DoubleFunctionOfX f=NULL);
|
---|
| 21 | inline double & Start() { return start_; }
|
---|
| 22 | inline double & Step() { return step_; }
|
---|
| 23 | double operator () (uint_4 k);
|
---|
| 24 | protected:
|
---|
| 25 | double start_, step_;
|
---|
| 26 | Arr_DoubleFunctionOfX myf_;
|
---|
| 27 | };
|
---|
| 28 |
|
---|
| 29 | class Range {
|
---|
| 30 | public:
|
---|
| 31 | Range(uint_4 start=0, uint_4 size=1, uint_4 step=1);
|
---|
| 32 | inline uint_4 & Start() { return start_; }
|
---|
| 33 | inline uint_4 & Size() { return size_; }
|
---|
| 34 | inline uint_4 & Step() { return step_; }
|
---|
| 35 | Range & operator = (uint_4 start);
|
---|
| 36 | protected:
|
---|
| 37 | uint_4 start_, size_, step_;
|
---|
| 38 | };
|
---|
| 39 |
|
---|
| 40 | } // Fin du namespace
|
---|
| 41 |
|
---|
| 42 | #endif
|
---|
| 43 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.