Author |
Message |
Topic: Bit operations |
tgasiba
Replies: 6
Views: 33413
|
Forum: 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: 33413
|
Forum: 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: 33413
|
Forum: 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: 33413
|
Forum: 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: 14455
|
Forum: 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 ... |
|