Matlab Bindings

From LIBISIS
Revision as of 12:24, 15 May 2008 by Dickon Champion (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
module IXMm_testclass

#define IXD_TYPE testclass
#include "bindings_header.f90"

contains

#define IXD_TYPE testclass
#include "bindings_base.f90"

end module IXMm_testclass

#define IXD_TYPE testclass
#include "bindings_extra.f90"


  subroutine IXBplus_Testclass(nlhs, plhs, nrhs, prhs, status)
    use IXMm_testclass
	use IXMmatlab_interface
   	implicit none
	integer :: nlhs, nrhs
	integer(cpointer_t) :: plhs(nlhs), prhs(nrhs)
	type (IXTtestclass) :: wres, w1, w2
	type(IXTstatus) :: status
	! read in two structures which will be added together
	! wres has been created empty with type statement
    call IXBgetFromBinding(prhs(2),' ', 1, 0, w1, status)
    call IXBgetFromBinding(prhs(3),' ', 1, 0, w2, status)
	! check read went OK - report errors and return if not
	if (status == IXCseverity_error) return
	! do adding operation
	call IXFplus_testclass(wres, w1, w2, status)
	! wres has now been filled and needs to be entered into the matlab memory
    if (status == IXCseverity_error) then
        plhs(1)=ixDuplicateArray(prhs(1))
    else
        call IXBsendToBinding(plhs(1), prhs(1), ' ', 1, 0, wres, status)
    endif
  end subroutine