Overture  Version 25
StretchMapping.h
Go to the documentation of this file.
1 //
2 // Stretching
3 //
4 #ifndef STRETCH_H
5 #define STRETCH_H "Stretch.h"
6 
7 #include "Mapping.h"
8 #include "mathutil.h"
9 
10 class StretchMapping : public Mapping{
11 //-------------------------------------------------------------
12 // Define stretching routines
13 //------------------------------------------------------------
14 
15 
16  public:
17 
19  {
26  linearSpacing, // from Philip Blakely -- not really linear
28  };
29 
31  StretchMapping( const int numberOfLayers, const int numberOfIntervals=0 );
32 
33  // Copy constructor is deep by default
34  StretchMapping( const StretchMapping &, const CopyType copyType=DEEP );
35 
37 
38  // assignment with = is a deep copy
40 
42 
43  int setNumberOfLayers( const int numberOfLayers );
44 
45  int setNumberOfIntervals( const int numberOfIntervals );
46 
47  int setLayerParameters( const int index, const real a, const real b, const real c );
48 
49  int setIntervalParameters( const int index, const real d, const real e, const real f );
50 
51  int setIsNormalized( const bool & trueOrFalse=TRUE );
52 
53  int setEndPoints( const real rmin, const real rmax );
54 
55  int setScaleParameters( const real origin, const real scale );
56 
58 
59  int setIsPeriodic( const int trueOrFalse );
60  virtual void setIsPeriodic( const int axis, const periodicType isPeriodic );
61 
63  const real & ar,
64  const real & a1,
65  const real & b1,
66  const real & c1);
67 
68  int setExponentialParameters(const real & a0,
69  const real & ar,
70  const real & a1,
71  const real & b1,
72  const real & c1);
73 
75  const real & b,
76  const real & c );
77 
78  int setLinearSpacingParameters(const real & a0, const real & a1);
79 
80  int initialize( );
81 
82  virtual int get( const GenericDataBase & dir, const aString & name); // get from a database file
83  virtual int put( GenericDataBase & dir, const aString & name) const; // put to a database file
84 
86 
88 
89  void display( const aString & label = blankString ) const;
90 
93 
96 
99 
100  void mapS( const RealArray & r, RealArray & x, RealArray &xr = Overture::nullRealArray(),
102 
103  void inverseMapS( const RealArray & x, RealArray & r, RealArray & rx = Overture::nullRealArray(),
105 
106  void basicInverseS(const RealArray & x,
107  RealArray & r,
110 
111  int update( MappingInformation & mapInfo );
112 
113  protected:
114 
122  int iopt,ierr;
126 
132 
133  void setup();
134 
135  private:
136 
137  //
138  // Virtual member functions used only through class ReferenceCounting:
139  //
141  { return operator=( (StretchMapping & )x); }
142  virtual void reference( const ReferenceCounting& x)
143  { reference((StretchMapping &)x); } // *** Conversion to this class for the virtual = ****
144  virtual ReferenceCounting* virtualConstructor( const CopyType ct = DEEP ) const
145  { return ::new StretchMapping(*this, ct); }
146 };
147 
148 
149 
150 #endif // STRETCH_H