code: 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;
      }
docs: Sum of all elements
  
  @param A (Input) Matrix. Not modified.
  @return scalar