473,511 Members | 14,052 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C binding to transfer matrices from C to Python and from Python toC

Hi all,

Has someone written a C binding to transfer matrices from C to Python
and vice versa ?

Any pointer would be appreciated.

Nils

Jul 18 '05 #1
1 1577
Nils Wagner <nw*****@mecha.uni-stuttgart.de> writes:
Hi all,

Has someone written a C binding to transfer matrices from C to Python
and vice versa ?


Is your question more along the lines of "I have an algorithm written
in C that operates on matrices; how do I call it from Python?"

I presume you want Numeric or numarray matrices.

From easy to hard (and less to more powerful :-):

- f2py will wrap C code. However, last I checked, the documentation
isn't the clearest on how to do this.
- weave in scipy (and I know you use scipy ;-). This allows you to
write C code inline; I think you can link with an external routine.
- pyrex is a Python-like language for writing extensions. To access
arrays, you'll have to include some definitions of the appropiate
array types from the Numeric or numarray headers.
- use SWIG to generate wrappers. You'll have to do a bit of work with
typemaps for passing arrays around.
- writing a C extension by hand. See the Python docs about writing
extensions, and the Numeric and numarray docs about the C API.

--
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3191
by: gajaya1 | last post by:
I only find information connecting Oracle external tables to data files. But I dont want to transfer data to files instead I want directly transfer data to oracle from Access. I do not know how to...
2
3610
by: Andrew Robinson | last post by:
Is there any way to accomplish two way data binding in a Details View with a DataSet or DataTable as the DataSource. All I want is to get an updated DataSet or DataTable back from the...
2
1295
by: Tubs | last post by:
I am trying to use data binding to avoid having to write event handlers everywhere for my data transfer from controls to data source and all is working well except, i have a condition i would like...
1
2613
by: Bruce | last post by:
Hi, there, I meet a problem about comboBox binding. -------------------- Database: Northwind Tables: 1) Products 2) Categories I create a form (named "form1") to edit the record from...
6
1882
by: Tim Roberts | last post by:
I've been doing COM a long time, but I've just come across a behavior with late binding that surprises me. VB and VBS are not my normal milieux, so I'm hoping someone can point me to a document...
9
2115
by: tomamil | last post by:
imagine that you have different matrices with different names and you want to perform the same action with each of them. is it possible to put their names into some array and to create a loop that...
3
1429
by: mosi | last post by:
Python matrices are usually defined with numpy scipy array or similar. e.g. I would like to have easier way of defining matrices, for example: Any ideas how could this be done? The ";" sign...
6
4577
by: Tomasz J | last post by:
Hello developers, I bind my TextBox control specyfying a format stored in my application global ApplicationContext object - it has a static string CurrencyFormat property. The problem - this...
10
3461
by: Hongtian | last post by:
Hi friends, I am a newer of Python. I want to ask below question: I have a C/C++ application and I want to use Python as its extension. To do that, I have to transfer some data structure from...
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.