void cBinaryFile::WriteToFileImmediatelyWithLine(const char* val ,bool e_bTimeStamp) { if( !m_pFile ) return; if( e_bTimeStamp ) CreateTimestamp(); int l_iLength = (int)strlen(val); NvFWrite( val, sizeof(char),l_iLength, m_pFile ); NvFWrite( "\n", sizeof(char),1, m_pFile ); Flush(); }
vector<GraphColoring::IdType> GenerateSyncColorings(const Graph& graph) { CreateTimestamp(); vector<GraphColoring::IdType> syncColorings; int n = graph.VerticesCount(); int k = graph.OutDegree(); auto coloring = GraphColoring(n, k); auto syncChecker = SynchronizationChecker(n, k); GraphColoring::IdType id = 0; do { if (syncChecker.IsSynchronizing(graph, coloring)) { syncColorings.push_back(id); } ++id; } while (coloring.NextColoring()); UpdateTimer(SyncColoringsGenerationTime); return syncColorings; }
void cBinaryFile::WriteToFileImmediatelyWithLine(const wchar_t* val,bool e_bTimeStamp) { if( !m_pFile ) return; if( e_bTimeStamp ) CreateTimestamp(); int l_iLength = (int)wcslen(val); if( m_bBigEndian ) { NvFWrite( val, sizeof(wchar_t),l_iLength, m_pFile ); } else { for( int i=0;i<l_iLength;++i ) WriteToFile((int64)val[i]); } if( m_bBigEndian ) NvFWrite( L"\n", sizeof(wchar_t),1, m_pFile ); else WriteToFile(L"\n"); Flush(); }
bool SyncColoringsEnumerator::MoveNext() { CreateTimestamp(); auto result = DoMoveNext(); UpdateTimer(SyncColoringsGenerationTime); return result; }