2-D Discrete Fourier Transform.

@param data      Data to transform.
@param direction Transformation direction.
500174
public static void DFT2(ComplexNumber[][] data, Direction direction) {

        int n = data.length;
        int m = data[0].length;
        ComplexNumber[] row = new ComplexNumber[Math.max(m, n)];

        for (int i = 0; i < n; i++) {
            // copy row
            for (int j = 0; j < n; j++)
                row[j] = data[i][j];
            // transform it
            FourierTransform.DFT(row, direction);
            // copy back
            for (int j = 0; j < n; j++)
                data[i][j] = row[j];
        }

        // process columns
        ComplexNumber[] col = new ComplexNumber[n];

        for (int j = 0; j < n; j++) {
            // copy column
            for (int i = 0; i < n; i++)
                col[i] = data[i][j];
            // transform it
            FourierTransform.DFT(col, direction);
            // copy back
            for (int i = 0; i < n; i++)
                data[i][j] = col[i];
        }
    }
46863
public static void FFT(ComplexNumber[] data, Direction direction) {
        double[] real = ComplexNumber.getReal(data);
        double[] img = ComplexNumber.getImaginary(data);
        if (direction == Direction.Forward)
            FFT(real, img);
        else
            FFT(img, real);
        if (direction == Direction.Forward) {
            for (int i = 0; i < real.length; i++) {
                data[i] = new ComplexNumber(real[i], img[i]);
            }
        } else {
            int n = real.length;
            for (int i = 0; i < n; i++) {
                data[i] = new ComplexNumber(real[i] / n, img[i] / n);
            }
        }
    }
1307094
private void set(Point3d[] x, Point3d[] y) {
		this.x = x;
		this.y = y;
		rmsdCalculated = false;
		transformationCalculated = false;
	}
304854
private void applyDirection() {
		String imgUrl = "";
		switch (direction) {
			case NORTH:
				panVector = new Coordinate(0, 1);
				imgUrl = northImage;
				break;
			case EAST:
				panVector = new Coordinate(1, 0);
				imgUrl = eastImage;
				break;
			case SOUTH:
				panVector = new Coordinate(0, -1);
				imgUrl = southImage;
				break;
			case WEST:
				panVector = new Coordinate(-1, 0);
				imgUrl = westImage;
				break;
		}
		controller = new PanArrowController(map, panVector);
		image = new Image(getId());
		image.setHref(imgUrl);
		image.setStyle(style);
		image.setBounds(new Bbox(0, 0, getWidth(), getHeight()));
	}
946567
void setCurrentElements(byte[] data)
	{
		int elems = 0;
		for (int i = 0; i < data.length; ++i)
			elems = elems << 8 | data[i] & 0xff;
		currElems = elems;
	}

	void setPDT(int type)
	{
		pdt = (byte) type;
	}
}
1374062
@Override
  public double[] projectRelativeDataToScaledSpace(double[] data) {
    final int dim = data.length;
    double[] dst = new double[dim];
    for(int d = 0; d < dim; d++) {
      dst[d] = scales[d].getRelativeScaled(data[d]);
    }
    return dst;
  }
1040458
public void setTranslation(List<? extends S> path, Direction1D direction, Tuple2D<?> position) {
		assert position != null : AssertMessages.notNullParameter(3);
		this.path = path == null || path.isEmpty() ? null : new ArrayList<>(path);
		this.firstSegmentDirection = detectFirstSegmentDirection(direction);
		this.curvilineTranslation = position.getX();
		this.shiftTranslation = position.getY();
        this.isIdentity = null;
	}
1028318
public void transform(double data[], int rowspan) {
    checkData(data,rowspan);
    for(int i=0; i<nrows; i++){
      rowFFT.transform(data,i*rowspan,2); }
    for(int j=0; j<ncols; j++){
      colFFT.transform(data,2*j,rowspan); }}
602084
static public <D extends ImageGray<D>>
	void direction2( D derivX , D derivY , GrayF32 angle )
	{
		if( derivX instanceof GrayF32) {
			GradientToEdgeFeatures.direction2((GrayF32)derivX,(GrayF32)derivY,angle);
		} else if( derivX instanceof GrayS16) {
			GradientToEdgeFeatures.direction2((GrayS16)derivX,(GrayS16)derivY,angle);
		} else if( derivX instanceof GrayS32) {
			GradientToEdgeFeatures.direction2((GrayS32)derivX,(GrayS32)derivY,angle);
		} else {
			throw new IllegalArgumentException("Unknown input type");
		}
	}
81935
public static void DFT(ComplexNumber[] data, Direction direction) {
        int n = data.length;
        ComplexNumber[] c = new ComplexNumber[n];

        // for each destination element
        for (int i = 0; i < n; i++) {
            c[i] = new ComplexNumber(0, 0);
            double sumRe = 0;
            double sumIm = 0;
            double phim = 2 * Math.PI * i / n;

            // sum source elements
            for (int j = 0; j < n; j++) {
                double gRe = data[j].real;
                double gIm = data[j].imaginary;
                double cosw = Math.cos(phim * j);
                double sinw = Math.sin(phim * j);
                if (direction == Direction.Backward)
                    sinw = -sinw;

                sumRe += (gRe * cosw + data[j].imaginary * sinw);
                sumIm += (gIm * cosw - data[j].real * sinw);
            }

            c[i] = new ComplexNumber(sumRe, sumIm);
        }

        if (direction == Direction.Backward) {
            for (int i = 0; i < c.length; i++) {
                data[i].real = c[i].real / n;
                data[i].imaginary = c[i].imaginary / n;
            }
        } else {
            for (int i = 0; i < c.length; i++) {
                data[i].real = c[i].real;
                data[i].imaginary = c[i].imaginary;
            }
        }
    }
1137841
private void transformEdgeShape(Point2D down, Point2D out) {
    float x1 = (float) down.getX();
    float y1 = (float) down.getY();
    float x2 = (float) out.getX();
    float y2 = (float) out.getY();

    AffineTransform xform = AffineTransform.getTranslateInstance(x1, y1);
    
    float dx = x2-x1;
    float dy = y2-y1;
    float thetaRadians = (float) Math.atan2(dy, dx);
    xform.rotate(thetaRadians);
    float dist = (float) Math.sqrt(dx*dx + dy*dy);
    xform.scale(dist / rawEdge.getBounds().getWidth(), 1.0);
    edgeShape = xform.createTransformedShape(rawEdge);
}
235283
public void learn(double[][] data) {
        int p = data[0].length;
        Attribute[] attributes = new Attribute[p];
        for (int i = 0; i < p; i++) {
            attributes[i] = new NumericAttribute("V"+i);
        }
        learn(attributes, data);
    }
79899
public static void transform(Matrix4d rotTrans, Point3d[] x) {
		for (Point3d p : x) {
			rotTrans.transform(p);
		}
	}
581100
public static void Forward(double[] data) {
        double[] result = new double[data.length];

        for (int k = 0; k < result.length; k++) {
            double sum = 0;
            for (int n = 0; n < data.length; n++) {
                double theta = ((2.0 * Math.PI) / data.length) * k * n;
                sum += data[n] * cas(theta);
            }
            result[k] = (1.0 / Math.sqrt(data.length)) * sum;
        }

        for (int i = 0; i < result.length; i++) {
            data[i] = result[i];
        }

    }
1286596
private void addShape(String data)
	{
		if (faces.size() != 0)
		{
			Shape s = new Shape(faces);
			shapes.put(currentShape.toLowerCase(), s);
			faces.clear();
		}

		if (data != "")
			currentShape = data.indexOf('_') != -1 ? data.substring(0, data.indexOf('_')) : data;
	}
1026619
public void readArray(double[] data) throws IOException {
        int size = data.length;
        for (int i = 0; i < size; ++i)
            data[i] = getDouble();
    }
1303190
public void printCoordinate(int[] row, int[] column, float[] dataR,
            float[] dataI) {
        printCoordinate(row, column, dataR, dataI, 0);
    }