private static RealMatrix addNoise(final RealMatrix A) {
        RealMatrix buffer = A.copy();
        RealMatrix noise = MatrixUtils.createRealMatrix(A.getRowDimension(), A.getColumnDimension());

        for (int i = 0; i < A.getRowDimension(); ++i) {
            for (int j = 0; j < A.getColumnDimension(); ++j) {
                double noiseSign = Math.random() > 0.5 ? 1 : -1;
                double noiseAmplitude = 1;
                noise.setEntry(i, j, noiseSign * Math.random() * noiseAmplitude);
            }
        }

        buffer = buffer.add(noise);
        return buffer;
    }