Sum up elements in matrix arraylist -


i trying sum each arraylist within arraylist. assuming use method. not sure how exactly. have far. indicated arrows trying add arraylist before starts on new arraylist. ideas?????

    public void sparsecounttimer(arraylist arraylist)     {         double totalrowscount = 0.0;         long   totaltime      = 0;          (int x = 0; x < iteration; x++)         {             long   starttime2     = 0,                    estimatedtime2 = 0;             double rowtotal       = 0.0,                    lastrowtotal   = 0.0;              for( int = 0; < matrixdimension; ++i)             {                 if (lastrowtotal < rowtotal)                 {                     lastrowtotal = rowtotal;                     starttime2 = system.nanotime();                  }                 rowtotal = 0.0;                 (int j = 0; j < matrixdimension; ++j)                 {             >>>>>>>>>    rowtotal += arraylist.get(j).get(i);    <<<<<<<<<<<<<<                 }                 estimatedtime2 = system.nanotime() - starttime2;             }             totalrowscount += lastrowtotal;             totaltime += estimatedtime2;         }     } 


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -