
NAO Interface Class NAPointOnManifold
The NAPointOnManifold class is a Base class for vectors. As the name implies,
these are points on a Manifold, so in addition to
a number of coordinates, there is a chart associated with each POM
(as they are known to their friends). If you only work with
Regions, or Mapped
Regions, there is only one chart, and POM's are Euclidean vectors.
A PointOnManifold has a dimension, which is the
number of coordinates, or the Base space dimension of the Manifold it
lives on, and a list of coordinates.
NAO does not associate a POM with one Manifold, the same POM could live
on any Manifold with the same Base Space Dimension, and enough charts.
To use this class, include the header file
NAO/NAPtMfld.h
and link against library
libNAOBase.a
The following member functions are available when classes are derived from this
interface class, in addition to those provided by the parent class
NATopLevel.
Pure Virtual Member Functions, which must be provided by derived classes:
-
-
-
-
| NANumber getCoordinate(i
) const; |
| Get the value of a coordinate
|
| const int | i
; | The index of the coordinate to return. (Specified by user).
|
|
-
| double getDoubleCoordinate(i
) const; |
| Get the value of a coordinate as a double
|
| const int | i
; | The index of the coordinate to return. (Specified by user).
|
|
-
| void setCoordinate(i
,v
); |
| Set the value of a coordinate
|
| const int | i
; | The index of the coordinate to set. (Specified by user).
|
| const NANumber | v
; | The value to give the coordinate. (Specified by user).
|
|
-
| NAPointOnManifold* firstNCoordinates(n
) const; |
| Create a NAPointOnManifold by copying the leading coordinates of this.
|
| const int | n
; | The number of coordinates to copy. (Specified by user).
|
|
-
| NAPointOnManifold* lastNCoordinates(n
) const; |
| Create a NAPointOnManifold by copying the trailing coordinates of this.
|
| const int | n
; | The number of coordinates to copy. (Specified by user).
|
|
Virtual Member Functions, which may or may not be provided by derived classes:
-
| NABoolean canBeCastTo(type
) const; |
| returns TRUE if this NAPointOnManifold can be cast to the type given.
|
| const char* | type
; | The string corresponding to the class. (Specified by user).
|
|
non Virtual Member Functions, which are provided by this base class and may not be replaced by a derived class:
-
| int getChartNumber() const; |
| Returns the chart to which this PointOnManifold refers.
|
-
| void setChartNumber(chart
); |
| Changes the chart to which this PointOnManifold refers.
|
| const int | chart
; | New chart number. (Specified by user).
|
|
The following classes are children of this base class:
The base class stores the chart number (an int), and provides an implementation
of the get and setChartNumber Member Functions.
To print the PointOnManifold, we might do this:
#include <NAO/NAPtMfld.h>
int i,n;
NAPointOnManifold *x;
n=x->getNumberOfCoordinates();
for(i=0;i<n;i++)
{
cout << "Coordinate " << i << " is " << x->getDoubleCoordinate(i) << endl;
}
cout << "The chart is " << x->getChartNumber() << endl;
Now, the coordinates could be complex, single or double precision, float or int.
NAO allows for these coordinates of unknown type with the
NANumber class. Very inefficient of course, but if you wanted to do the
same piece of code and correctly print the coordinates, you would do this:
#include <NAO/NAPtMfld.h>
#include <NAO/UTNumb.h>
int i,n;
NAPointOnManifold *x;
n=x->getNumberOfCoordinates();
for(i=0;i<n;i++)
{
cout << "Coordinate " << i << " is ";
NAPrint(x->getCoordinate(i),cout);
cout << endl;
}
cout << "The chart is " << x->getChartNumber() << endl;
For efficiency, the implementations of NAPointOnManifold all have
a member function which returns a list of the coordinates.
The parent of this Interface class:
Siblings of this Interface class:
Children of this Interface class:
In addition to creating NAPointOnManifold's, and passing them to
various member functions, there are a couple of operations between
NAPointOnManifolds that are provided. If x, y and z
are POM's, n an integer, and s a double, these
operations are:
- -x
- x+y
- x-y
- x*y
- x/y
- x^n
- x^s
- x+s
- x-s
- s*x
- x/s
- s-x
- s/x
Created: Fri Oct 9 13:11:52 EDT 1998
[Comments |
NAO home page ]
[Research home page]
[ IBM home page |
Order |
Privacy |
ContactIBM |
Legal ]