Last change
on this file since 804 was 804, checked in by ansari, 25 years ago |
Amelioation / debugging de la classe TArray<T> - TVector et TMatrix
heritent maintenant de TArray<T> - Classe RCMatrix rendu prive au fichier
sopemtx.cc - linfit.cc integre a sopemtx.cc
Reza 03/04/2000
|
File size:
767 bytes
|
Rev | Line | |
---|
[785] | 1 | // Utility classes for template numerical arrays
|
---|
| 2 | // R. Ansari, C.Magneville 03/2000
|
---|
| 3 |
|
---|
| 4 | #include "machdefs.h"
|
---|
| 5 | #include "utilarr.h"
|
---|
| 6 |
|
---|
| 7 | // Classe utilitaires
|
---|
| 8 | Sequence::Sequence(double start, double step, Arr_DoubleFunctionOfX f)
|
---|
| 9 | {
|
---|
| 10 | start_ = start;
|
---|
| 11 | step_ = step;
|
---|
| 12 | myf_ = f;
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 | double Sequence::operator () (uint_4 k)
|
---|
| 16 | {
|
---|
| 17 | double x = start_+(double)k*step_;
|
---|
| 18 | if (myf_) return(myf_(x));
|
---|
| 19 | return x;
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | Range::Range(uint_4 start, uint_4 size, uint_4 step)
|
---|
| 23 | {
|
---|
| 24 | start_ = start;
|
---|
| 25 | size_ = (size > 0) ? size : 1;
|
---|
| 26 | step_ = (step > 0) ? step : 1;
|
---|
| 27 | }
|
---|
| 28 |
|
---|
[804] | 29 | /*
|
---|
[785] | 30 | Range & Range::operator = (uint_4 start)
|
---|
| 31 | {
|
---|
| 32 | start_ = start;
|
---|
| 33 | size_ = 1;
|
---|
| 34 | step_ = 1;
|
---|
| 35 | return (*this);
|
---|
| 36 | }
|
---|
[804] | 37 | */
|
---|
| 38 |
|
---|
| 39 |
|
---|
| 40 | IdentityMatrix::IdentityMatrix(double diag, uint_4 n)
|
---|
| 41 | {
|
---|
| 42 | size_ = n;
|
---|
| 43 | diag_ = diag;
|
---|
| 44 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.