cds.tools.pixtools
Class BitManipulation

java.lang.Object
  extended by cds.tools.pixtools.BitManipulation

public class BitManipulation
extends java.lang.Object

bit manipulation class derived from Healpix fortran90 program.

Author:
N Kuropatkin

Field Summary
static long magic1
          magic1 odd bits set constant
static long magic2
          magic2 - even bits set constant
 
Constructor Summary
BitManipulation()
          default constructor
 
Method Summary
 long invLSB(long i)
          returns i with even bits inverted
 long invMSB(long i)
          returns i with odd bits inverted
 long invswapLSBMSB(long i)
          returns NOT i with even and odd bit positions interchanged
static void main(java.lang.String[] pars)
          the main program for simple test
 double MODULO(double a, double b)
          simulates behaviour of fortran90 MODULO function
 long swapLSBMSB(long i)
          swaps low and high bits in the word i
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

magic1

public static long magic1
magic1 odd bits set constant


magic2

public static long magic2
magic2 - even bits set constant

Constructor Detail

BitManipulation

public BitManipulation()
default constructor

Method Detail

swapLSBMSB

public long swapLSBMSB(long i)
swaps low and high bits in the word i

Parameters:
i - integer input word
Returns:
int a word with odd and even bits interchanged

invswapLSBMSB

public long invswapLSBMSB(long i)
returns NOT i with even and odd bit positions interchanged

Parameters:
i - int input word
Returns:
int NOT (i with LSBMSB)

invLSB

public long invLSB(long i)
returns i with even bits inverted

Parameters:
i - int input word
Returns:
int word with modified bits

invMSB

public long invMSB(long i)
returns i with odd bits inverted

Parameters:
i - int input word
Returns:
int word with modified bits

MODULO

public double MODULO(double a,
                     double b)
simulates behaviour of fortran90 MODULO function

Parameters:
a - double
b - double
Returns:
double MODULO

main

public static void main(java.lang.String[] pars)
the main program for simple test

Parameters:
pars -


Copyright © 2009 UDS/CNRS