mpicbg.util
Class Util

java.lang.Object
  extended by mpicbg.util.Util

public final class Util
extends Object

Methods collection for general purpose that do not have a common context

Version:
0.1b
Author:
Stephan Saalfeld

Field Summary
static float SQRT2
           
 
Method Summary
static float div(float a, float b)
          An equivalent to div for float
static int ldu(int v)
          (Hopefully) fast floor log2 of an unsigned(!) integer value.
static void max(double[] a, double[] b)
          Writes max(a,b) into a
static void max(float[] a, float[] b)
          Writes max(a,b) into a
static void memset(boolean[] array, boolean value)
          For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm
static void memset(byte[] array, byte value)
          For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm
static void memset(char[] array, char value)
          For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm
static void memset(double[] array, double value)
          For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm
static void memset(float[] array, float value)
          For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm
static void memset(int[] array, int value)
          For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm
static void memset(long[] array, long value)
          For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm
static void memset(short[] array, short value)
          For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm
static void min(double[] a, double[] b)
          Writes min(a,b) into a
static void min(float[] a, float[] b)
          Writes min(a,b) into a
static float mod(float a, float mod)
          An equivalent to % for float
static int pingPong(int a, int mod)
          Return an unsigned integer that bounces in a ping pong manner in the range [0 ...
static double pow(double a, int b)
          Double/Integer version of Math.pow(double, double).
static float pow(float a, int b)
          Float/Integer version of Math.pow(double, double).
static long pow(int a, int b)
          Integer version of Math.pow(double, double).
static int round(double a)
          Round a
static int round(float a)
          Round a
static int roundPos(double a)
          Round a positive a
static int roundPos(float a)
          Round a positive a
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SQRT2

public static final float SQRT2
Method Detail

ldu

public static final int ldu(int v)
(Hopefully) fast floor log2 of an unsigned(!) integer value.

Parameters:
v - unsigned integer
Returns:
floor log2

pingPong

public static final int pingPong(int a,
                                 int mod)
Return an unsigned integer that bounces in a ping pong manner in the range [0 ... mod - 1]

Parameters:
a - the value to be flipped
range - the size of the range
Returns:
a flipped in range like a ping pong ball

pow

public static final long pow(int a,
                             int b)
Integer version of Math.pow(double, double).

Parameters:
a -
b -
Returns:

pow

public static final float pow(float a,
                              int b)
Float/Integer version of Math.pow(double, double).

Parameters:
a -
b -
Returns:

pow

public static final double pow(double a,
                               int b)
Double/Integer version of Math.pow(double, double).

Parameters:
a -
b -
Returns:

min

public static final void min(float[] a,
                             float[] b)
Writes min(a,b) into a

Parameters:
a -
b -

max

public static final void max(float[] a,
                             float[] b)
Writes max(a,b) into a

Parameters:
a -
b -

min

public static final void min(double[] a,
                             double[] b)
Writes min(a,b) into a

Parameters:
a -
b -

max

public static final void max(double[] a,
                             double[] b)
Writes max(a,b) into a

Parameters:
a -
b -

round

public static final int round(float a)
Round a

Parameters:
a -

round

public static final int round(double a)
Round a

Parameters:
a -

roundPos

public static final int roundPos(float a)
Round a positive a

Parameters:
a -

roundPos

public static final int roundPos(double a)
Round a positive a

Parameters:
a -

div

public static final float div(float a,
                              float b)
An equivalent to div for float

Parameters:
a -
b -
Returns:
a div b

mod

public static final float mod(float a,
                              float mod)
An equivalent to % for float

Parameters:
a -
mod -
Returns:
0 <= b < mod

memset

public static final void memset(byte[] array,
                                byte value)
For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm

Parameters:
array -
value -

memset

public static final void memset(short[] array,
                                short value)
For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm

Parameters:
array -
value -

memset

public static final void memset(int[] array,
                                int value)
For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm

Parameters:
array -
value -

memset

public static final void memset(long[] array,
                                long value)
For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm

Parameters:
array -
value -

memset

public static final void memset(float[] array,
                                float value)
For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm

Parameters:
array -
value -

memset

public static final void memset(double[] array,
                                double value)
For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm

Parameters:
array -
value -

memset

public static final void memset(boolean[] array,
                                boolean value)
For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm

Parameters:
array -
value -

memset

public static final void memset(char[] array,
                                char value)
For Java, the fastest way doing memset(x) Found at http://burks.brighton.ac.uk/burks/language/java/jprogfaq/faq_b.htm

Parameters:
array -
value -


Copyright © 2007-2016 Fiji. All Rights Reserved.