FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

compile time sizes

 
Post new topic   Reply to topic     Forum Index -> MultiArray
View previous topic :: View next topic  
Author Message
fawzi



Joined: 19 Feb 2008
Posts: 9
Location: Berlin, Germany

PostPosted: Sat Apr 19, 2008 4:17 am    Post subject: compile time sizes Reply with quote

By the way I saw that Bill Baxter commented in the NG about OpenMesh and fixed size Matrixes.

Fixed (compile time) size matrixes can be better for small matrix sizes, as Bill is author in both libraries (OpenMesh and Multiarray) maybe some comment on dynamic vs compile time matrix sizes would be interesting...
Back to top
View user's profile Send private message
baxissimo



Joined: 23 Oct 2006
Posts: 241
Location: Tokyo, Japan

PostPosted: Sat Apr 19, 2008 6:01 am    Post subject: Reply with quote

What kind of comment do you mean?
Back to top
View user's profile Send private message
fawzi



Joined: 19 Feb 2008
Posts: 9
Location: Berlin, Germany

PostPosted: Sat Apr 19, 2008 1:09 pm    Post subject: Reply with quote

simply how developed is the static size matrixes in OpenMesh?
If one just needs matrixes and vectors is it better to use multiarray or OpenMesh?

Do you think that it would make sense to have a static template in multiarry, like in D there are both static and dynamic arrays, maybe to then have special matrix*vector instead of blas for small sizes?
Maybe in the future, or the gain are probably too small?

well that's more or less it, thanks!
Fawzi
Back to top
View user's profile Send private message
baxissimo



Joined: 23 Oct 2006
Posts: 241
Location: Tokyo, Japan

PostPosted: Sat Apr 19, 2008 11:44 pm    Post subject: Reply with quote

Ok. I see what you mean.

The compile-time fixed-size matrices and vectors in OpenMesh work fine. I haven't spent a lot of time optimizing them or anything. There's no fancy Don Clugston-style auto-generation of optimal ASM going on. But they work fine. I think the only thing I would like to add is a general matrix inversion routine. Inversion is implemented for 2x2, 3x3, and 4x4, but any higher than that and I think it should just use gaussian elimination or something like that. But that isn't implemented right now.

All the multiarray classes have dynamic size, and so they alloc their memory on the heap. The nice thing about fixed-size is that the data can be allocated on the stack. But it only really makes sense for small sizes.

I guess it would make sense to have some version of OpenMesh's VectorT and MatrixT in Multiarray for completeness, but I just don't have a need for it at the moment, since I'm using OpenMeshD in my work anyway.

The other thing that would probably be useful is a fixed-dimension n-dimensional array. murray's ndarray is dynamic everything including number of dimensions (a.k.a. tensor rank) . I realized kind of too late that making it dynamic everything maybe isn't the best choice for a language like D. But I was really into NumPy at the time and I figured something that matched NumPy as closely as possible would at least make porting code back and forth easier, or maybe interop via PyD possible. But not knowing how many axes you have at compile time means that you can't have a[0] return an ndarray but a[0,0] return a scalar.

Anyway, I realized eventually that I really don't *need* an nd-array. I had been sold on the idea by NumPy, but actually all I do is linear algebra stuff, so I really don't need general nd-arrays. What I need more is good support for different storage formats like banded and sparse, etc. So that's what DFLAT is for.

Incidentally, I haven't done much with NumPy recently since doing numerics with D is much more fun in my opinion. Smile
Back to top
View user's profile Send private message
fawzi



Joined: 19 Feb 2008
Posts: 9
Location: Berlin, Germany

PostPosted: Mon Apr 21, 2008 3:47 am    Post subject: Reply with quote

Thanks a lot for the reply, it makes the scope of the library more clear.

I also think that numerics in D is nicer than C++/fortran or numpy, that's the reason I am moving to it Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MultiArray All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group