本文整理汇总了Java中org.jtransforms.utils.CommonUtils.getThreadsBeginN_2D方法的典型用法代码示例。如果您正苦于以下问题:Java CommonUtils.getThreadsBeginN_2D方法的具体用法?Java CommonUtils.getThreadsBeginN_2D怎么用?Java CommonUtils.getThreadsBeginN_2D使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jtransforms.utils.CommonUtils
的用法示例。
在下文中一共展示了CommonUtils.getThreadsBeginN_2D方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FloatFFT_2D
import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
/**
* Creates new instance of FloatFFT_2D.
*
* @param rows number of rows
* @param columns number of columns
*/
public FloatFFT_2D(long rows, long columns)
{
if (rows <= 1 || columns <= 1) {
throw new IllegalArgumentException("rows and columns must be greater than 1");
}
this.rows = (int) rows;
this.columns = (int) columns;
this.rowsl = rows;
this.columnsl = columns;
if (rows * columns >= CommonUtils.getThreadsBeginN_2D()) {
this.useThreads = true;
}
if (CommonUtils.isPowerOf2(rows) && CommonUtils.isPowerOf2(columns)) {
isPowerOfTwo = true;
}
CommonUtils.setUseLargeArrays(2 * rows * columns > LargeArray.getMaxSizeOf32bitArray());
fftRows = new FloatFFT_1D(rows);
if (rows == columns) {
fftColumns = fftRows;
} else {
fftColumns = new FloatFFT_1D(columns);
}
}
示例2: DoubleFFT_2D
import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
/**
* Creates new instance of DoubleFFT_2D.
*
* @param rows
* number of rows
* @param columns
* number of columns
*/
public DoubleFFT_2D(long rows, long columns)
{
if (rows <= 1 || columns <= 1) {
throw new IllegalArgumentException("rows and columns must be greater than 1");
}
this.rows = (int) rows;
this.columns = (int) columns;
this.rowsl = rows;
this.columnsl = columns;
if (rows * columns >= CommonUtils.getThreadsBeginN_2D()) {
this.useThreads = true;
}
if (CommonUtils.isPowerOf2(rows) && CommonUtils.isPowerOf2(columns)) {
isPowerOfTwo = true;
}
CommonUtils.setUseLargeArrays(2 * rows * columns > LargeArray.getMaxSizeOf32bitArray());
fftRows = new DoubleFFT_1D(rows);
if (rows == columns) {
fftColumns = fftRows;
} else {
fftColumns = new DoubleFFT_1D(columns);
}
}
示例3: DoubleDST_2D
import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
/**
* Creates new instance of DoubleDST_2D.
*
* @param rows number of rows
* @param columns number of columns
*/
public DoubleDST_2D(long rows, long columns)
{
if (rows <= 1 || columns <= 1) {
throw new IllegalArgumentException("rows and columns must be greater than 1");
}
this.rows = (int) rows;
this.columns = (int) columns;
this.rowsl = rows;
this.columnsl = columns;
if (rows * columns >= CommonUtils.getThreadsBeginN_2D()) {
useThreads = true;
}
if (CommonUtils.isPowerOf2(rows) && CommonUtils.isPowerOf2(columns)) {
isPowerOfTwo = true;
}
CommonUtils.setUseLargeArrays(rows * columns > LargeArray.getMaxSizeOf32bitArray());
dstRows = new DoubleDST_1D(rows);
if (rows == columns) {
dstColumns = dstRows;
} else {
dstColumns = new DoubleDST_1D(columns);
}
}
示例4: FloatDST_2D
import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
/**
* Creates new instance of FloatDST_2D.
*
* @param rows number of rows
* @param columns number of columns
*/
public FloatDST_2D(long rows, long columns)
{
if (rows <= 1 || columns <= 1) {
throw new IllegalArgumentException("rows and columns must be greater than 1");
}
this.rows = (int) rows;
this.columns = (int) columns;
this.rowsl = rows;
this.columnsl = columns;
if (rows * columns >= CommonUtils.getThreadsBeginN_2D()) {
useThreads = true;
}
if (CommonUtils.isPowerOf2(rows) && CommonUtils.isPowerOf2(columns)) {
isPowerOfTwo = true;
}
CommonUtils.setUseLargeArrays(rows * columns > LargeArray.getMaxSizeOf32bitArray());
dstRows = new FloatDST_1D(rows);
if (rows == columns) {
dstColumns = dstRows;
} else {
dstColumns = new FloatDST_1D(columns);
}
}
示例5: DoubleDCT_2D
import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
/**
* Creates new instance of DoubleDCT_2D.
*
* @param rows number of rows
* @param columns number of columns
*/
public DoubleDCT_2D(long rows, long columns)
{
if (rows <= 1 || columns <= 1) {
throw new IllegalArgumentException("rows and columns must be greater than 1");
}
this.rows = (int) rows;
this.columns = (int) columns;
this.rowsl = rows;
this.columnsl = columns;
if (rows * columns >= CommonUtils.getThreadsBeginN_2D()) {
this.useThreads = true;
}
if (CommonUtils.isPowerOf2(rows) && CommonUtils.isPowerOf2(columns)) {
isPowerOfTwo = true;
}
CommonUtils.setUseLargeArrays(rows * columns > LargeArray.getMaxSizeOf32bitArray());
dctRows = new DoubleDCT_1D(rows);
if (rows == columns) {
dctColumns = dctRows;
} else {
dctColumns = new DoubleDCT_1D(columns);
}
}
示例6: FloatDCT_2D
import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
/**
* Creates new instance of FloatDCT_2D.
*
* @param rows number of rows
* @param columns number of columns
*/
public FloatDCT_2D(long rows, long columns)
{
if (rows <= 1 || columns <= 1) {
throw new IllegalArgumentException("rows and columns must be greater than 1");
}
this.rows = (int) rows;
this.columns = (int) columns;
this.rowsl = rows;
this.columnsl = columns;
if (rows * columns >= CommonUtils.getThreadsBeginN_2D()) {
this.useThreads = true;
}
if (CommonUtils.isPowerOf2(rows) && CommonUtils.isPowerOf2(columns)) {
isPowerOfTwo = true;
}
CommonUtils.setUseLargeArrays(rows * columns > LargeArray.getMaxSizeOf32bitArray());
dctRows = new FloatDCT_1D(rows);
if (rows == columns) {
dctColumns = dctRows;
} else {
dctColumns = new FloatDCT_1D(columns);
}
}
示例7: DoubleDHT_2D
import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
/**
* Creates new instance of DoubleDHT_2D.
*
* @param rows number of rows
* @param columns number of columns
*/
public DoubleDHT_2D(long rows, long columns)
{
if (rows <= 1 || columns <= 1) {
throw new IllegalArgumentException("rows and columns must be greater than 1");
}
this.rows = (int) rows;
this.columns = (int) columns;
this.rowsl = rows;
this.columnsl = columns;
if (rows * columns >= CommonUtils.getThreadsBeginN_2D()) {
this.useThreads = true;
}
if (CommonUtils.isPowerOf2(rows) && CommonUtils.isPowerOf2(columns)) {
isPowerOfTwo = true;
}
CommonUtils.setUseLargeArrays(rows * columns > LargeArray.getMaxSizeOf32bitArray());
dhtRows = new DoubleDHT_1D(rows);
if (rows == columns) {
dhtColumns = dhtRows;
} else {
dhtColumns = new DoubleDHT_1D(columns);
}
}
示例8: FloatDHT_2D
import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
/**
* Creates new instance of FloatDHT_2D.
*
* @param rows number of rows
* @param columns number of columns
*/
public FloatDHT_2D(long rows, long columns)
{
if (rows <= 1 || columns <= 1) {
throw new IllegalArgumentException("rows and columns must be greater than 1");
}
this.rows = (int) rows;
this.columns = (int) columns;
this.rowsl = rows;
this.columnsl = columns;
if (rows * columns >= CommonUtils.getThreadsBeginN_2D()) {
this.useThreads = true;
}
if (CommonUtils.isPowerOf2(rows) && CommonUtils.isPowerOf2(columns)) {
isPowerOfTwo = true;
}
CommonUtils.setUseLargeArrays(rows * columns > LargeArray.getMaxSizeOf32bitArray());
dhtRows = new FloatDHT_1D(rows);
if (rows == columns) {
dhtColumns = dhtRows;
} else {
dhtColumns = new FloatDHT_1D(columns);
}
}
示例9: initialiseKernel
import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
/**
* Initialise the kernel FHT. It is recreated only if the target size has changed.
*
* @param maxx
* the width of the target image
* @param maxy
* the height of the target image
*/
public void initialiseKernel(int maxx, int maxy)
{
int maxN = Maths.nextPow2(Maths.max(maxx, maxy, kN));
if (tmp == null || tmp.length != maxN * maxN)
tmp = new float[maxN * maxN];
if (kernelFht != null && maxN == kernelFht.getWidth())
// Already initialised
return;
int size = maxN * maxN;
// No window function for the kernel so just create a new FHT
float[] data;
if (kw < maxN || kh < maxN)
{
// Too small so insert in the middle
data = new float[size];
int x = getInsert(maxN, kw);
int y = getInsert(maxN, kh);
insert(kernel, kw, data, maxN, x, y);
}
else
{
// Clone to avoid destroying data
data = kernel.clone();
}
// Do the transform using JTransforms as it is faster. Do not allow multi-threading.
long begin = CommonUtils.getThreadsBeginN_2D();
CommonUtils.setThreadsBeginN_2D(Long.MAX_VALUE);
dht = new FloatDHT_2D(maxN, maxN);
CommonUtils.setThreadsBeginN_2D(begin);
dht.forward(data);
kernelFht = new FHT2(data, maxN, true);
//kernelFht = new FHT2(data, maxN, false);
//kernelFht.transform();
if (operation == Operation.DECONVOLUTION)
kernelFht.initialiseFastOperations();
else
kernelFht.initialiseFastMultiply();
// This is used for the output complex multiple of the two FHTs
tmp = new float[size];
}