Adept Scientific - English
The world's best software for research, science and engineering.
flag arrow
clearclear
 

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKusdedksvnofi
Home
Products
Training
Consultancy
 Buy Online
Downloads
Education
Support
My Adept
International |  About Us |  Contact Us |  Press Room |  Jobs


The Next Steps

• Ask us a question
• Maple Product Tour
• Buy Maple Now
• View Maple Pricing
• Find out about Online Training
• Download a Brochure
• Request a Brochure
• Download a Demo
• Request a Demo
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 11 Professional
Maple 11 Academic
Maple 11 Student Use
Recorded Online Seminars
FREE Training Resources


MapleNet
Maple T.A.
MapleConnect
BlockImporter for Simulink
BlockBuilder for Simulink
Maple Toolboxes
Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

View Maple 10 in Action
Product Comparison Chart

Latest Information

New Features: Professional
New Features: Academic
The Maple Reporter
The Maple Reporter Online
Numerical Algorithms Group
(NAG)


Service & Support

Maple 10 Training Videos
MaplePrimes, blogs, forums
Elite Maintenance Program
Application Centre
Powertools
Maple User Group (MUG)
Join the Maple User Group
(MUG)

Search the Knowledge Base
Technical Support request

List Archives >  Maple User Group List Archive >  Archive by date >  This Month By Date >  This Month By Topic

[MUG] RE: DLL

Search email archive for  

[MUG] RE: DLL
Author: Alec Mihailovs    Posted: Tue, 21 May 2002 03:35:36 -0400

>> From: Alec Mihailovs "amihailo"

That depends on the compiler you use.

If you use Visual Studio 6, then the most simple way is
to open Notepad, copy the program 'void multiply',
and save it, say, in C:\MyProjects\MulMat as MulMat.c.

After that, click on Vcvars32.bat located in
C:\Program Files\Microsoft Visual Studio\VC98\Bin
and change the folder to the location of MulMat.c. For the
example above, type

cd C:\MyProjects\MulMat

After that, enter the command producing the dll:

cl -LD -Gz -Gy -FeMulMat.dll MulMat.c -link /export:multiply

Using Maple 7, the example of using the dll in the extcm6.html
should be changed as follows:

> multiplyMatrixModp := define_external(
> 'multiply',
> a::ARRAY(1..i,1..j,integer[4]),
> b::ARRAY(1..j,1..k,integer[4]),
> c::REF(ARRAY(1..i,1..k,integer[4]),RETURN_ONLY),
> i::integer[4],
> j::integer[4],
> k::integer[4],
> p::integer[4],
> LIB="C:/MyProjects/MulMat/MulMat.dll"):

> p := 17:
> A := Matrix(100,100,(i,j)->i+j mod p,datatype=integer[4]):
> B := Matrix(100,100,(i,j)->i*j mod p,datatype=integer[4]):
> C := Matrix(100,100,datatype=integer[4]):
> multiplyMatrixModp(A,B,C,100,100,100,p);

Note that C is not AB, but BA mod 17. For example,

> E:=Matrix([[1,2],[3,4]],datatype=integer[4]);
[1 2]
E := [ ]
[3 4]

> F:=Matrix([[0,1],[2,3]],datatype=integer[4]);

[0 1]
F := [ ]
[2 3]

> G:=Matrix(2,2,datatype=integer[4]):
> multiplyMatrixModp(E,F,G,2,2,2,p);
> G;

[ 3 4]
[ ]
[11 16]
Best wishes,
Alec Mihailovs
http://webpages.shepherd.edu/amihailo/


-----Original Message-----
>> From: "bguerrieri"

I am hiding behind a fence as I ask this question about calling C
procedures from Maple:
On the Maple site
http://www.mapleapps.com/categories/software/c_code/html/extcm6.html
one has kindly posted part of the answer pertaining to the
multiplication of two matrices.

[View Complete Thread]



Previous by date: [MUG] bug in sum?, Max_joern
Next by date: [MUG] Maple Course, Michael Monagan
Previous thread: [MUG] evaluating _F1 /_F2 in pdsolve o/p,  Nagaraj Mahavir
Next thread: [MUG] Maple Course, Michael Monagan



Ready to buy?

Maple - single user licence
Add to shopping basket
$ 1,895.00
Upgrade to Maple 12 from v11
Add to shopping basket
$ 995.00
Upgrade to Maple 12 from v10 & below
Add to shopping basket
$ 1,395.00

Featured Downloads

What's New in Maple 11 for Professionals
Maple White Paper: Technical Knowledge - An Asset You Can Afford to Lose?
Maple in Electronics Application Pack
Maple in Robotics & Aerospace Application Pack
Maple in Finance Application Pack

Product Reviews

"Without the Maple software, we would have to spend weeks generating the equations of motion for every experiment. Then the chances that we did it right would basically be near zero. There would always be a mistake somewhere. It is very difficult to set up a dynamic motion model by hand."
- Jean-Claude PiedBeouf, Ph.D Manager of Robotics, Canadian Space Agency

"Its very good - highly accurate and easy to use. The speed of Maple allows me to change equations and quickly reintegrate them into the application, so more possibilities can be explored to achieve the precise effect desired."
Shawn Neely, Senior R & D Director for PDI/Dreamworks
adept

Top of the Page

Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2007, Adept Scientific plc.
Site designed and maintained by Adeptise

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055