[arrayfire] 343/408: DOCS: Updating the documentation for SVD
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Sep 21 19:12:26 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/sid
in repository arrayfire.
commit 974856b66d72e567bcd004cd1772997c9831e73b
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date: Tue Aug 25 06:51:42 2015 -0400
DOCS: Updating the documentation for SVD
---
docs/details/lapack.dox | 22 ++++++++++++++++++++++
test/svd_dense.cpp | 3 +++
2 files changed, 25 insertions(+)
diff --git a/docs/details/lapack.dox b/docs/details/lapack.dox
index beb39ba..ce23abe 100644
--- a/docs/details/lapack.dox
+++ b/docs/details/lapack.dox
@@ -123,6 +123,28 @@ When memory is a concern, users can perform Cholesky decomposition in place as s
=======================================================================
+\defgroup lapack_factor_func_svd svd
+
+\ingroup lapack_factor_mat
+
+\brief Perform Singular Value Decomposition
+
+This function factorizes a matrix **A** into two unitary matrices **U** and **Vt**, and a diagonal matrix **S** such that
+
+ \f$A = U * S * Vt\f$
+
+If **A** has **M** rows and **N** columns, **U** is of the size **M x M** , **V** is of size **N x N**, and **S** is of size **M x N**
+
+The arrayfire function only returns the non zero diagonal elements of **S**. To reconstruct the original matrix **A** from the individual factors, the following code snuppet can be used:
+
+
+\snippet test/svd_dense.cpp ex_svd_reg
+
+When memory is a concern, and **A** is dispensible, \ref svdInPlace can be used
+
+
+=======================================================================
+
\defgroup lapack_solve_func_gen solve
\ingroup lapack_solve_mat
diff --git a/test/svd_dense.cpp b/test/svd_dense.cpp
index 7ba8e23..ec81e99 100644
--- a/test/svd_dense.cpp
+++ b/test/svd_dense.cpp
@@ -55,6 +55,8 @@ void svdTest(const int M, const int N)
af::dtype ty = (af::dtype)af::dtype_traits<T>::af_type;
af::array A = af::randu(M, N, ty);
+
+ //! [ex_svd_reg]
af::array U, S, Vt;
af::svd(U, S, Vt, A);
@@ -65,6 +67,7 @@ void svdTest(const int M, const int N)
af::array VV = Vt(af::seq(MN), af::span);
af::array AA = matmul(UU, SS, VV);
+ //! [ex_svd_reg]
std::vector<T> hA(M * N);
std::vector<T> hAA(M * N);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git
More information about the debian-science-commits
mailing list