code: public static double diffNormF(DMatrixD1 a , DMatrixD1 b )
      {
          if( a.numRows != b.numRows || a.numCols != b.numCols ) {
              throw new IllegalArgumentException("Both matrices must have the same shape.");
          }
  
          final int size = a.getNumElements();
  
          DMatrixRMaj diff = new DMatrixRMaj(size,1);
  
          for( int i = 0; i < size; i++ ) {
              diff.set(i , b.get(i) - a.get(i));
          }
          return NormOps_DDRM.normF(diff);
      }
docs: <p>
  Computes the F norm of the difference between the two Matrices:<br>
  <br>
  Sqrt{&sum;<sub>i=1:m</sub> &sum;<sub>j=1:n</sub> ( a<sub>ij</sub> - b<sub>ij</sub>)<sup>2</sup>}
  </p>
  <p>
  This is often used as a cost function.
  </p>
  
  @see NormOps_DDRM#fastNormF
  
  @param a m by n matrix. Not modified.
  @param b m by n matrix. Not modified.
  
  @return The F normal of the difference matrix.