Class BitManipulation


  • public final class BitManipulation
    extends java.lang.Object
    bit manipulation class derived from Healpix fortran90 program.
    Author:
    N Kuropatkin
    • Constructor Summary

      Constructors 
      Constructor Description
      BitManipulation()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long invLSB​(long i)
      returns i with even bits inverted
      static long invMSB​(long i)
      returns i with odd bits inverted
      static 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
      static double MODULO​(double a, double b)
      simulates behaviour of fortran90 MODULO function
      static long swapLSBMSB​(long i)
      swaps low and high bits in the word i
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BitManipulation

        public BitManipulation()
    • Method Detail

      • swapLSBMSB

        public static 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 static 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 static long invLSB​(long i)
        returns i with even bits inverted
        Parameters:
        i - int input word
        Returns:
        int word with modified bits
      • invMSB

        public static long invMSB​(long i)
        returns i with odd bits inverted
        Parameters:
        i - int input word
        Returns:
        int word with modified bits
      • MODULO

        public static 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 -