I need a help with arrays. I alredy tried pass memory address of the
first element, introduce the address number (by address())
So some of then are 2d arrays, and the most part of functions are like
this:
SUBROUTINE DGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)
* .. Scalar Arguments ..
DOUBLE PRECISION ALPHA,BETA
INTEGER INCX,INCY,LDA,M,N
CHARACTER TRANS
* ..
* .. Array Arguments ..
DOUBLE PRECISION A(LDA,*),X(*),Y(*)
the code was compiled from fortran using g77 to blas.dll, read by
libmaker... I should say, then some functions then use only value
parameters or not dim variables work well...
can anyone help me?
tks
Conrado, T.
1) all variables must be passed by address even constants (because the
original code was in fortran)
2) pass only the address of first element of a array (low level code,
sequence reading)
3) I don't know wry but the convention is pascal...
and the better thing work perfectly with clarion arrays...
so a exemple alredy tested in clapack
function in fotran:
SUBROUTINE DPOTRF( UPLO, N, A, LDA, INFO )
CHARACTER UPLO
INTEGER INFO, LDA, N
DOUBLE PRECISION A( LDA, * )
prototype in clarion:
MODULE('CLAPACK.LIB')
dpotrf PROCEDURE(*string UPLO, *long N, *Real A, *long
LDA, *long info),Name('_dpotrf_@20'),raw,pascal,DLL !
END
calling in clarion with a exemple data:
ChFactoration PROCEDURE
UPLO string('L')
N long(3)
A Real,dim(3,3)
LDA long(3)
info long(9)
CODE
A[1,1] = 4; A[1,2] = 0; A[1,3] = -4
A[2,1] = 0; A[2,2] = 16; A[2,3] = 4
A[3,1] = -4; A[3,2] = 4; A[3,3] = 16
dpotrf(UPLO,N,A[1,1],LDA,INFO)
message(A[1,1] & ' ' & A[1,2] & ' ' & A[1,3] & '|' &|
A[2,1] & ' ' & A[2,2] & ' ' & A[2,3] & '|' &|
A[3,1] & ' ' & A[3,2] & ' ' & A[3,3] & '|' & info )
regards,
Thiago Conrado