Re: please help



On May 18, 2:52 pm, "Dr Ivan D. Reid" <Ivan.R...@xxxxxxxxxxxx> wrote:
On Thu, 17 May 2007 22:36:02 +0200, fake <a...@xxx>
wrote in <f2iebm$nr...@xxxxxxxxxxxxxxx>:

does this program work, i dont know did i call in the right way function
deqn

the task is to solve 20 linear equations with 20 unknowns, and to write the
solution of x2

this is my program:
program matrice
real(8), dimension(20,20)::a
real(8), dimension(20)::b
integer::i,j,ifail
dimension IR(20)
...
call deqn(20,a,20,IR,IFAIL,20,b)
print*,b(2)

This is the library declaration (2004 version of KERNLIB):

SUBROUTINE DEQN(N,A,IDIM,R,IFAIL,K,B)
REAL R(N),T1,T2,T3
DOUBLE PRECISION A(IDIM,N),B(IDIM,K),DET,S,TEMP,

The value of K (parameter 6) should be 1, n'est-ce pas? I've
mentioned in another post that the mismatch in declaration of IR/R should
not be a problem as it's a scratch array, and passed through to other
routines which do declare it integer anyway.

Note that in general I recommend against passing literal constants
to library routines. This helps avoid problems with type
mismatches/conversions.

--
Ivan Reid, School of Engineering & Design, _____________ CMS Collaboration,
Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN
KotPT -- "for stupidity above and beyond the call of duty".

Setting K to 1 seems to solve the OP's problem:

call deqn(20,a,20,ir,ifail,1,b)

A * X is reasonably close to B. (checked in Excel).

Note:

I compiled the test program plus the minimal set of source files
needed (after making necessary changes). The libraries provided on
CERN's web site for Windows use DVF, not a 'GNU' toolset. Google shows
libraries built on Cygwin but not MinGW. Has someone built these for
(MinGW) g77, g95 or gfortran?

-- elliot


.



Relevant Pages

  • Re: Variable declaration: Global vs. Function
    ... Unix libraries and builds have always been a ... and how it differs from construction of function-local ... do any of your global objects depend upon ... Its only the global declaration that is the ...
    (comp.lang.cpp)
  • Re: how to declare global Class library project?
    ... Easist way would be a web service. ... In .NET libraries are loaded into their calling process. ... supporting remoting (i.e a winforms app that has a singleton instance of the ... > referencing this global declaration from each of the 2 ...
    (microsoft.public.dotnet.languages.vb)
  • Re: The Ulimate Editor
    ... the parameters to CALL have always been in the reverse order to a standard C call. ... W32F does not use the count of parameters to manipulate the stack before the call; ... a function as a normal Forth word, without too much declaration fluff; preferably just the name of the library it lives in, as I can do right now in Win32Forth. ... of external libraries ...
    (comp.lang.forth)
  • Re: compiling taucs problem (Re: solving Ax=b with sparse A)
    ... The function declaration in line 6 of spmat.cc ... exception are fortran libraries that you call from C, ... int main{ ... I can't see what I am doing wrong while compiling the example ...
    (sci.math.num-analysis)
  • Re: Pyrex installation on windows XP: step-by-step guide
    ... main Python distribution links with msvcr71.dll (due to Visual C++ ... It is not safe to mix and blend different C runtime libraries. ... MinGW or Visual C++ 6.0. ... *both* DLLs are linked in. ...
    (comp.lang.python)

Loading