Example #1
0
int main(int argc, char *argv[])
{
if (argc != 3)
    usage();

checkIds(argv[1], argv[2]);
return 0;
}
Example #2
0
 void updateFactorPotentials(VarData * subVarDataPtr, string const id, unsigned const lineCount, DfgInfo & dfgInfo){
   if ( subVarDataPtr != NULL){
     vector<symbol_t> subVarVec( subVarDataPtr->count() );
     string idSubVar;
     subVarDataPtr->next(idSubVar, subVarVec);
     checkIds(id, idSubVar, lineCount);
     dfgInfo.updateFactors( subVarVec, subVarDataPtr->invMap() );
   }
 }
Example #3
0
 // if facDataPtr not NULL, then read next line of potentials and reset dfg
 void resetFactorPotential(FacData * facDataPtr, string const id, unsigned const lineCount, DFG & dfg)
 {
   if (facDataPtr != NULL) {
     vector<xmatrix_t> facVec( facDataPtr->count() );
     string idFac;
     facDataPtr->next(idFac, facVec);
     checkIds(id, idFac, lineCount);
     dfg.resetFactorPotentials( facVec, facDataPtr->map() );
     dfg.consistencyCheck();
   }
 }
        void run() {
            Client::WriteContext ctx(&_txn, ns());
            setupCollection();

            BSONObj filterObj = fromjson("{a: {$gte: 2}}");
            scoped_ptr<SingleSolutionRunner> ssr(makeCollScanRunner(ctx.ctx(),filterObj));

            BSONObj objOut;
            ASSERT_EQUALS(Runner::RUNNER_ADVANCED, ssr->getNext(&objOut, NULL));
            ASSERT_EQUALS(2, objOut["a"].numberInt());

            forceDocumentMove();

            int ids[] = {3, 4, 2};
            checkIds(ids, ssr.get());
        }
        void run() {
            Client::WriteContext ctx(&_txn, ns());
            setupCollection();
            BSONObj indexSpec = BSON("_id" << 1);
            addIndex(indexSpec);

            BSONObj filterObj = fromjson("{a: {$gte: 2}}");
            scoped_ptr<SingleSolutionRunner> ssr(makeIndexScanRunner(ctx.ctx(), indexSpec, 2, 5));

            BSONObj objOut;
            ASSERT_EQUALS(Runner::RUNNER_ADVANCED, ssr->getNext(&objOut, NULL));
            ASSERT_EQUALS(2, objOut["a"].numberInt());

            forceDocumentMove();

            // Since this time we're scanning the _id index,
            // we should not see the moved document again.
            int ids[] = {3, 4};
            checkIds(ids, ssr.get());
        }