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

Search found 5 matches
Forum Index
Author Message
  Topic: Bit operations
tgasiba

Replies: 6
Views: 21220

PostForum: MathExtra   Posted: Tue Nov 29, 2005 3:24 am   Subject: Fast Walsh-Hadamard Transform
By the way, I forgot to mention in my previous message that yesterday night I have finished coding a Fast Walsh-Hadamard Transform. It might also be nice to include into the standard library.
Another ...
  Topic: Bit operations
tgasiba

Replies: 6
Views: 21220

PostForum: MathExtra   Posted: Tue Nov 29, 2005 3:15 am   Subject: nextlowerpowerof2
can be done with:

// returns 2^b such that 2^b <= x < 2^b+1, where b is an integer
// Relies on twos-complement arithmetic.
int nextlowerpowerof2(int x) { return x & -x; }

if (data. ...
  Topic: Bit operations
tgasiba

Replies: 6
Views: 21220

PostForum: MathExtra   Posted: Mon Nov 28, 2005 11:11 am   Subject: Re: Bit operations
Ok. Here goes a new function.

uint bitReverse( uint x ){
asm {
mov EDX, EAX;
shr EAX, 1;
and EDX, 0x5555_5555;
and EAX, 0x5555_5555;
shl EDX, 1;
or EAX ...
  Topic: Bit operations
tgasiba

Replies: 6
Views: 21220

PostForum: MathExtra   Posted: Mon Nov 28, 2005 11:10 am   Subject: Re: Bit operations
Ok. Here goes a new function.

uint bitReverse( uint x ){
asm {
mov EDX, EAX;
shr EAX, 1;
and EDX, 0x5555_5555;
and EAX, 0x5555_5555;
shl EDX, 1;
or EAX ...
  Topic: Any suggestions on what file structure should be used?
tgasiba

Replies: 1
Views: 12775

PostForum: MathExtra   Posted: Fri Nov 25, 2005 11:05 am   Subject: Re: Any suggestions on what file structure should be used?
For me, option 1 seems the most reasonable way to go!
A simple "import std.math;" would import the already standard (as in C) math functions, and "import std.math.statistic", etc... for more special ...
 
Page 1 of 1
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group