From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c1bdceb867926fdb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!open-news-network.org!uucp.gnuu.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Interfacing Ada with C Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <8my12mw8eviw$.q38bp6e79qfh.dlg@40tude.net> Date: Sat, 24 Jul 2010 21:16:42 +0200 Message-ID: <199ycy4yn8uye$.nwgt8f31f4xv.dlg@40tude.net> NNTP-Posting-Date: 24 Jul 2010 21:16:44 CEST NNTP-Posting-Host: 4a16b8ca.newsspool1.arcor-online.net X-Trace: DXC=UL7iRP9cjN6^cW`WBF>WQ4Fo<]lROoR1<`=YMgDjhg2^0\f^MK@8?9[6LHn;2LCV>[0l7``>R?D1E\VYWK2 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:12534 Date: 2010-07-24T21:16:44+02:00 List-Id: On Sat, 24 Jul 2010 11:04:18 -0700 (PDT), Ada novice wrote: > On Jul 24, 6:44�pm, "Dmitry A. Kazakov" > wrote: > >> Since C does not have arrays, especially 2D ones, you will have some custom >> representation on the C side. It means that examples of bindings (there are >> plenty of) won't help you unless you understand how you describe a >> C-compatible object in Ada. > > Thanks for the "warnings". One way that I'm thinking is to write the > elements of the matrix sequentially into a file in Ada, read them into > C, put them into a matrix in C, do the appropriate computations in C > (with the IMSL C library), write the output in C in a file, and > finally importing them back into Ada again for further processing. Of > course, having several read-write operations is not computationally > time-efficient but this is a modest way to get starting. I know C at a > basic level and I'm not not an extensive user. Why not to call IMSL directly from Ada? I looked shortly here http://www.vni.com/products/imsl/c/TechSpecs/CNLspecs3MatrixStorage.php it looks well documented and fairly designed. There should be no problem to call it from Ada. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de