473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problems using numarray

Hi, I am new to numarray and I'm going to use it in a nummerical
computation of planet and probe orbits. There for I created a body
class, representing an gravity affected mass (like a planet or a probe).
Now I have different bodys each with it's own position, velocity and
mass that pull each other together by gravity. Based on the previous
position and velocity I'm now calculating the positions and velocity for
the next timeframe and so on... So I get a quite high amout of data
because i have to store (number-of-bodys)*(number-of-timeframe) objects.

Now, how can I use a numaray to store the body objects? I read the docu,
but didn't figure out how to solve my problem. In C++ I just created a
multidimensilnal array like data = new body[objects*timeframes] and I'm
looking for something synonymous with numarray.

- Sonium
Jul 18 '05 #1
2 1191
> Now, how can I use a numaray to store the body objects? I read the docu,
but didn't figure out how to solve my problem. In C++ I just created a
multidimensilnal array like data = new body[objects*timeframes] and I'm
looking for something synonymous with numarray.

import Numeric
print Numeric.zeros((10, 20), Numeric.Float)

--
Regards,

Diez B. Roggisch
Jul 18 '05 #2

Sonium <so****@gmail.com> wrote:
Hi, I am new to numarray and I'm going to use it in a nummerical
computation of planet and probe orbits. There for I created a body
class, representing an gravity affected mass (like a planet or a probe).
Now I have different bodys each with it's own position, velocity and
mass that pull each other together by gravity. Based on the previous
position and velocity I'm now calculating the positions and velocity for the next timeframe and so on... So I get a quite high amout of data
because i have to store (number-of-bodys)*(number-of-timeframe) objects.

Now, how can I use a numaray to store the body objects? I read the docu, but didn't figure out how to solve my problem. In C++ I just created a
multidimensilnal array like data = new body[objects*timeframes] and I'm looking for something synonymous with numarray.


I asked a similar question regarding Numeric a few months ago, with subject
"Numeric array of objects" -- see http://groups.google.com/groups?hl=e...ing.google.com
for the thread. Probably the syntax is the same for Numeric and Numarray,
but I have not checked.

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Jul 18 '05 #3

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

Similar topics

0
by: RJS | last post by:
Hi all, I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32- py2.2). Also wxPythonWIN32-2.3.3.1-Py22 and ActivePython-2.2.1-222. In the sample below, commenting out...
4
by: Marco Bubke | last post by:
Hi I have tried to include numarray in Pyrex but I get allways this error: Traceback (most recent call last): File "gears.py", line 9, in ? import gl File...
4
by: Marco Bubke | last post by:
Hi Ok, I get a reproduceable seqmentation fault. Ok, fist the code: cdef NumArray array_to_double(NumArray array): # maybe here is memoty leak! cdef NumArray flat_array_obj flat_array_obj...
0
by: youngdubliner | last post by:
I'm having a problem ........ I've stripped all my code to help isolate the problem. Its seems to be with importing numarray when python is embedded in C. I have a simple C program it Opens...
3
by: SunX | last post by:
I tried to initialize a float point array by: import numarray xur = numarray.fromfunction(lambda x,y,z:x*y*z, (2, 2, 2)) but I ended up with an integer array even though x, y, and z are all...
2
by: Yun Mao | last post by:
Hi python gurus, I have some questions when I'm using python numeric: 1. When I do v = u, it seems u and v still point to the same memory. e.g. When I do v=0, u will be zero out as well....
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
0
by: andrewfelch | last post by:
Below is the code to/from Boolean arrays and Unsigned integers. On my Pentium 4, functions such as "bitwise_and" are 32 times faster when run on 32-bit integers instead of the...
0
by: robert | last post by:
just a note - some speed comparisons : 0.60627370238398726 0.42836673376223189 0.36965815487747022 0.016557970357098384 0.15692469294117473 0.01951756438393204
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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,...

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.