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

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

Return a vector containing the sums of the columns (having number of columns many entries)

Definition at line 1967 of file DoubleMatrix.java.

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

Referenced by columnMeans(), and org::jblas::la::Geometry::pairwiseSquaredDistances().

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

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

            return v;
        }
    }


Generated by  Doxygen 1.6.0   Back to index