TEST_F(TestInitTransData, should_return_to_INIT_after_updating_then_reverting) { data.update(Object(2)); data.revert(); assertInit(); }
bool SXFunctionInternal::isSmooth() const { assertInit(); // Go through all nodes and check if any node is non-smooth for (vector<AlgEl>::const_iterator it = algorithm_.begin(); it!=algorithm_.end(); ++it) { if (!operation_checker<SmoothChecker>(it->op)) { return false; } } return true; }
vector<vector<MX> > Function::callParallel(const vector<vector<MX> > &x, const Dictionary& paropt) { assertInit(); // Make sure not empty casadi_assert_message(x.size()>1, "Function: callParallel(vector<vector<MX> >): " "argument must be of length > 1. You supplied length " << x.size() << "."); // Return object vector<vector<MX> > ret(x.size()); // Check if we are bypassing the parallelizer Dictionary::const_iterator ii=paropt.find("parallelization"); if (ii!=paropt.end() && ii->second=="expand") { for (int i=0; i<x.size(); ++i) { ret[i] = call(x[i]); } return ret; } // Create parallelizer object and initialize it Parallelizer p(vector<Function>(x.size(), *this)); p.setOption(paropt); p.init(); // Concatenate the arguments vector<MX> p_in; p_in.reserve(x.size() * getNumInputs()); for (int i=0; i<x.size(); ++i) { p_in.insert(p_in.end(), x[i].begin(), x[i].end()); p_in.resize(p_in.size()+getNumInputs()-x[i].size()); } // Call the parallelizer vector<MX> p_out = p.call(p_in); casadi_assert(p_out.size() == x.size() * getNumOutputs()); // Collect the outputs vector<MX>::const_iterator it=p_out.begin(); for (int i=0; i<x.size(); ++i) { ret[i].insert(ret[i].end(), it, it+getNumOutputs()); it += getNumOutputs(); } return ret; }
TEST_F(TestTouchTransData, should_in_RELEASED_state_after_releasing) { data.release(); ASSERT_FALSE(data.isStable()); ASSERT_FALSE(data.isPresent()); ASSERT_TRUE(data.isOldPresent()); ASSERT_EQ(2, data.getOldValue().getValue()); ASSERT_TRUE(data.isChanged()); ASSERT_FALSE(data.isChanged(true)); ASSERT_EQ(1, alloc_blocks); data.confirm(); assertInit(); }
Function Function::tangent(int iind, int oind) { assertInit(); return (*this)->tangent(iind, oind); }
Function Function::hessian(int iind, int oind) { assertInit(); return (*this)->hessian(iind, oind); }
Function Function::jacobian(int iind, int oind, bool compact, bool symmetric) { assertInit(); return (*this)->jacobian(iind, oind, compact, symmetric); }
Function Function::gradient(int iind, int oind) { assertInit(); return (*this)->gradient(iind, oind); }
MX LinearSolver::solve(const MX& A, const MX& B, bool transpose) { assertInit(); return (*this)->solve(A, B, transpose); }
FX FX::fullJacobian(){ assertInit(); return (*this)->fullJacobian(); }
TEST_F(TestInitTransData, the_state_should_be_correct_for_an_uninitialized_trans_data) { assertInit(); }
void LinearSolver::solve(double* x, int nrhs, bool transpose) { assertInit(); (*this)->solve(x, nrhs, transpose); }
Function Function::fullJacobian() { assertInit(); return (*this)->fullJacobian(); }
TEST_F(TestActiveTransData, after_reset_should_return_to_idle) { data.reset(); assertInit(); }
TEST_F(TestInitTransData, should_not_allow_to_modify) { ASSERT_NE(CCINFRA_SUCCESS, data.modify()); assertInit(); }
TEST_F(TestInitTransData, reset_should_have_no_effect) { data.reset(); assertInit(); }
TEST_F(TestInitTransData, touch_should_have_no_effect) { data.touch(); assertInit(); }
TEST_F(TestTouchTransData, should_in_IDLE_state_after_reset) { data.reset(); assertInit(); }
TEST_F(TestReleaseTransData, should_in_IDLE_state_after_reseting) { data.reset(); assertInit(); }
void LinearSolver::prepare() { assertInit(); (*this)->prepare(); }
TEST_F(TestReleaseTransData, should_in_IDLE_state_after_confirming) { data.confirm(); assertInit(); }
void LinearSolver::solve(bool transpose) { assertInit(); (*this)->solve(transpose); }
void Function::evaluate() { assertInit(); (*this)->evaluate(); }
bool LinearSolver::prepared() const { assertInit(); return (*this)->prepared_; }
void FX::evaluateCompressed(int nfdir, int nadir){ assertInit(); casadi_assert(nfdir<=(*this)->nfdir_); casadi_assert(nadir<=(*this)->nadir_); (*this)->evaluateCompressed(nfdir,nadir); }