Overture  Version 25
ComposeMapping.h
Go to the documentation of this file.
1 #ifndef COMPOSE_MAPPING_H
2 #define COMPOSE_MAPPING_H "ComposeMapping.h"
3 
4 #include "Mapping.h"
5 #include "Inverse.h"
6 #include "MappingRC.h"
7 
8 class ComposeMapping : public Mapping{
9 //----------------------------------------------------------------
10 // Compose two Mapping functions
11 // -----------------------------
12 // Constructor example:
13 // ComposeMapping mapc( mapa,mapb );
14 // ...means
15 // mapc <- (mapb o mapa)
16 // mapc means to apply mapa followed by mapb
17 //----------------------------------------------------------------
18  public:
19 
20  // keep reference counted versions of the mappings that we compose
23 
24  ComposeMapping( );
25 
26  //
27  // Constructor specifying the two mappings to compose, mapb o mapa
28  //
29  ComposeMapping( Mapping & mapa, Mapping & mapb );
30 
31  //
32  // specify the two mappings to compose, mapb o mapa
33  //
34  void setMappings( Mapping & mapa, Mapping & mapb );
35 
36  // Copy constructor is deep by default
37  ComposeMapping( const ComposeMapping &, const CopyType copyType=DEEP );
38 
40 
42 
44  bool includeGhost=false);
45 
46  virtual int get( const GenericDataBase & dir, const aString & name); // get from a database file
47  virtual int put( GenericDataBase & dir, const aString & name) const; // put to a database file
48 
50 
51  aString getClassName() const { return ComposeMapping::className; }
52 
53  virtual void useRobustInverse(const bool trueOrFalse=TRUE );
54 
57 
60 
63 
64  void mapS( const RealArray & r, RealArray & x, RealArray &xr = Overture::nullRealArray(),
66 
67  void inverseMapS( const RealArray & x, RealArray & r, RealArray & rx = Overture::nullRealArray(),
69 
70  void basicInverseS(const RealArray & x,
71  RealArray & r,
74 
75  // Use default Mapping inverse instead of optimized inverse defined by this mapping
76  int useDefaultMappingInverse(bool trueOrFalse = TRUE );
77 
78  virtual real sizeOf(FILE *file = NULL ) const;
79 
80  virtual int update( MappingInformation & mapInfo ) ;
81 
82 
83  private:
84  aString className;
85  Range Rr,Ry,Rx;
86 
87  protected:
88 
89 // ApproximateGlobalInverse *approximateGlobalInverse;
90 // ExactLocalInverse *exactLocalInverse;
91 // MappingWorkSpace workSpace; // work space for inverse
93 
94  private:
95 
96  void setup( Mapping & mapa, Mapping & mapb );
97 
98  //
99  // Virtual member functions used only through class ReferenceCounting:
100  //
102  { return operator=((ComposeMapping &)x); }
103  virtual void reference( const ReferenceCounting& x)
104  { reference((ComposeMapping &)x); } // *** Conversion to this class for the virtual = ****
105  virtual ReferenceCounting* virtualConstructor( const CopyType ct = DEEP ) const
106  { return ::new ComposeMapping(*this, ct); }
107  };
108 
109 
110 #endif // COMPOSE_MAPPING_H
111