0

I have a square matrix (nxn) and I know that its rank < n. I also know that one of its column can be expressed as linear combination of few other columns (< n-1). for e.g. if I have a 5x5 matrix then its column 2 can be expressed as combination of column 1 and column 3. I want to find a way to detect these linearly dependent columns. An answer on https://stackoverflow.com/a/24548118/8245075 does the exact job I want. However, I am programming in C and using lapack routines for linear algebra.

How to do this in lapack ?

user402940
  • 315
  • 2
  • 10
  • Could you elaborate a bit what you would like. It should be clear that if `c2` is a linear combination of `c1` and `c3` (`c2=a c1 + b c3`), then `c1` can be written as a linear combination of `c2` and `c3` (dito `c3`). Are you searching for a set of vectors which span the vector space given by the columns of your matrix? – kvantour Mar 21 '18 at 16:14
  • @kvantour: Going by your notations, I want to detect c1, c2 and c3 columns out of the 5 columns. – user402940 Apr 02 '18 at 12:11

1 Answers1

0

Do an Eigenvalue decomposition (choose appropriate here: http://www.netlib.org/lapack/explore-html/d9/d8e/group__double_g_eeigen.html - these are the real double percision drivers). The cols (transposed => rows) with eigenvalue 0 are linearly dependant on others.

Kaveh Vahedipour
  • 3,412
  • 1
  • 14
  • 22