public static double elementSum( DMatrixSparseCSC A ) {
        if( A.nz_length == 0)
            return 0;

        double sum = 0;
        for(int i = 0; i < A.nz_length; i++ ) {
            sum += A.nz_values[i];
        }

        return sum;
    }
public static double elementSum ( DMatrixSparseCSC A ) { if ( A . nz_length == 0 ) return 0 ; double sum = 0 ; for ( int i = 0 ; i < A . nz_length ; i ++ ) { sum += A . nz_values [ i ] ; } return sum ; }
Sum of all elements

@param A (Input) Matrix. Not modified.
@return scalar