private void allocMemory () {
        int row = stackedToOneColMat[0].getRowDimension();
        int col = stackedToOneColMat[0].getColumnDimension();
        int rowD = reshapedProductUVBaseMat[0].getColumnDimension();

        tempDiff = new TempDiff(row, col, codeCbCr);
        lambda = new Lambda(row, col, codeCbCr);
        residue = new Residue(row, col, codeCbCr);
        diag = new Diag(rowD, 1, codeCbCr);
        iter = new int[3];
        beta = new double[3];
        beta[0] = beta[1] = beta[2] = betaOrg;

        zeroMat = new Matrix[1];
        zeroMat[0] = new Matrix(row, col, 0.0);

        diagList  = new ArrayList<>();
        for (int color = 0; color < 3; color++) {
            diagList.add(new LinkedList<Integer>());
        }

    }