Skip to content
Snippets Groups Projects
Commit 8d352082 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Merge branch 'svd-issue' into 'master'

Using the dgesvd function

See merge request !11
parents 6297d7bb 535d5ac5
Branches
Tags
1 merge request!11Using the dgesvd function
Pipeline #
...@@ -70,7 +70,7 @@ PyObject* py_gsvd (PyObject*, PyObject* args, PyObject* kwds) { ...@@ -70,7 +70,7 @@ PyObject* py_gsvd (PyObject*, PyObject* args, PyObject* kwds) {
PyErr_SetString(PyExc_RuntimeError, e.what()); PyErr_SetString(PyExc_RuntimeError, e.what());
} }
catch (...) { catch (...) {
PyErr_SetString(PyExc_RuntimeError, "norminv failed: unknown exception caught"); PyErr_SetString(PyExc_RuntimeError, "gsvd failed: unknown exception caught");
} }
...@@ -117,7 +117,7 @@ PyObject* py_svd (PyObject*, PyObject* args, PyObject* kwds) { ...@@ -117,7 +117,7 @@ PyObject* py_svd (PyObject*, PyObject* args, PyObject* kwds) {
try { try {
bob::math::svd(*A_bz,V,S,U); bob::math::svd(*A_bz,V,S,U, true);
// S for the python output. // S for the python output.
// LAPACK returns an 1d matrix of size n. // LAPACK returns an 1d matrix of size n.
...@@ -137,7 +137,7 @@ PyObject* py_svd (PyObject*, PyObject* args, PyObject* kwds) { ...@@ -137,7 +137,7 @@ PyObject* py_svd (PyObject*, PyObject* args, PyObject* kwds) {
PyErr_SetString(PyExc_RuntimeError, e.what()); PyErr_SetString(PyExc_RuntimeError, e.what());
} }
catch (...) { catch (...) {
PyErr_SetString(PyExc_RuntimeError, "norminv failed: unknown exception caught"); PyErr_SetString(PyExc_RuntimeError, "svd failed: unknown exception caught");
} }
......
...@@ -20,7 +20,6 @@ import bob.math ...@@ -20,7 +20,6 @@ import bob.math
import numpy import numpy
import nose.tools import nose.tools
numpy.random.seed(10) numpy.random.seed(10)
import pkg_resources
def gsvd_relations(A,B): def gsvd_relations(A,B):
...@@ -104,7 +103,7 @@ def test_svd_signal(): ...@@ -104,7 +103,7 @@ def test_svd_signal():
A = numpy.array([[3,-3,100], [4,-4,50], [3.5,-3.5,-50], [3.8,-3.7,-100]], dtype='float64') A = numpy.array([[3,-3,100], [4,-4,50], [3.5,-3.5,-50], [3.8,-3.7,-100]], dtype='float64')
U_ref = numpy.array([[ 2.20825004e-03, -1.80819459e-03, -9.99995927e-01], U_ref = numpy.array([[ 2.20825004e-03, -1.80819459e-03, -9.99995927e-01],
[ 7.09549949e-01, -7.04649416e-01, 2.84101853e-03], [ -7.09549949e-01, 7.04649416e-01, -2.84101853e-03],
[ -7.04651683e-01, -7.09553332e-01, -2.73037723e-04]]) [ -7.04651683e-01, -7.09553332e-01, -2.73037723e-04]])
[U,S,V] = bob.math.svd(A) [U,S,V] = bob.math.svd(A)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment