code: public static double elementP(DMatrix1Row A , double p ) {
          if( p == 1 ) {
              return CommonOps_DDRM.elementSumAbs(A);
          } if( p == 2 ) {
              return normF(A);
          } else {
              double max = CommonOps_DDRM.elementMaxAbs(A);
  
              if( max == 0.0 )
                  return 0.0;
  
              double total = 0;
  
              int size = A.getNumElements();
  
              for( int i = 0; i < size; i++ ) {
                  double a = A.get(i)/max;
  
                  total += Math.pow(Math.abs(a),p);
              }
  
              return max* Math.pow(total,1.0/p);
          }
      }
docs: <p>
  Element wise p-norm:<br>
  <br>
  norm = {&sum;<sub>i=1:m</sub> &sum;<sub>j=1:n</sub> { |a<sub>ij</sub>|<sup>p</sup>}}<sup>1/p</sup>
  </p>
  
  <p>
  This is not the same as the induced p-norm used on matrices, but is the same as the vector p-norm.
  </p>
  
  @param A Matrix. Not modified.
  @param p p value.
  @return The norm's value.