org.knowceans.topics.cgen
Class Auxiliaries

java.lang.Object
  extended by org.knowceans.topics.cgen.Auxiliaries

public class Auxiliaries
extends java.lang.Object

static auxiliary functions

Author:
gregor

Field Summary
static java.lang.String nthreads
           
static java.lang.String parfor
           
static java.lang.String thread
           
 
Constructor Summary
Auxiliaries()
           
 
Method Summary
static java.lang.String beginFor(java.lang.String index, java.lang.String range, java.lang.String comment)
          start a for loop
static java.lang.String beginForDeclared(java.lang.String index, java.lang.String range, java.lang.String comment)
          start a for loop
static java.lang.String beginParallelForDef(java.lang.String item, java.lang.String range, java.lang.String comment)
          start a parallel for loop
static java.lang.String cleanupParallelFor()
          shutdown and cleanup of parallel for structure
static java.lang.String endFor(java.lang.String index)
          end a for loop
static java.lang.String endParallelForDef(java.lang.String item)
          end of parallel for definition for item
static java.lang.String endRunParallelForDef(java.lang.String item, java.lang.String range)
          end definition of parallel for, run it and clean up afterwards
static java.lang.String ff(java.lang.String format, java.lang.Object... values)
          shorthand for printf with guaranteed newline
static java.lang.String ffunique(java.lang.String format, java.util.Set<java.lang.String> uniqueVars, int which, java.lang.String... variable)
           
static java.lang.String ffunique(java.lang.String format, java.lang.String variable)
          control uniqueness of variable: If already in MixNetKernelGenerator.uniqueVars, ignore statement
static java.lang.String ffunique(java.lang.String format, java.lang.String variable, java.util.Set<java.lang.String> uniqueVars)
          control uniqueness of variable: If already in uniqueVars, ignore statement
static java.lang.String ffunique2(java.lang.String format, java.lang.String string, java.lang.String variable)
           
static java.lang.String ffunique2(java.lang.String format, java.lang.String string, java.lang.String variable, java.util.Set<java.lang.String> uniqueVars)
           
static java.lang.String fl(java.lang.String format, java.lang.Object... values)
          shorthand for printf without newline
static boolean isSet(int data, int mask)
          checks whether any bit is set
static boolean isSetAll(int data, int mask)
          checks whether all bits are set
static java.lang.String runParallelFor(java.lang.String range)
          execution of parallel for
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parfor

public static java.lang.String parfor

nthreads

public static java.lang.String nthreads

thread

public static java.lang.String thread
Constructor Detail

Auxiliaries

public Auxiliaries()
Method Detail

ff

public static java.lang.String ff(java.lang.String format,
                                  java.lang.Object... values)
shorthand for printf with guaranteed newline

Parameters:
format -
values -
Returns:

fl

public static java.lang.String fl(java.lang.String format,
                                  java.lang.Object... values)
shorthand for printf without newline

Parameters:
format -
values -
Returns:

ffunique

public static java.lang.String ffunique(java.lang.String format,
                                        java.lang.String variable)
control uniqueness of variable: If already in MixNetKernelGenerator.uniqueVars, ignore statement

Parameters:
format -
variable -
Returns:

ffunique

public static java.lang.String ffunique(java.lang.String format,
                                        java.lang.String variable,
                                        java.util.Set<java.lang.String> uniqueVars)
control uniqueness of variable: If already in uniqueVars, ignore statement

Parameters:
format -
variable -
Returns:

ffunique

public static java.lang.String ffunique(java.lang.String format,
                                        java.util.Set<java.lang.String> uniqueVars,
                                        int which,
                                        java.lang.String... variable)

ffunique2

public static java.lang.String ffunique2(java.lang.String format,
                                         java.lang.String string,
                                         java.lang.String variable)

ffunique2

public static java.lang.String ffunique2(java.lang.String format,
                                         java.lang.String string,
                                         java.lang.String variable,
                                         java.util.Set<java.lang.String> uniqueVars)

beginFor

public static java.lang.String beginFor(java.lang.String index,
                                        java.lang.String range,
                                        java.lang.String comment)
start a for loop

Parameters:
index -
range -
comment -
Returns:

beginForDeclared

public static java.lang.String beginForDeclared(java.lang.String index,
                                                java.lang.String range,
                                                java.lang.String comment)
start a for loop

Parameters:
index -
range -
comment -
Returns:

beginParallelForDef

public static java.lang.String beginParallelForDef(java.lang.String item,
                                                   java.lang.String range,
                                                   java.lang.String comment)
start a parallel for loop

Parameters:
item - running index (m)
comment -
Returns:

endParallelForDef

public static java.lang.String endParallelForDef(java.lang.String item)
end of parallel for definition for item

Parameters:
item -
Returns:

runParallelFor

public static java.lang.String runParallelFor(java.lang.String range)
execution of parallel for

Parameters:
parfor -
range -
Returns:

cleanupParallelFor

public static java.lang.String cleanupParallelFor()
shutdown and cleanup of parallel for structure

Parameters:
parfor -
Returns:

endRunParallelForDef

public static java.lang.String endRunParallelForDef(java.lang.String item,
                                                    java.lang.String range)
end definition of parallel for, run it and clean up afterwards

Parameters:
parfor -
item -
range -
Returns:

endFor

public static java.lang.String endFor(java.lang.String index)
end a for loop

Parameters:
index -
Returns:

isSetAll

public static boolean isSetAll(int data,
                               int mask)
checks whether all bits are set

Parameters:
data -
mask -
Returns:

isSet

public static boolean isSet(int data,
                            int mask)
checks whether any bit is set

Parameters:
data -
mask -
Returns: