NASA - Jet Propulsion Laboratory
    + View the NASA Portal
Search JPL
Jet Propulsion Laboratory Home Earth Solar System Stars & Galaxies Technology
Introduction Background Software Links


healpix.core.base
Class BitManipulation

java.lang.Object
  extended by healpix.core.base.BitManipulation

public class BitManipulation
extends Object

This module provides functions that permute bits of the binary representation of a number. Java bit manipulation class derived from Healpix fortran90 program.

Version:
$Id: BitManipulation.java,v 1.1.2.4 2010/02/22 14:55:50 healpix Exp $
Author:
Benjamin D. Wandelt October 1997, edited by E. Hivon, October 2001 to be 'F' compatible

Field Summary
static long magic1
          The magic1.
static long magic2
          The magic2.
 
Constructor Summary
BitManipulation()
          default constructor
 
Method Summary
 long invLSB(long i)
          returns i with even bits (0,2,4,...) inverted
 long invMSB(long i)
          returns i with odd bits (1,3,5,...) inverted
 long invswapLSBMSB(long i)
          returns NOT i with even and odd bit positions interchanged
 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
The magic1.


magic2

public static long magic2
The magic2.

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 (0,2,4,...) inverted

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

invMSB

public long invMSB(long i)
returns i with odd bits (1,3,5,...) 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

"Built from revision exported"

Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:
Webmaster:

CL 03-2650