# LAPACK: ZGETRF with INFO greater than zero but ZGETRI does not fail.

I am computing the inverse of a complex matrix. I execute ZGETRF but U(2,2) = 0. When I compute ZGETRI, the inverse is determined. Can I trust this inverse?

• You can make a check. Is A * inv(A) = 1? If this is not the case (within numerical precision) then your inverse is obviously wrong. – Henri Menke Aug 8 '17 at 21:43
• is U(2,2) exactly 0 or something $\approx u$ – M.K. aka Grisu Aug 9 '17 at 10:50
• I would like to know for every case, without having to multiply the matrices, but I can do that. Thanks! – N Luis Aug 9 '17 at 14:21
• I haven't checked if U(2,2) is actually zero. But, per definition of ZGETRF, when INFO > 0, U(INFO,INFO) = 0... – N Luis Aug 9 '17 at 14:22
• if $U(2,2) = 0$ (exactly, as a return value INFO=2 would indicate), then the original matrix is singular so ZGETRI should fail (with the same error INFO=2). Not directly related to your original question, but may I ask why you want to compute the explicit inverse of your matrix operator? – GoHokies Aug 9 '17 at 19:06

I have answered a similar question when a failed zgetrf will be followed by a successful zgetrs. In this question, the situation is similar.
To call zgetri, you have to call zgetrf first. Therefore, if zgetrf failed (in a sense that $U_{2,2}=0$) in the first place, there is no point in calling zgetri and hope for a reliable result.
Why zgetri does not result in an explicit error itself is another question, and probably will depend on the particular implementation of LAPACK/BLAS library. But, to sum it up, since you got an error in the first step of your two-step process of obtaining the inverse of the matrix, you certainly cannot trust the obtained inverse.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9307872,"math_prob":0.82653403,"size":1939,"snap":"2021-31-2021-39","text_gpt3_token_len":457,"char_repetition_ratio":0.12919897,"word_repetition_ratio":0.0,"special_character_ratio":0.22485818,"punctuation_ratio":0.10026385,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9779758,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-08-04T06:22:50Z\",\"WARC-Record-ID\":\"<urn:uuid:e9cdaa72-3451-4de4-bc80-846039bad165>\",\"Content-Length\":\"169723\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c1c3c198-195b-4fc5-ad6f-a38574ba0bf3>\",\"WARC-Concurrent-To\":\"<urn:uuid:7c54e4ee-ca21-4377-9991-74beaf46ae12>\",\"WARC-IP-Address\":\"151.101.129.69\",\"WARC-Target-URI\":\"https://scicomp.stackexchange.com/questions/27584/lapack-zgetrf-with-info-greater-than-zero-but-zgetri-does-not-fail\",\"WARC-Payload-Digest\":\"sha1:ETPNZYMOS4AOD76ADA5WFWVXN4CSTVAO\",\"WARC-Block-Digest\":\"sha1:OOS3EUJIRNA32E4MH6IWLHM5SSZDS5YY\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-31/CC-MAIN-2021-31_segments_1627046154796.71_warc_CC-MAIN-20210804045226-20210804075226-00172.warc.gz\"}"}