0

我试图总结一个数组列表中的每个数组列表。我假设您使用 get 方法。但我不确定如何做到这一点。这就是我到目前为止所拥有的。如箭头所示,我是否正在尝试在新的arraylist 上开始之前添加arraylist。有任何想法吗?????

    public void sparseCountTimer(ArrayList arraylist)
    {
        double totalRowsCount = 0.0;
        long   totalTime      = 0;

        for (int x = 0; x < iteration; x++)
        {
            long   startTime2     = 0,
                   estimatedTime2 = 0;
            double rowTotal       = 0.0,
                   lastRowTotal   = 0.0;

            for( int i = 0; i < matrixDimension; ++i)
            {
                if (lastRowTotal < rowTotal)
                {
                    lastRowTotal = rowTotal;
                    startTime2 = System.nanoTime(); 
                }
                rowTotal = 0.0;
                for (int j = 0; j < matrixDimension; ++j)
                {
            >>>>>>>>>    rowTotal += arraylist.get(j).get(i);    <<<<<<<<<<<<<<
                }
                estimatedTime2 = System.nanoTime() - startTime2;
            }
            totalRowsCount += lastRowTotal;
            totalTime += estimatedTime2;
        }
    }
4

0 回答 0