Commit 5916eb8a authored by André Anjos's avatar André Anjos 💬

Move header-only files to an easily accessible location

parent 505e2800
......@@ -4,6 +4,10 @@ from ._library import *
# To get the full API documentation automatically
__all__ = dir()
def get_include():
"""Returns the directory containing the C/C++ API include directives"""
return __import__('pkg_resources').resource_filename(__name__, 'include')
def get_config():
"""Returns a string containing the configuration information.
......@@ -25,4 +29,4 @@ def get_config():
return retval.strip()
# gets sphinx autodoc done right - don't remove it
__all__ = [_ for _ in dir() if not _.startswith('_')]
\ No newline at end of file
__all__ = [_ for _ in dir() if not _.startswith('_')]
......@@ -12,9 +12,10 @@
#include <limits>
#include "LPInteriorPoint.h"
#include "linear.h"
#include "linsolve.h"
#include <bob.math/linear.h>
#include <bob.core/array_copy.h>
#include <bob.core/assert.h>
#include <bob.core/check.h>
......
......@@ -6,9 +6,9 @@
*/
#include "det.h"
#include "linear.h"
#include "lu.h"
#include <bob.math/linear.h>
#include <bob.core/assert.h>
#include <limits>
......
......@@ -9,7 +9,8 @@
#include <boost/shared_array.hpp>
#include "inv.h"
#include "linear.h"
#include <bob.math/linear.h>
#include <bob.core/assert.h>
#include <bob.core/check.h>
......
......@@ -9,7 +9,8 @@
#include <boost/shared_array.hpp>
#include "linsolve.h"
#include "linear.h"
#include <bob.math/linear.h>
#include <bob.core/assert.h>
#include <bob.core/check.h>
......
......@@ -7,7 +7,8 @@
#include "pinv.h"
#include "svd.h"
#include "linear.h"
#include <bob.math/linear.h>
#include <bob.core/assert.h>
......
......@@ -11,7 +11,8 @@
#include "sqrtm.h"
#include "eig.h"
#include "linear.h"
#include <bob.math/linear.h>
#include <bob.core/assert.h>
......
......@@ -11,7 +11,7 @@
#include "histogram.h"
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include "bob/math/histogram.h"
#include <bob.math/histogram.h>
static PyObject* py_histogram_intersection_1
(PyObject*, PyObject* args, PyObject* kwds) {
......
......@@ -11,10 +11,10 @@
#include "histogram.h"
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include "bob/math/linsolve.h"
#include "cpp/linsolve.h"
static PyObject* py_linsolve_1(PyObject*, PyObject* args, PyObject* kwds) {
/* Parses input arguments in a single shot */
static const char* const_kwlist[] = { "A", "x", "b", 0 /* Sentinel */ };
static char** kwlist = const_cast<char**>(const_kwlist);
......@@ -23,8 +23,8 @@ static PyObject* py_linsolve_1(PyObject*, PyObject* args, PyObject* kwds) {
PyBlitzArrayObject* x = 0;
PyBlitzArrayObject* b = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&", kwlist,
&PyBlitzArray_Converter, &A,
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&", kwlist,
&PyBlitzArray_Converter, &A,
&PyBlitzArray_OutputConverter, &x,
&PyBlitzArray_Converter, &b
)) return 0;
......@@ -91,7 +91,7 @@ static PyObject* py_linsolve_1(PyObject*, PyObject* args, PyObject* kwds) {
}
static PyObject* py_linsolve_2(PyObject*, PyObject* args, PyObject* kwds) {
/* Parses input arguments in a single shot */
static const char* const_kwlist[] = { "A", "b", 0 /* Sentinel */ };
static char** kwlist = const_cast<char**>(const_kwlist);
......@@ -99,8 +99,8 @@ static PyObject* py_linsolve_2(PyObject*, PyObject* args, PyObject* kwds) {
PyBlitzArrayObject* A = 0;
PyBlitzArrayObject* b = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&", kwlist,
&PyBlitzArray_Converter, &A,
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&", kwlist,
&PyBlitzArray_Converter, &A,
&PyBlitzArray_Converter, &b
)) return 0;
......@@ -169,7 +169,7 @@ static PyObject* py_linsolve_2(PyObject*, PyObject* args, PyObject* kwds) {
* Note: Dispatcher function.
*/
PyObject* py_linsolve(PyObject*, PyObject* args, PyObject* kwargs) {
Py_ssize_t nargs = args?PyTuple_Size(args):0 + kwargs?PyDict_Size(kwargs):0;
PyObject* retval = 0;
......@@ -195,7 +195,7 @@ PyObject* py_linsolve(PyObject*, PyObject* args, PyObject* kwargs) {
}
PyObject* py_linsolve_nocheck(PyObject*, PyObject* args, PyObject* kwds) {
/* Parses input arguments in a single shot */
static const char* const_kwlist[] = { "A", "x", "b", 0 /* Sentinel */ };
static char** kwlist = const_cast<char**>(const_kwlist);
......@@ -204,8 +204,8 @@ PyObject* py_linsolve_nocheck(PyObject*, PyObject* args, PyObject* kwds) {
PyBlitzArrayObject* x = 0;
PyBlitzArrayObject* b = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&", kwlist,
&PyBlitzArray_Converter, &A,
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&", kwlist,
&PyBlitzArray_Converter, &A,
&PyBlitzArray_OutputConverter, &x,
&PyBlitzArray_Converter, &b
)) return 0;
......@@ -266,7 +266,7 @@ PyObject* py_linsolve_nocheck(PyObject*, PyObject* args, PyObject* kwds) {
}
static PyObject* py_linsolve_sympos_1(PyObject*, PyObject* args, PyObject* kwds) {
/* Parses input arguments in a single shot */
static const char* const_kwlist[] = { "A", "x", "b", 0 /* Sentinel */ };
static char** kwlist = const_cast<char**>(const_kwlist);
......@@ -275,8 +275,8 @@ static PyObject* py_linsolve_sympos_1(PyObject*, PyObject* args, PyObject* kwds)
PyBlitzArrayObject* x = 0;
PyBlitzArrayObject* b = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&", kwlist,
&PyBlitzArray_Converter, &A,
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&", kwlist,
&PyBlitzArray_Converter, &A,
&PyBlitzArray_OutputConverter, &x,
&PyBlitzArray_Converter, &b
)) return 0;
......@@ -342,7 +342,7 @@ static PyObject* py_linsolve_sympos_1(PyObject*, PyObject* args, PyObject* kwds)
}
static PyObject* py_linsolve_sympos_2(PyObject*, PyObject* args, PyObject* kwds) {
/* Parses input arguments in a single shot */
static const char* const_kwlist[] = { "A", "b", 0 /* Sentinel */ };
static char** kwlist = const_cast<char**>(const_kwlist);
......@@ -350,8 +350,8 @@ static PyObject* py_linsolve_sympos_2(PyObject*, PyObject* args, PyObject* kwds)
PyBlitzArrayObject* A = 0;
PyBlitzArrayObject* b = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&", kwlist,
&PyBlitzArray_Converter, &A,
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&", kwlist,
&PyBlitzArray_Converter, &A,
&PyBlitzArray_Converter, &b
)) return 0;
......@@ -419,7 +419,7 @@ static PyObject* py_linsolve_sympos_2(PyObject*, PyObject* args, PyObject* kwds)
* Note: Dispatcher function.
*/
PyObject* py_linsolve_sympos(PyObject*, PyObject* args, PyObject* kwargs) {
Py_ssize_t nargs = args?PyTuple_Size(args):0 + kwargs?PyDict_Size(kwargs):0;
PyObject* retval = 0;
......@@ -445,7 +445,7 @@ PyObject* py_linsolve_sympos(PyObject*, PyObject* args, PyObject* kwargs) {
}
PyObject* py_linsolve_sympos_nocheck(PyObject*, PyObject* args, PyObject* kwds) {
/* Parses input arguments in a single shot */
static const char* const_kwlist[] = { "A", "x", "b", 0 /* Sentinel */ };
static char** kwlist = const_cast<char**>(const_kwlist);
......@@ -454,8 +454,8 @@ PyObject* py_linsolve_sympos_nocheck(PyObject*, PyObject* args, PyObject* kwds)
PyBlitzArrayObject* x = 0;
PyBlitzArrayObject* b = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&", kwlist,
&PyBlitzArray_Converter, &A,
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&", kwlist,
&PyBlitzArray_Converter, &A,
&PyBlitzArray_OutputConverter, &x,
&PyBlitzArray_Converter, &b
)) return 0;
......@@ -516,10 +516,10 @@ PyObject* py_linsolve_sympos_nocheck(PyObject*, PyObject* args, PyObject* kwds)
}
static PyObject* py_linsolve_cg_sympos_1(PyObject*, PyObject* args, PyObject* kwds) {
/* Parses input arguments in a single shot */
static const char* const_kwlist[] = {
"A", "x", "b", "acc", "max_iter",
static const char* const_kwlist[] = {
"A", "x", "b", "acc", "max_iter",
0 /* Sentinel */ };
static char** kwlist = const_cast<char**>(const_kwlist);
......@@ -529,8 +529,8 @@ static PyObject* py_linsolve_cg_sympos_1(PyObject*, PyObject* args, PyObject* kw
double acc = 0.;
int max_iter = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&di", kwlist,
&PyBlitzArray_Converter, &A,
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&di", kwlist,
&PyBlitzArray_Converter, &A,
&PyBlitzArray_OutputConverter, &x,
&PyBlitzArray_Converter, &b,
&acc, &max_iter
......@@ -590,7 +590,7 @@ static PyObject* py_linsolve_cg_sympos_1(PyObject*, PyObject* args, PyObject* kw
}
static PyObject* py_linsolve_cg_sympos_2(PyObject*, PyObject* args, PyObject* kwds) {
/* Parses input arguments in a single shot */
static const char* const_kwlist[] = { "A", "b", "acc", "max_iter", 0 /* Sentinel */ };
static char** kwlist = const_cast<char**>(const_kwlist);
......@@ -600,8 +600,8 @@ static PyObject* py_linsolve_cg_sympos_2(PyObject*, PyObject* args, PyObject* kw
double acc = 0.;
int max_iter = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&di", kwlist,
&PyBlitzArray_Converter, &A,
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&di", kwlist,
&PyBlitzArray_Converter, &A,
&PyBlitzArray_Converter, &b,
&acc, &max_iter
)) return 0;
......@@ -662,7 +662,7 @@ static PyObject* py_linsolve_cg_sympos_2(PyObject*, PyObject* args, PyObject* kw
* Note: Dispatcher function.
*/
PyObject* py_linsolve_cg_sympos(PyObject*, PyObject* args, PyObject* kwargs) {
Py_ssize_t nargs = args?PyTuple_Size(args):0 + kwargs?PyDict_Size(kwargs):0;
PyObject* retval = 0;
......@@ -688,10 +688,10 @@ PyObject* py_linsolve_cg_sympos(PyObject*, PyObject* args, PyObject* kwargs) {
}
PyObject* py_linsolve_cg_sympos_nocheck(PyObject*, PyObject* args, PyObject* kwds) {
/* Parses input arguments in a single shot */
static const char* const_kwlist[] = {
"A", "x", "b", "acc", "max_iter",
static const char* const_kwlist[] = {
"A", "x", "b", "acc", "max_iter",
0 /* Sentinel */ };
static char** kwlist = const_cast<char**>(const_kwlist);
......@@ -701,8 +701,8 @@ PyObject* py_linsolve_cg_sympos_nocheck(PyObject*, PyObject* args, PyObject* kwd
double acc = 0.;
int max_iter = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&di", kwlist,
&PyBlitzArray_Converter, &A,
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&di", kwlist,
&PyBlitzArray_Converter, &A,
&PyBlitzArray_OutputConverter, &x,
&PyBlitzArray_Converter, &b,
acc, max_iter
......
......@@ -10,9 +10,10 @@
*/
#include "lp_interior_point.h"
#include "cpp/LPInteriorPoint.h"
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob/math/LPInteriorPoint.h>
#include <structmember.h>
#include <bob.extension/documentation.h>
......
/**
* @author Andre Anjos <andre.anjos@idiap.ch>
* @date Mon 9 Dec 13:58:20 2013
* @date Mon 9 Dec 13:58:20 2013
*
* @brief Declaration of LPInteriorPoint & derived classes bindings
*/
......
......@@ -8,7 +8,7 @@
#include "pavx.h"
#include <bob.blitz/cppapi.h>
#include <bob/math/norminv.h>
#include "cpp/norminv.h"
PyObject* py_norminv (PyObject*, PyObject* args, PyObject* kwds) {
......@@ -20,7 +20,7 @@ PyObject* py_norminv (PyObject*, PyObject* args, PyObject* kwds) {
double mu = 0.;
double sigma = 0.;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "ddd", kwlist, &p, &mu, &sigma))
if (!PyArg_ParseTupleAndKeywords(args, kwds, "ddd", kwlist, &p, &mu, &sigma))
return 0;
try {
......
......@@ -7,10 +7,11 @@
*/
#include "pavx.h"
#include "cpp/pavx.h"
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include "bob/math/pavx.h"
#include "bob/core/cast.h"
#include <bob/core/cast.h>
PyObject* py_pavx (PyObject*, PyObject* args, PyObject* kwds) {
......@@ -22,8 +23,8 @@ PyObject* py_pavx (PyObject*, PyObject* args, PyObject* kwds) {
PyBlitzArrayObject* output = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&|O&",
kwlist,
&PyBlitzArray_Converter, &input,
kwlist,
&PyBlitzArray_Converter, &input,
&PyBlitzArray_OutputConverter, &output
)) return 0;
......@@ -82,8 +83,8 @@ PyObject* py_pavx_nocheck (PyObject*, PyObject* args, PyObject* kwds) {
PyBlitzArrayObject* output = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&",
kwlist,
&PyBlitzArray_Converter, &input,
kwlist,
&PyBlitzArray_Converter, &input,
&PyBlitzArray_OutputConverter, &output
)) return 0;
......@@ -182,8 +183,8 @@ PyObject* py_pavx_width_height (PyObject*, PyObject* args, PyObject* kwds) {
PyBlitzArrayObject* output = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&",
kwlist,
&PyBlitzArray_Converter, &input,
kwlist,
&PyBlitzArray_Converter, &input,
&PyBlitzArray_OutputConverter, &output
)) return 0;
......
......@@ -10,7 +10,7 @@
#include "scatter.h"
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob/math/stats.h>
#include <bob.math/stats.h>
PyObject* py_scatter (PyObject*, PyObject* args, PyObject* kwds) {
......@@ -125,7 +125,7 @@ PyObject* py_scatter_nocheck (PyObject*, PyObject* args, PyObject* kwds) {
PyBlitzArrayObject* m = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&",
kwlist,
kwlist,
&PyBlitzArray_Converter, &a,
&PyBlitzArray_OutputConverter, &s,
&PyBlitzArray_OutputConverter, &m
......@@ -184,7 +184,7 @@ PyObject* py_scatter_nocheck (PyObject*, PyObject* args, PyObject* kwds) {
return 0;
}
Py_RETURN_NONE;
Py_RETURN_NONE;
}
......@@ -211,7 +211,7 @@ int BzTuple_Converter(PyObject* o, PyObject** a) {
return 0;
}
if (first->ndim != 2 ||
if (first->ndim != 2 ||
(first->type_num != NPY_FLOAT32 && first->type_num != NPY_FLOAT64)) {
PyErr_SetString(PyExc_TypeError, "input data object must be a sequence or iterable with at least 2 2D arrays with 32 or 64-bit floats - the first array does not conform");
Py_DECREF(first);
......@@ -274,7 +274,7 @@ PyObject* py_scatters (PyObject*, PyObject* args, PyObject* kwds) {
PyBlitzArrayObject* sb = 0;
PyBlitzArrayObject* m = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&|O&O&O&", kwlist,
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&|O&O&O&", kwlist,
&BzTuple_Converter, &data,
&PyBlitzArray_OutputConverter, &sw,
&PyBlitzArray_OutputConverter, &sb,
......@@ -404,7 +404,7 @@ PyObject* py_scatters_nocheck (PyObject*, PyObject* args, PyObject* kwds) {
PyBlitzArrayObject* sb = 0;
PyBlitzArrayObject* m = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&O&", kwlist,
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&O&O&", kwlist,
&BzTuple_Converter, &data,
&PyBlitzArray_OutputConverter, &sw,
&PyBlitzArray_OutputConverter, &sb,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment