コード例 #1
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 int get_field_number(const char* field_name) const {
   safe_assert(is_struct(),
               "Attempted to access field of a non-struct element.");
   return mxGetFieldNumber(array, field_name);
 }
コード例 #2
0
ファイル: suite.cpp プロジェクト: panglong/concurrit
void Suite::AddScenario(Scenario* scenario) {
	safe_assert(scenario != NULL);
	scenarios_.push_back(scenario);
}
コード例 #3
0
ファイル: executiontracker.cpp プロジェクト: sarahsong7/qwer
int ExecutionTracker::checkSemaphoreValue(sem_t * sem) {
    int a = -1;
    int * semval = &a;
    safe_assert(Originals::sem_getvalue(sem, semval) == OPERATION_SUCCESSFUL);
    return a; 
}
コード例 #4
0
ファイル: dsl.cpp プロジェクト: panglong/concurrit
ExecutionTree* ExecutionTree::get_child(int i) {
	safe_assert(BETWEEN(0, i, int(children_.size())-1));
	return children_[i];
}
コード例 #5
0
	SETUP() {
		safe_assert(counter == NULL);
		counter = new NBCounter();
	}
コード例 #6
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 void set_cell_index2d(const size_t i, const size_t j,
                       matwrap contents) {
   safe_assert(array != NULL, "dereferenced null mxArray");
   mxSetCell(array, i + j*rows(), contents.array);    
 }
コード例 #7
0
ファイル: dsl.cpp プロジェクト: panglong/concurrit
bool ExecutionTree::child_covered(int i /*= 0*/) {
	safe_assert(BETWEEN(0, i, int(children_.size())-1));
	ExecutionTree* c = child(i);
	return c != NULL && c->covered();
}
コード例 #8
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 bool is_struct() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxIsStruct(array);
 }
コード例 #9
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 bool is_double() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetClassID(array) == mxDOUBLE_CLASS;
 }
コード例 #10
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 matwrap get_cell(size_t index) const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   safe_assert(mxGetClassID(array) == mxCELL_CLASS,
               "Attempted to access a cell in a non-cell array.");
   return mxGetCell(array, index);
 }  
コード例 #11
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 bool is_cell() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxIsCell(array);
 }
コード例 #12
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 size_t size() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetNumberOfElements(array);
 }
コード例 #13
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 const char* get_classname() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetClassName(array);
 } // end of is class
コード例 #14
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 bool is_class(const char* classname) const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   safe_assert(classname != NULL, "Invalid classname argument");
   return mxIsClass(array, classname);     
 } // end of is class
コード例 #15
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 double* get_double_array() {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetPr(array);
 }
コード例 #16
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 bool is_uint32() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetClassID(array) == mxUINT32_CLASS;
 }
コード例 #17
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 double& mat_index2d(const size_t i, const size_t j) {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetPr(array)[ i + j*rows()];    
 }
コード例 #18
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 bool is_string() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetClassID(array) == mxCHAR_CLASS;
 }
コード例 #19
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 matwrap get_cell_index2d(const size_t i, const size_t j) {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetCell(array, i + j*rows());
 }
コード例 #20
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 void as_string(char* str_buffer, size_t buffer_len) {
   safe_assert(str_buffer != NULL, "NULL string buffer");
   int error = mxGetString(array, str_buffer, buffer_len);
   safe_assert(!error, "Error processing string!");
 }
コード例 #21
0
ファイル: dsl.cpp プロジェクト: panglong/concurrit
void ExecutionTree::set_child(ExecutionTree* node, int i) {
	safe_assert(BETWEEN(0, i, int(children_.size())-1));
	children_[i] = node;
}
コード例 #22
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 const mwSize* get_dimensions() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetDimensions(array);
 }
コード例 #23
0
ファイル: stricttracker.cpp プロジェクト: sarahsong7/qwer
thrID StrictTracker::pickNextSchedulingChoice(SchedPointInfo * s) {
    deadlockCheck();
    bool didNotGoPastEndOfReplayLog = false;
    safe_assert(didNotGoPastEndOfReplayLog);
    return INVALID_THREAD;
}
コード例 #24
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 size_t cols() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetN(array);
 }
コード例 #25
0
bool RandomActiveTester::reenableThreadIfLegal(thrID thr) {
    safe_assert(active_testing_paused[thr]);
    active_testing_paused[thr] = false;
    disableThread(thr);
    return false;
}
コード例 #26
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
  const mwSize get_num_dimensions() const {
    safe_assert(array != NULL, "dereferenced null mxArray");
    return mxGetNumberOfDimensions(array);

  }
コード例 #27
0
ファイル: executiontracker.cpp プロジェクト: sarahsong7/qwer
void ExecutionTracker::gunlock() {
    safe_assert(Originals::pthread_mutex_trylock(global_lock) != 
            OPERATION_SUCCESSFUL);
    lock_count--;
    Originals::pthread_mutex_unlock(global_lock);
}
コード例 #28
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 template<typename T>  T* get_data() {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return reinterpret_cast<T*>(mxGetData(array));
 }
コード例 #29
0
ファイル: executiontracker.cpp プロジェクト: sarahsong7/qwer
//TODO: locks or no?
void ExecutionTracker::waitWakeThread(thrID target) {
    log->waitWakeThread(target);
    sem_t * pause = wait_sem_map[target];
    safe_assert(pause != NULL);
    safe_assert(Originals::sem_post(pause) == OPERATION_SUCCESSFUL);
}
コード例 #30
0
ファイル: matwrap.hpp プロジェクト: Alienfeel/graphlab
 matwrap get_field(const int field_id) const {
   safe_assert(is_struct(),
               "Attempted to access field of a non-struct element.");
   safe_assert(field_id < get_number_of_fields(), "Invalid field id!");
   return mxGetFieldByNumber(array,0,field_id);
 }