From 02fee79fc78e4f4ead0e2fdbed2c71b31138ef47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Wed, 30 Jan 2013 16:27:13 +0100 Subject: [PATCH] Add some sanity checks --- mex/sources/estimation/utils/dynamic_dll.hh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mex/sources/estimation/utils/dynamic_dll.hh b/mex/sources/estimation/utils/dynamic_dll.hh index 0afbea74a..2ea77ef3a 100644 --- a/mex/sources/estimation/utils/dynamic_dll.hh +++ b/mex/sources/estimation/utils/dynamic_dll.hh @@ -61,6 +61,15 @@ public: void eval(const Vector &y, const Matrix &x, const VectorView &modParams, VEC &ySteady, Vector &residual, Matrix *g1, Matrix *g2, Matrix *g3) throw (TSException) { + assert(y.getStride() == 1); + assert(x.getLd() == x.getRows()); + assert(modParams.getStride() == 1); + assert(ySteady.getStride() == 1); + assert(residual.getStride() == 1); + assert(g1->getLd() == g1->getRows()); + assert(g2->getLd() == g2->getRows()); + assert(g3->getLd() == g3->getRows()); + Dynamic(y.getData(), x.getData(), 1, modParams.getData(), ySteady.getData(), 0, residual.getData(), g1 == NULL ? NULL : g1->getData(), g2 == NULL ? NULL : g2->getData(), g3 == NULL ? NULL : g3->getData()); };