# svd code in c

This is my new post about how to create svd code in c with LAPACK routines. I get a problem in programming about gridding and I want to use svd code in c (I create svd code with LAPACK routines and call that from C) to solve this problem computation. In linear algebra, the singular value decomposition (SVD) is a factorization of a real or complex matrix, with many useful applications in signal processing and statistics (from wikipedia). We can use svd in Matlab with command [u, s, v] = svd(a). When you read in Matlab documentation, Matlab svd code uses the LAPACK routines to compute the svd (singular value decomposition). From this post, I try to create a simple svd code to solve svd computation with LAPACK routines. In my code, I use the last post about create 2d Array in C.

Singular value decomposition takes a rectangular matrix of gene expression data (defined as A, where A is a n x p matrix) in which the n rows represents the genes, and the p columns represents the experimental conditions. The SVD theorem states:

## A = U*S*VT

Result from this svd code computation is three matrix/array :

• U (Where the columns of U are the left singular vectors (gene coefficient vectors))
• S (S (the same dimensions as A) has singular values and is diagonal (mode amplitudes))
• VT has rows that are the right singular vectors (expression level vectors)

This is my simple svd code in c with LAPACK routine, you can save this code with name svdCLapack.c