Skip to content
Snippets Groups Projects
Commit ce073fac authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MaL] ODE: Remove not required StorageOrder.

Using Eigen::Map<Eigen::Matrix...>> class seems to
work by default with the sundials storage order and
vice versa.
parent 3aff8382
No related branches found
No related tags found
No related merge requests found
...@@ -256,8 +256,7 @@ void CVodeSolverImpl::preSolve() ...@@ -256,8 +256,7 @@ void CVodeSolverImpl::preSolve()
bool successful = bool successful =
static_cast<FunctionHandles*>(function_handles) static_cast<FunctionHandles*>(function_handles)
->callJacobian(t, NV_DATA_S(y), NV_DATA_S(ydot), ->callJacobian(t, NV_DATA_S(y), NV_DATA_S(ydot),
DENSE_COL(jac, 0), DENSE_COL(jac, 0));
MathLib::StorageOrder::ColumnMajor);
return successful ? 0 : 1; return successful ? 0 : 1;
}; };
......
...@@ -46,9 +46,8 @@ struct Handles<N, FunctionArgument> : public MathLib::FunctionHandles ...@@ -46,9 +46,8 @@ struct Handles<N, FunctionArgument> : public MathLib::FunctionHandles
return true; return true;
} }
bool callJacobian(const double t, const double* const y, bool callJacobian(const double t, const double* const y, double* const ydot,
const double* const ydot, double* const jac, double* const jac) override
MathLib::StorageOrder order) override
{ {
if (df) if (df)
return df(t, return df(t,
...@@ -95,9 +94,8 @@ struct Handles<N> : public MathLib::FunctionHandles ...@@ -95,9 +94,8 @@ struct Handles<N> : public MathLib::FunctionHandles
return true; return true;
} }
bool callJacobian(const double t, const double* const y, bool callJacobian(const double t, const double* const y, double* const ydot,
const double* const ydot, double* const jac, double* const jac) override
MathLib::StorageOrder order) override
{ {
if (df) if (df)
return df(t, return df(t,
......
...@@ -14,12 +14,6 @@ ...@@ -14,12 +14,6 @@
namespace MathLib namespace MathLib
{ {
enum class StorageOrder
{
ColumnMajor,
RowMajor
};
template <unsigned N, typename... FunctionArguments> template <unsigned N, typename... FunctionArguments>
using Function = bool (*)(const double t, using Function = bool (*)(const double t,
Eigen::Map<const Eigen::Matrix<double, N, 1>> const y, Eigen::Map<const Eigen::Matrix<double, N, 1>> const y,
...@@ -43,8 +37,7 @@ public: ...@@ -43,8 +37,7 @@ public:
virtual bool callJacobian(const double t, virtual bool callJacobian(const double t,
double const* const y, double const* const y,
double* const ydot, double* const ydot,
double* const jac, double* const jac) = 0;
StorageOrder order) = 0;
virtual bool hasJacobian() const = 0; virtual bool hasJacobian() const = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment