Interfaces

From LIBISIS
Revision as of 14:10, 3 April 2008 by Dean Whittaker (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

These are general interfaces for similar operations which can be performed on a variety of classes. For example the 'plus' routine can be performed on: IXTdatum, IXTdatum_array, IXTdataset_1d and IXTdataset_2d.


The appropriate subroutine will be called depending on the class of the argument which is passed to it.


UnaryOperationsInterface

e UnaryOperations can also be called through an interface. The subroutine which is called is determined by the class of the arguments.

The general calling syntax of the subroutine is (see below for further details): call IXFoperation(result, object, status)


Operations

  • log - takes the natural logarithm of an object
  • exp - takes the exponential of an object
  • sin - takes the sine of an object
  • cos - takes the cosine of an object
  • tan - takes the tangent of an object
  • sinh - takes the hyperbolic sine of an object
  • cosh - takes the hyperbolic cosine of an object
  • tanh - takes the hyperbolic tangent of an object


Valid Classes

Classes for which operations are vaild and overloaded:



F90 syntax

use IXMclass
type(IXTclass)::object,result

type(IXTstatus)::status

call IXFoperation(result,object,status)


For example with operation=sinh class=dataset_1d


use IXMdataset_1d

type(IXTdataset_1d):: w1, wres
type(IXTstatus)::status

call IXFsinh(wres,w1,status)


BinaryOperationsInterface

The BinaryOperations can also be called through an interface. The subroutine which is called is determined by the class of the arguments.

The general calling syntax of the subroutine is (see below for further details):


call IXFoperation(result, object1, object2,status)


Operations

  • plus - adds two objects together
  • minus - subtracts one object from the other
  • times - multiplies one object by the other
  • divide - divides one object by the other
  • power - raises one object to the power of the other


Valid Classes

Classes for which operations are valid and overloaded:


F90 syntax

use IXMclass

type(IXTclass)::object1,object2,result

 real(dp)::scalar=5.0d0

 type(IXTstatus)::status

call IXFoperation(result,object1,object2,status)

 call IXFoperation(result,object1,scalar,status)

 call IXFoperation(result,scalar,object1,status)


For example with operation=plus class=dataset_2d


use IXMdataset_2d

type(IXTdataset_2d):: w1, w2, wres

 real(dp)::scalar=5.0d0

 type(IXTstatus)::status

call IXFplus(wres,w1,w2,status)

 call IXFplus(wres,w1,scalar,status)

 call IXFplus(wres,3.0d0,w1,status)

CreateInterface

The CreateOperation can also be called through an interface. The subroutine which is called is determined by the class of the arguments.


The general calling syntax of the subroutine is (see below for further details):


call IXFcreate(object,element_1,element_2,...,element_N, status)


Valid Classes

Classes for which operations are overloaded:

dataset_structures

instrument related structures IXTshape IXTtranslation IXTmoderator IXTattenuator IXTfermi_chopper IXTaperture IXTsource F90 syntax use IXMclass

type(IXTclass)::object


type(IXTstatus)::status

call IXFcreate(object,element_1,element_2,...,element_N,status)


CheckInterface

DestroyInterface

CopyInterface