docstr: Calculate the condition number of a matrix using a specified matrix norm.
  
  The condition number estimates the sensitivity of a matrix to errors.
  Example: small input errors for ill-conditioned coefficient matrices
  alter the solution of the system dramatically.
  
  For ill-conditioned matrices it's recommended to use qr_solve() instead
  of lu_solve(). This does not help with input errors however, it just avoids
  to add additional errors.
  
  Definition:    cond(A) = ||A|| * ||A**-1||
docstr_tok: ["Calculate","the","condition","number","of","a","matrix","using","a","specified","matrix","norm",".","The","condition","number","estimates","the","sensitivity","of","a","matrix","to","errors",".","Example",":","small","input","errors","for","ill-conditioned","coefficient","matrices","alter","the","solution","of","the","system","dramatically",".","For","ill-conditioned","matrices","it","'s","recommended","to","use","qr_solve","(",")","instead","of","lu_solve","(",")",".","This","does","not","help","with","input","errors","however",",","it","just","avoids","to","add","additional","errors",".","Definition",":","cond","(","A",")","=","||A||","*","||A","*","*","-1||"]
code: def cond(ctx, A, norm=None):
      """
      Calculate the condition number of a matrix using a specified matrix norm.
  
      The condition number estimates the sensitivity of a matrix to errors.
      Example: small input errors for ill-conditioned coefficient matrices
      alter the solution of the system dramatically.
  
      For ill-conditioned matrices it's recommended to use qr_solve() instead
      of lu_solve(). This does not help with input errors however, it just avoids
      to add additional errors.
  
      Definition:    cond(A) = ||A|| * ||A**-1||
      """
      if norm is None:
          norm = lambda x: ctx.mnorm(x, 1)
      return norm(A) * norm(ctx.inverse(A))
  
imports: from copy import copy
  from ..libmp.backend import xrange
label_desc: Use image node_id 15 for calling the LinearAlgebraMethods obj's underlying member method code with example usage: obj.cond(ctx, A, norm) and returns: unknown