Logo Search packages:      
Sourcecode: jblas version File versions  Download package

DoubleMatrix org::jblas::la::DoubleMatrix::rowSums (  )  [inline]

Return a vector containing the sum of the rows.

Definition at line 1989 of file DoubleMatrix.java.

References columns, DoubleMatrix(), dup(), get(), put(), and rows.

Referenced by rowMeans().

                                  {
        if (columns == 1) {
            return dup();
        } else {
            DoubleMatrix v = new DoubleMatrix(rows);

            for (int c = 0; c < columns; c++) {
                for (int r = 0; r < rows; r++) {
                    v.put(r, v.get(r) + get(r, c));
                }
            }

            return v;
        }
    }


Generated by  Doxygen 1.6.0   Back to index