Util Extension’s Free Functions¶
Boolean BytesEqual ( in Data values1, in Data values2, in UInt64 dataSize )
Float32 source, in Size float32count )
SInt32 source, in Size sint32count )
UInt32 source, in Size uint32count )
UInt64 CastDataToUInt64 ( in Data data )
UInt8 source, in Size uint32count )
Data CastUInt64ToData ( in UInt64 uint64 )
Boolean CompareAndUpdateBytes ( in Data toUpdate, in Data newValues, in UInt64 dataSize )
CopyBytes ( in Data target, in Data source, in UInt64 dataSize )
EvalContext EvalContext_GetInstance ()
Get the EvalContext singleton, or construct it if it didn’t already exist.
GetBatchSizeAndCountForParallel ( in Size numIndices, in Size workloadMultiplier, in Size minBatchSize, io Size numBatches, io Size batchSize )
This function can be used to compute a batchsize for a given number of tasks.
/*
** Example: GetBatchSizeAndCountForParallel
*/
require Util;
operator entry() {
Size numTasks = 100;
Size minBatchSize = 4;
Size numBatches, batchSize;
GetBatchSizeAndCountForParallel(numTasks, minBatchSize, 12, numBatches, batchSize);
report('numBatches: '+numBatches);
report('batchSize: '+batchSize);
}
/*
** Output:
numBatches: 8
batchSize: 13
*/
UInt8 Log2RoundUp ( in UInt32 value )
performs a logarithmic round up for the provided value
Data OffsetByteData ( in Data base, in SInt64 byteOffset )
atomicClearBit ( io UInt32 val, in UInt32 bit )
sets a bit to 0 for a given UInt32 value
Boolean atomicGetThenClearFlag ( io UInt16 val, in UInt16 flag )
removes a given UInt16 flag from an UInt16 bit mask
Boolean atomicGetThenClearFlag ( io UInt32 val, in UInt32 flag )
removes a given UInt32 flag from an UInt32 bit mask
Boolean atomicGetThenClearFlag ( io UInt8 val, in UInt8 flag )
removes a given UInt8 flag from an UInt8 bit mask
Boolean atomicGetThenSetFlag ( io UInt16 val, in UInt16 flag )
sets a given UInt16 flag as part of the UInt16 bit mask
Boolean atomicGetThenSetFlag ( io UInt32 val, in UInt32 flag )
sets a given UInt32 flag as part of the UInt32 bit mask
Boolean atomicGetThenSetFlag ( io UInt8 val, in UInt8 flag )
sets a given UInt8 flag as part of the UInt8 bit mask
atomicSetBit ( io UInt32 val, in UInt32 bit )
sets a certain bit of a given UInt32 value
atomicSetBit ( io UInt32 val, in UInt32 bit, in Boolean value )
sets a bit to 0 or 1 for a given UInt32 value
clearBit ( io UInt32 val, in UInt32 bit )
sets a bit to 0 for a given UInt32 value
clearBit ( io UInt64 val, in UInt64 bit )
sets a bit of a UInt64 value to 0
clearFlag ( io UInt16 val, in UInt16 flag )
clearFlag ( io UInt32 val, in UInt32 flag )
removes a given UInt32 flag from an UInt32 bit mask
clearFlag ( io UInt8 val, in UInt8 flag )
removes a given UInt8 flag from an UInt8 bit mask
Float32 frexp ( in Float32 value, io Integer e )
Get significant and exponent Breaks the floating point number x into its binary significant (a floating point value between 0.5(included) and 1.0(excluded)) and an integral exponent for 2, such that:
Float64 frexp ( in Float64 value, io Integer e )
Get significant and exponent Breaks the floating point number x into its binary significant (a floating point value between 0.5(included) and 1.0(excluded)) and an integral exponent for 2, such that:
Boolean getBit ( in UInt32 val, in UInt32 bit )
returns a certain bit of a given UInt32 value
Boolean getBit ( in UInt64 val, in UInt64 bit )
returns true if a given UInt64 flag is part of the UInt64 bit mask
Boolean getFlag ( in UInt16 val, in UInt16 flag )
Boolean getFlag ( in UInt32 val, in UInt32 flag )
returns true if a given UInt32 flag is part of the UInt32 bit mask
Boolean getFlag ( in UInt8 val, in UInt8 flag )
returns true if a given UInt8 flag is part of the UInt8 bit mask
String getSetBitsString ( in UInt32 val )
returns a UInt32 number as a bitmask
/*
** Example: getSetBitsString
*/
require Util;
operator entry() {
UInt32 v;
setBit(v, 3, true);
setBit(v, 7, true);
setBit(v, 12, true);
report(getSetBitsString(v));
}
/*
** Output:
[3, 7, 12]
*/
String getSetBitsString ( in UInt64 val )
returns a UInt64 number as a bitmask
Boolean getThenClearBit ( io UInt32 val, in UInt32 bit )
first gets and then clears a bit of a given UInt32 value
Boolean getThenClearFlag ( io UInt16 val, in UInt16 flag )
removes a given UInt16 flag as part of the UInt16 bit mask and returns the previous value
Boolean getThenClearFlag ( io UInt32 val, in UInt32 flag )
removes a given UInt32 flag as part of the UInt32 bit mask and returns the previous value
Boolean getThenClearFlag ( io UInt8 val, in UInt8 flag )
removes a given UInt8 flag as part of the UInt8 bit mask and returns the previous value
Boolean getThenSetBit ( io UInt32 val, in UInt32 bit )
first gets and then sets a bit of a given UInt32 value
Boolean getThenSetBit ( io UInt32 val, in UInt32 bit, in Boolean value )
first gets and then sets a bit to 0 or 1 for a given UInt32 value
Boolean getThenSetBit ( io UInt64 val, in UInt64 bit )
first gets and then sets a bit of a UInt64 value
Boolean getThenSetBit ( io UInt64 val, in UInt64 bit, in Boolean value )
first gets and then sets a bit of a UInt64 value to 0 or 1
Boolean getThenSetFlag ( io UInt16 val, in UInt16 flag )
sets a given UInt16 flag as part of the UInt16 bit mask and returns the previous value
Boolean getThenSetFlag ( io UInt32 val, in UInt32 flag )
sets a given UInt32 flag as part of the UInt32 bit mask and returns the previous value
Boolean getThenSetFlag ( io UInt8 val, in UInt8 flag )
sets a given UInt8 flag as part of the UInt8 bit mask and returns the previous value
Float32 ldexp ( in Float32 value, in Integer e )
Generate value from significant and exponent Returns the result of multiplying x (the significant) by 2 raised to the power of exp (the exponent).
Float64 ldexp ( in Float64 value, in Integer e )
Generate value from significant and exponent Returns the result of multiplying x (the significant) by 2 raised to the power of exp (the exponent).
setBit ( io UInt32 val, in UInt32 bit )
sets a certain bit of a given UInt32 value
setBit ( io UInt32 val, in UInt32 bit, in Boolean value )
sets a bit to 0 or 1 for a given UInt32 value
setBit ( io UInt64 val, in UInt64 bit )
sets a bit of a given UInt64 value
setBit ( io UInt64 val, in UInt64 bit, in Boolean value )
sets a bit of a UInt64 value to 0 or 1
setFlag ( io UInt16 val, in UInt16 flag )
sets a given UInt16 flag as part of the UInt16 bit mask
setFlag ( io UInt32 val, in UInt32 flag )
sets a given UInt32 flag as part of the UInt32 bit mask
setFlag ( io UInt8 val, in UInt8 flag )
sets a given UInt8 flag as part of the UInt8 bit mask
swap ( io UInt32 first, io UInt32 second )
swaps two UInt32 numbers
Boolean synchronizeVersion ( in UInt32 source, io UInt32 observer )
returns true if the observer version needs to be synchronized with the source
Boolean synchronizeVersion ( in UInt64 source, io UInt64 observer )
returns true if the observer version needs to be synchronized with the source
Float32[] truncateDecimals ( in Float32 array[], in Integer n )
Keeps the first n decimals. of Float32 array values
Float32 truncateDecimals ( in Float32 value, in Integer n )
Keeps the first n decimals. of the value.
Float64[] truncateDecimals ( in Float64 array[], in Integer n )
Keeps the first n decimals. of Float64 array values
Float64 truncateDecimals ( in Float64 value, in Integer n )
Keeps the first n decimals. of the value.
String truncateDecimalsPrint ( in ARGB value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Box3 value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Color value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Complex value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Complex_d value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Euler value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Float32 array[], in UInt32 n )
Converts the Float32 array values to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Float32 value, in Integer n )
Converts the Scalar value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Float64 array[], in UInt32 n )
Converts the Float64 array valuee to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Float64 value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Mat mat, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Mat22 value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Mat33 value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Mat44 value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Mat_c mat, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Mat_cd mat, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Mat_d mat, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Mat_i mat, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Quat value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in RGB value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in RGBA value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Ray value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in RotationOrder value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Vec vec, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Vec2 value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Vec3 value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Vec3_c value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Vec3_cd value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Vec3_d value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Vec4 value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Vec_c vec, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Vec_cd vec, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Vec_d vec, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Vec_i vec, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String truncateDecimalsPrint ( in Xfo value, in UInt32 n )
Converts the value to a string, keeping the first n decimals.
String unitTestPrint ( in ARGB value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Box3 value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Color value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Complex value )
Converts the Scalar value to a string, removing accuracy to ensure the same result across all platforms.
String unitTestPrint ( in Complex_d value )
Converts the Scalar value to a string, removing accuracy to ensure the same result across all platforms.
String unitTestPrint ( in Euler value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Float32 array[] )
Converts the Float32 array values to a string, removing accuracy to ensure the same result across all platforms.
String unitTestPrint ( in Float32 value )
Converts the Scalar value to a string, removing accuracy to ensure the same result across all platforms.
String unitTestPrint ( in Float64 array[] )
Converts the Float64 array valuee to a string, removing accuracy to ensure the same result across all platforms.
String unitTestPrint ( in Float64 value )
Converts the Scalar value to a string, removing accuracy to ensure the same result across all platforms.
String unitTestPrint ( in Mat mat )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Mat22 value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Mat33 value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Mat44 value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Mat_c mat )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Mat_cd mat )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Mat_d mat )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Mat_i mat )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Quat value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in RGB value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in RGBA value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Ray value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in RotationOrder value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Vec vec )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Vec2 value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Vec3 value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Vec3_c value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Vec3_cd value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Vec3_d value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Vec4 value )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Vec_c vec )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Vec_cd vec )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Vec_d vec )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Vec_i vec )
Converts the value to a string ensuring the same result across all platforms.
String unitTestPrint ( in Xfo value )
Converts the value to a string ensuring the same result across all platforms.
Float32[] unitTestTruncate ( in Float32 array[] )
Removes accuracy to the Float32 array values to ensure the same result across all platforms.
Float32 unitTestTruncate ( in Float32 value )
Removes accuracy to the Float32 value to ensure the same result across all platforms.
Float64[] unitTestTruncate ( in Float64 array[] )
Removes accuracy to the Float64 array values to ensure the same result across all platforms.
Float64 unitTestTruncate ( in Float64 value )
Removes accuracy to the Float64 value to ensure the same result across all platforms.
Boolean updateValue ( in Boolean source, io Boolean target )
updateValue ( in Boolean source, io Boolean target, io Boolean changedAccumulator )
updateValue ( in Boolean source, io Boolean target, io UInt32 version )
Boolean updateValue ( in Float32 source, io Float32 target )
updateValue ( in Float32 source, io Float32 target, io Boolean changedAccumulator )
updateValue ( in Float32 source, io Float32 target, io UInt32 version )
Boolean updateValue ( in Float32 source, io UInt32 target )
updateValue ( in Float32 source, io UInt32 target, io Boolean changedAccumulator )
Compare bitcast to UInt32
updateValue ( in Float32 source, io UInt32 target, io UInt32 version )
Compare bitcast to UInt32
Boolean updateValue ( in Float64 source, io Float64 target )
updateValue ( in Float64 source, io Float64 target, io Boolean changedAccumulator )
updateValue ( in Float64 source, io Float64 target, io UInt32 version )
Boolean updateValue ( in Object source, io Object target )
updateValue ( in Object source, io Object target, io Boolean changedAccumulator )
updateValue ( in Object source, io Object target, io UInt32 version )
Boolean updateValue ( in Ref<Object> source, io Ref<Object> target )
updateValue ( in Ref<Object> source, io Ref<Object> target, io Boolean changedAccumulator )
updateValue ( in Ref<Object> source, io Ref<Object> target, io UInt32 version )
Boolean updateValue ( in SInt32 source, io SInt32 target )
updateValue ( in SInt32 source, io SInt32 target, io Boolean changedAccumulator )
updateValue ( in SInt32 source, io SInt32 target, io UInt32 version )
Boolean updateValue ( in String source, io String target )
updateValue ( in String source, io String target, io Boolean changedAccumulator )
updateValue ( in String source, io String target, io UInt32 version )
Boolean updateValue ( in UInt32 source, io UInt32 target )
updateValue ( in UInt32 source, io UInt32 target, io Boolean changedAccumulator )
updateValue ( in UInt32 source, io UInt32 target, io UInt32 version )
Boolean updateValue ( in UInt8 source, io UInt8 target )
updateValue ( in UInt8 source, io UInt8 target, io Boolean changedAccumulator )
updateValue ( in UInt8 source, io UInt8 target, io UInt32 version )