class SGFVector_d : public HCL_Vector_d

SGFVector implements sampled functions on a uniform rectilinear grid as HCL_Vectors


Inheritance:


Public

Constructors and destructor
SGFVector_d ()
Default constructor
SGFVector_d ( const SGFVector_d & S )
Copy constructor - disabled
SGFVector_d ( char * fname)
Usual constructor for old data
SGFVector_d ( const SGFSpace_d * s, char * fname = NULL)
Usual constructor for new data
~SGFVector_d ()
Destructor
Header and data access methods
int BufLen ()
returns length in words of data buffer
virtual int GetValue (const char *name, int &value) const
returns header word as int
virtual int GetValue (const char *name, double &value) const
returns header word as double
virtual int GetValue (const char *name, char *value, int length = 0) const
returns header word as character array
virtual int GetArrayValue (const char *name, int ind, int &value) const
virtual int GetArrayValue (const char *name, int ind, double &value) const
virtual int GetArrayValue (const char *name, int ind, char *value, int length = 0) const
virtual const AbstractTable& ParametersRef () const
returns const reference to table
virtual AbstractTable* Parameters () const
returns independent copy of table - uses new, so calling unit must manage storage
double* Data ()
Return pointer to data buffer
Write method
virtual ostream& Write ( ostream & str ) const
Prints SGFSpace header table and name of binary data file

Inherited from HCL_Vector_d:

Public

Vector operations (z is the object invoking the method).

virtual void Copy( const HCL_Vector_d & x )
z <-- x
virtual void Neg()
z <-- (-z)
virtual void Mul( const double & a )
z <-- a*z
virtual void Add( const HCL_Vector_d & x )
z <-- z + x
virtual void Mul( const double & a, const HCL_Vector_d & x )
z <-- a*x
virtual void Add( const HCL_Vector_d & x, const HCL_Vector_d & y )
z <-- x + y
virtual void Sub( const HCL_Vector_d & x )
z <-- z - x
virtual void Sub(const HCL_Vector_d & x, const HCL_Vector_d & y )
z <-- x - y
virtual void ScaleAdd(const double & a, const HCL_Vector_d & x )
z <-- a*z + x
virtual void AddScale(const double & a, const HCL_Vector_d & x )
z <-- z + a*x
virtual void AddScale(const double & a, const HCL_Vector_d & x, const HCL_Vector_d & y )
z <-- x + a*y
virtual double Inner( const HCL_Vector_d & x ) const
Inner product of z with x.
virtual double Norm() const
Norm of z.
virtual double Norm2() const
Norm squared of z.
virtual HCL_VectorSpace_d& Space() const
Returns a reference to the space of which z is a member
virtual void Zero()
z <-- 0
virtual void Random()
Returns a "random" vector

Access to components.

virtual int Dim() const
Dim returns dimension of space.
virtual double* Data()
Data returns a pointer to the array of components, which is assumed to exist or to be created for this purpose

Array operations - ``Matlab'' methods.

virtual void Fill( double a )
virtual void Add( double a )
- overload of Add with scalar argument a la Matlab
virtual void Add( const HCL_Vector_d & x, double a )
- overload of Add with scalar argument a la Matlab
virtual void DiagScale( const HCL_Vector_d & x )
- matrix multiply by diag(x)
virtual void DiagScale( const HCL_Vector_d & x, const HCL_Vector_d & y )
virtual void DiagRecipScale( const HCL_Vector_d & x, double tol=0.0)
- matrix division by diag(x)
virtual void DiagRecipScale( const HCL_Vector_d & x, const HCL_Vector_d & y, double tol=0.0)
- matrix division by diag(x)
virtual void DotStar( const HCL_Vector_d & x )
"Matlab" name for DiagScale, first version
virtual void DotStar( const HCL_Vector_d & x, const HCL_Vector_d & y )
"Matlab" name for DiagScale, second version
virtual void DotSlash( const HCL_Vector_d & x, double tol=0.0)
"Matlab" name for DiagRecipScale, first version.
virtual void DotSlash( const HCL_Vector_d & x, const HCL_Vector_d & y, double tol=0.0)
"Matlab" name for DiagRecipScale, second version.
virtual double Max() const
returns largest of components or -FLT_MAX
virtual void Max( const HCL_Vector_d & x )
virtual void Max( const HCL_Vector_d & x, const HCL_Vector_d & y )
virtual double Min() const
returns smallest of components or FLT_MAX
virtual void Min( const HCL_Vector_d & x )
virtual void Min( const HCL_Vector_d & x, const HCL_Vector_d & y )
virtual double Sum() const
returns
virtual void Abs()
virtual void Abs( const HCL_Vector_d & x )
virtual void Sign()
virtual void Sign( double t )
virtual void Sign( const HCL_Vector_d & x )
virtual void Sign( const HCL_Vector_d & x, const HCL_Vector_d & y )
virtual void Sign( const HCL_Vector_d & x, double t )
virtual void Sign( double t, const HCL_Vector_d & y )
virtual void Greater( double t )
Mask function: if > , else 0
virtual void Greater( const HCL_Vector_d & x )
Mask function: if > , else 0
virtual void Greater( const HCL_Vector_d & x, const HCL_Vector_d & y )
Mask function: if > , else 0
virtual void Greater( const HCL_Vector_d & x, double t )
Mask function: if > , else 0
virtual void Greater( double t, const HCL_Vector_d & x )
Mask function: if > , else 0
virtual void Power( double p )
- arbitrary real power
virtual void Power( double p, const HCL_Vector_d & x )
- arbitrary real power
virtual void Sqrt()
- componentwise square root
virtual void Sqrt( const HCL_Vector_d & x )
- componentwise square root
virtual void Exp()
virtual void Exp( const HCL_Vector_d & x )
virtual void Log()
- componentwise natural log
virtual void Log( const HCL_Vector_d & x )
- componentwise natural log

Inherited from HCL_Base:

Public Methods

void IncCount() const
void DecCount() const
int Count() const
virtual ostream& Write(ostream &) const

Documentation

SGFVector implements sampled functions on a uniform rectilinear grid as HCL_Vectors. ``SGF'' stands for Sampled Grid Function. It designates a data structure for arbitrary (< 10) dimensional regularly sampled real single and double precision hypercubical data, plus auxiliary scalar data (integer, single or double precision doubleing point, or string) describing the grid geometry and other information necessary to properly interpret the data. Many natural data types in science and engineering fit this description. Other types of data do not conform to the SGF design, for example because the data sampling is geometrically irregular. Such data and associated processing tasks are beyond the scope of SGF.

From the user point of view, SGF is in fact identical to the Stanford Exploration Project's ``classic'' (pre-1996) disk data storage format, with a few restrictions and extensions noted below.

The SGFSpace_d class implements the vector spaces in which SGFVectors live. Grid and scalar attribute specification is proper to SGFSpace_d, and the user should consult the documentation on that class for details. Every SGFVector knows what space it belongs to (as does every HCL_Vector), and in particular has access to all of the dimensional anpd auxiliary information proper to the space. The SGFVector class provides convenient access functions, described below, which return values of these parameters by keyword (the keywords are described in the SGFSpace_d documentation).

Sample data of an SGFVector may be stored in a (native) binary data file, designated by the in keyword in the SGFSpace parameter table. The storage order is as indicated by the ordering of directions in the SGFSpace: the first direction has the fastest index, followed by the second, etc. For example if the first direction represents time, the second a space coordinate, then the fastest index is time.

If no in= keyword-value pair appears in the parameter table, then no file is associated with the SGFVector, and its data will be lost when the object is deleted.

The Data() method returns a double or double pointer to the data buffer holding the current in-core record.

SGFVector has two constructors, one for ``old'' vectors based on preexisting data files, the other for ``new'' vectors for which no data file need exist. The ``old'' vector constructor reads the data from disk, whereas the ``new'' vector constructor presumes that the data is either nonexistent or out-of-date, so does not populate the data buffer on construction.

Notes:

Constructors and destructor

SGFVector_d()
Default constructor

SGFVector_d( const SGFVector_d & S )
Copy constructor - disabled

SGFVector_d( char * fname)
Usual constructor for old data. String fname must be name of existing SGFSpace header file, with in keyword pointing to binary data file.

SGFVector_d( const SGFSpace_d * s, char * fname = NULL)
Usual constructor for new data. Constructs vector in space given by first arguement. If string fname given, opens data file on that name, and sets flag to write data to this file on object destruction. Otherwise data is lost when object is destroyed.

~SGFVector_d()
Destructor

Header and data access methods

int BufLen()
returns length in words of data buffer

virtual int GetValue(const char *name, int &value) const
returns header word as int

virtual int GetValue(const char *name, double &value) const
returns header word as double

virtual int GetValue(const char *name, char *value, int length = 0) const
returns header word as character array

virtual int GetArrayValue(const char *name, int ind, int &value) const

virtual int GetArrayValue(const char *name, int ind, double &value) const

virtual int GetArrayValue(const char *name, int ind, char *value, int length = 0) const

virtual const AbstractTable& ParametersRef() const
returns const reference to table

virtual AbstractTable* Parameters() const
returns independent copy of table - uses new, so calling unit must manage storage

double* Data()
Return pointer to data buffer

Write method

virtual ostream& Write( ostream & str ) const
Prints SGFSpace header table and name of binary data file


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de