code: public static double elementSumSq( DMatrixD1 m  ) {
  
          // minimize round off error
          double maxAbs = CommonOps_DDRM.elementMaxAbs(m);
          if( maxAbs == 0)
              return 0;
  
          double total = 0;
          
          int N = m.getNumElements();
          for( int i = 0; i < N; i++ ) {
              double d = m.data[i]/maxAbs;
              total += d*d;
          }
  
          return maxAbs*total*maxAbs;
      }
docs: Sums up the square of each element in the matrix.  This is equivalent to the
  Frobenius norm squared.
  
  @param m Matrix.
  @return Sum of elements squared.