本文整理汇总了C++中WorkSpace类的典型用法代码示例。如果您正苦于以下问题:C++ WorkSpace类的具体用法?C++ WorkSpace怎么用?C++ WorkSpace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WorkSpace类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ShowMessage
void __fastcall TDesignFrm::btAddSubHeadClick(TObject *Sender)
{
String key = vleHeadDef->Keys[vleHeadDef->Row];
if(key == "")
{
ShowMessage("请先选择封包头!");
return;
}
String fileName;
if(InputQuery("输入文件名(不加后缀)", "输入文件名(不加后缀)", fileName))
{
if(fileName == "")
return;
if(fileName.Pos("."))
fileName = LeftString(fileName, ".");
fileName += ".eggxp";
WorkSpace * selWorkSpace = m_WorkSpaceManager->CreateNewWorkSpace();
selWorkSpace->InitWorkSpace(m_WorkSpaceManager->GetFilePath(),
fileName, key);
selWorkSpace->SaveToFile();
m_WorkSpaceManager->ReloadWorkSpacePack();
WorkspaceToGUI();
}
}
开发者ID:eggxp,项目名称:SuperParse,代码行数:27,代码来源:FrmDesign.cpp
示例2: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
WorkSpace w;
w.show();
return a.exec();
}
开发者ID:Sunwinds,项目名称:SketchBasedShapeRetrieval,代码行数:7,代码来源:main.cpp
示例3: IntToHex
void __fastcall TDesignFrm::btClearHeadDefClick(TObject *Sender)
{
int result = Application->MessageBox(L"这个清空动作会清空所有文件! 是否继续?",L"删除询问",MB_OKCANCEL);
if(result == IDCANCEL)
{
return;
}
m_WorkSpaceManager->BeginUpdate();
for(int i=m_WorkSpaceManager->GetWorkSpaceCount()-1; i>=0; i--)
{
m_WorkSpaceManager->DeleteWorkSpace(i);
}
//添加一条新数据
String head = IntToHex(0, 2);
String subHead = IntToHex(0, 2);
String fileName = FormatStr("Pack_%s_%s.eggxp", head, subHead);
WorkSpace * selWorkSpace = m_WorkSpaceManager->CreateNewWorkSpace();
selWorkSpace->InitWorkSpace(m_WorkSpaceManager->GetFilePath(),
fileName, head);
selWorkSpace->GetFileManager()->CreateNew();
selWorkSpace->SaveToFile();
m_WorkSpaceManager->ReloadWorkSpacePack();
WorkspaceToGUI();
m_WorkSpaceManager->EndUpdate();
}
开发者ID:eggxp,项目名称:SuperParse,代码行数:31,代码来源:FrmDesign.cpp
示例4: Test_TorsionalMinimisation
void Test_TorsionalMinimisation()
{
FFParamSet ffps;
ffps.readLib("lib/amber03aa.ff");
//System sys(ffps);
//sys.add(NewProteinHelix(ffps,"*A-(AAAAPAAAA)-A*" ));
PDB_In sys(ffps,"./pd_double/test.pdb");
sys.load();
WorkSpace wspace = WorkSpace( sys );
RotBond replacement; // Must stay in scope for the lifetime of this wspace...
wspace.setRotatableBondList( &replacement ); // Override the internal dummy rotbond array
wspace.info();
wspace.addStdTra("imported464");
wspace.outtra.append();
Forcefield ffs = createffts(wspace);
SegmentDefBase sd(wspace,37,44,SegBreakCentre);
TorsionalMinimisation min2( ffs, sd );
min2.Steps = 3000;
min2.InitialCapFactor = 0.05;
min2.UpdateScr = 1;
min2.UpdateTra = 1;
min2.UpdateMon = -1;
min2.run();
return;
}
开发者ID:JonnyWideFoot,项目名称:pd,代码行数:32,代码来源:scratch.jon.cpp
示例5: configure
void Window::configure( Configuration* c ){
WorkSpace::create();
//ユーザー設定
WorkSpace w;
WorkSpace::Configuration wsCon;
w.configure( &wsCon );
c->setWidth( w.width() );
c->setHeight( w.height() );
c->setTitle( w.title() );
}
开发者ID:Marypaz,项目名称:Yoserusu,代码行数:10,代码来源:WorkSpace.cpp
示例6: canUndo
boolean UndoDecoratorMove::canUndo()
{
VPEAnnotator* dec = this->lookupDecorator();
if (!dec) return FALSE;
int w,h;
dec->getXYSize(&w,&h);
WorkSpace* ews = dec->getWorkSpace();
return (ews->isEmpty(this->x, this->y, w, h));
}
开发者ID:BackupTheBerlios,项目名称:opendx2,代码行数:10,代码来源:UndoMove.C
示例7: main
int main(int argc, char **argv) {
Manager manager;
PropList props;
CACHE_CONFIG_PATH(props) = "icache.xml";
try {
WorkSpace *fw = manager.load(argv[1], props);
// Find main CFG
CFG *cfg = fw->getCFGInfo()->findCFG("main");
if(cfg == 0) {
cerr << "ERROR: cannot find main !\n";
return 1;
}
// Removing __eabi call if available
for(CFG::BBIterator bb(cfg); bb; bb++)
for(Iterator<Edge *> edge(bb->outEdges()); edge; edge++)
if(edge->kind() == Edge::CALL
&& edge->target()
&& edge->calledCFG()->label() == "__eabi") {
delete(*edge);
break;
}
// Processors configuration
//PROC_VERBOSE(props) = true;
//EXPLICIT(props) = true;
// Get external constraints
ipet::FlowFactLoader ffl;
ffl.process(fw, props);
// Build CAT contraint
CATConstraintBuilder decomp;
decomp.process(fw, props);
// Resolve the system
WCETComputation wcomp;
wcomp.process(fw, props);
// Display the result
//ilp::System *sys = SYSTEM(fw);
/*sys->dump();
cout << sys->countVars() << " variables and "
<< sys->countConstraints() << " constraints.\n";*/
cout << "WCET = " << WCET(fw) << '\n';
}
catch(LoadException e) {
cerr << "ERROR: " << e.message() << '\n';
exit(1);
}
return 0;
}
开发者ID:alexjordan,项目名称:otawa,代码行数:54,代码来源:test-categorisation.cpp
示例8: main
int main(int argc, char **argv)
{
WorkSpace *work = NULL;
get_args(argc, argv);
srand (getpid());
work = new WorkSpace();
work->LoadMotionDB (script_file);
work->ExecLearning ();
delete work;
return 0;
}
开发者ID:raghavendrajain,项目名称:mimesis,代码行数:16,代码来源:learning.cpp
示例9: main
int main(int argc, char **argv) {
Manager manager;
PropList props;
// LOADER(props) = &Loader::LOADER_Gliss_PowerPC;
try {
WorkSpace *fw = manager.load(argv[1], props);
// Find main CFG
cout << "Looking for the main CFG\n";
CFG *cfg = fw->getCFGInfo()->findCFG("main");
if(cfg == 0) {
cerr << "ERROR: cannot find main !\n";
return 1;
}
else
cout << "main found at 0x" << cfg->address() << '\n';
// Build dominance
Dominance dom;
dom.processCFG(fw, cfg);
// Display dominance information
for(CFG::BBIterator bb1(cfg); bb1; bb1++) {
bool first = true;
cout << bb1->number() << " dominates {";
for(CFG::BBIterator bb2(cfg); bb2; bb2++)
if(Dominance::dominates(bb1, bb2)) {
if(first)
first = false;
else
cout << ", ";
cout << bb2->number();
}
cout << "}\n";
}
// Display the result
cout << "SUCCESS\n";
}
catch(LoadException e) {
cerr << "ERROR: " << e.message() << '\n';
exit(1);
}
return 0;
}
开发者ID:alexjordan,项目名称:otawa,代码行数:46,代码来源:test_dom.cpp
示例10: catch
void Window::update(){
Window w;
Graphics::Manager m;
WorkSpace ws;
bool sleep = false;
if( w.isMinimized() ){
sleep = true;
}
//終了チェック
if( isEndRequested() ){
ws.requestEnd();
}
if( !sleep ){
ws.preUpdate();
}
if( sleep ){
ws.sleep( 50 );
} else {
try{
ws.update();
}
catch( ... ){
WorkSpace::destroy();
end();
throw Mashiro::EXCEPTION_EXIT;
}
ws.postUpdate();
}
if( ws.isEndRequested() ){
WorkSpace::destroy();
end();
}
}
开发者ID:Marypaz,项目名称:Yoserusu,代码行数:33,代码来源:WorkSpace.cpp
示例11: WorkSpace
void AutoRunThread::run()
{
string lasFilePath, resFolder;
WorkSpace *workSpace = NULL;
lasFilePath = this->lasPath.toStdString();
resFolder = this->resFolder.toStdString();
workSpace = new WorkSpace();
workSpace->newProj(lasFilePath.c_str(), this->cellSize, resFolder.c_str());
resFolder = workSpace->getResFolder();
// Seed generation
if(this->useOBASeedGenerator && this->maxObjSize >= 20.0)
{
emit stepInformation(0, tr("start identifying complexity of the scene ..."));
::calcComplexByObj(workSpace, this->maxObjSize, this->seedHeightTh, this->seedSlopeTh);
emit stepInformation(20, tr("identifying complexity of the scene finished ..."));
}
// Filtering
emit stepInformation(20, tr("start filter points ..."));
TINFilter *filter = new TINFilter(workSpace, maxObjSize, this->seedCellSize, this->angleIteration, this->hIteration);
filter->filterGround(this->filteringHeightTh, this->filteringSlopeTh);
emit stepInformation(70, tr("filtering points finished ..."));
// Dem interpolation
emit stepInformation(70, tr("start dem interpolation ..."));
las2Raster(workSpace, this->dtmFactor);
emit stepInformation(90, tr("dem interpolation finished..."));
// Object points extraction
emit stepInformation(90, tr("start get non-groud points ..."));
extractObjectPoints(workSpace, this->dtmFactor, this->objectHT);
emit stepInformation(100, tr("process finished successfully!"));
if (workSpace != NULL)
{
delete workSpace;
workSpace = NULL;
}
}
开发者ID:yanmenglong,项目名称:ALSDo,代码行数:41,代码来源:autorunthread.cpp
示例12: generate_with_symbol_space
int generate_with_symbol_space(void)
{
Behavior *tmp_beh, *beh;
WorkSpace *work = NULL;
work = new WorkSpace();
tl_message ("Now loading motionDBs...");
work->Load ("../../script/learning_scriptfile_3");
tl_message ("Now loading recogunits...");
work->SetRecogUnits ("../../script/learning_scriptfile_3");
work->SetLabelFromRecogUnit();
work->BeforeRecognize();
work->SetDisVector();
work->SymmentrizeDisVector();
work->SpaceCreate(3);
vector<double> tmp_dis;
vector<double> tmp_cord;
int span = 20, step = 5;
Pose *pose;
cur_beh = new Behavior();
for (int i=0; i<span; i++)
{
data = TOYOTA_GetMotionCaptureData();
joint_angle = TOYOTA_TransferCaptureToJoint(data);
pose = new Pose(dof, joint_angle); // dof = number of DoF, joint_angle : sequence of double
cur_beh->AddPose(pose);
}
for (int j=0; j<1000; j++)
{
cerr << "---------------- pop" << endl;
for (int i=0; i<step; i++)
{
cur_beh->PopFrontPose();
data = TOYOTA_GetMotionCaptureData();
joint_angle = TOYOTA_TransferCaptureToJoint(data);
pose = new Pose(dof, joint_angle); // dof = number of DoF, joint_angle : sequence of double
cur_beh->AddPose(pose);
}
cerr << "---------------- CalcDis" << endl;
// その一部分の動作を空間に射影した場合の,各既知原始シンボルからの距離を計測
tmp_dis = work->CalcDistanceOfInputBehavior(cur_beh);
cerr << "---------------- GetCoordinate" << endl;
// 求めた距離に応じて,空間に射影するべき座標を算出
tmp_cord = work->GetPsymbolSpace()->CoordinateFromDistanceData(tmp_dis);
cerr << "!!!!! " << j << "th Gene Start!" << endl;
// その座標における動作を生成する.
work->BehGeneFromTransition(tmp_cord);
cerr << "!!!!! " << j << "th Gene Finish!" << endl;
tmp_beh = work->GetLastBehavior ();
for (int i=0; i<step; i++)
{
TOYOTA_ActuateRobot (tmp_beh->NthPose(i));
}
}
return TRUE;
}
开发者ID:t-inamura,项目名称:mimesis,代码行数:58,代码来源:imitation.cpp
示例13: Char
static MRESULT APIENTRY Char ( HWND Window, MESG, MPARAM1 mp1, MPARAM2 mp2 ) {
/***************************************************************************
* Find the instance data. *
***************************************************************************/
PDATA Data = PDATA ( Sys_GetWindowData ( Window ) ) ;
/***************************************************************************
* Get the message data. *
***************************************************************************/
USHORT Flags = (USHORT) SHORT1FROMMP ( mp1 ) ;
//UCHAR Repeat = (UCHAR) CHAR3FROMMP ( mp1 ) ;
//UCHAR ScanCode = (UCHAR) CHAR4FROMMP ( mp1 ) ;
//USHORT Char = (USHORT) SHORT1FROMMP ( mp2 ) ;
USHORT VKey = (USHORT) SHORT2FROMMP ( mp2 ) ;
/***************************************************************************
* Ignore keys being released, invalid characters, dead keys and *
* invalid composite characters. *
***************************************************************************/
if ( ( Flags & KC_KEYUP )
OR ( Flags & KC_INVALIDCHAR )
OR ( Flags & KC_DEADKEY )
OR ( Flags & KC_INVALIDCOMP ) )
{
Sys_BeepNote ( ) ;
return ( MRFROMSHORT ( FALSE ) ) ;
}
/***************************************************************************
* Intercept the ESC virtual key to abort margin set mode. *
***************************************************************************/
if ( Flags & KC_VIRTUALKEY ) {
switch ( VKey ) {
case VK_ESC: {
if ( Data->Capture ) {
Data->Capture = FALSE ;
Sys_ReleaseCapture ( ) ;
HPOINTER Ptr = WinQuerySysPointer ( HWND_DESKTOP, SPTR_ARROW, FALSE ) ;
WinSetPointer ( HWND_DESKTOP, Ptr ) ;
Sys_SetFocus ( Data->HadFocus ) ;
WorkSpace PS ( "HRuler::Char", 0, Window, Data->pDevice, int(Data->Metric) ) ;
PS.SetTransform ( Data->fxZoom, int(Data->TopLeft), 0 ) ;
RECTL Rectangle ;
WinQueryWindowRect ( Window, &Rectangle ) ;
PS.Transform ( CVTC_DEVICE, CVTC_DEFAULTPAGE, Rectangle ) ;
POINTL ButtonSize = { 8, 8 } ;
PS.Transform ( CVTC_DEVICE, CVTC_PAGE, 1, &ButtonSize ) ;
PS.SetMix ( FM_INVERT ) ;
PS.SetLineType ( LINETYPE_ALTERNATE ) ;
POINTL Point = { Data->Tick, Rectangle.yBottom } ;
PS.Move ( Point ) ;
Point.y = Rectangle.yTop ;
PS.DrawLine ( Point ) ;
Data->Mode = NOTMOVING ;
}
break ;
}
}
}
/***************************************************************************
* Return. *
***************************************************************************/
return ( MRFROMSHORT ( TRUE ) ) ;
}
开发者ID:OS2World,项目名称:APP-PRODUCTIVITY-Escriba,代码行数:84,代码来源:HRULER.CPP
示例14: Button1Up
static MRESULT APIENTRY Button1Up ( HWND Window, MESG, MPARAM1 mp1, MPARAM2 ) {
/***************************************************************************
* Find the instance data. *
***************************************************************************/
PDATA Data = PDATA ( Sys_GetWindowData ( Window ) ) ;
/***************************************************************************
* If the mouse wasn't captured, return. *
***************************************************************************/
if ( NOT Data->Capture )
return ( MRFROMSHORT ( FALSE ) ) ;
/***************************************************************************
* Get the presentation space. *
***************************************************************************/
WorkSpace PS ( "HRuler::Button1Up", 0, Window, Data->pDevice, int(Data->Metric) ) ;
PS.SetTransform ( Data->fxZoom, int(Data->TopLeft), 0 ) ;
/***************************************************************************
* Find out where the mouse touched. *
***************************************************************************/
RECTL Rectangle ;
WinQueryWindowRect ( Window, &Rectangle ) ;
POINTL Mouse = { SHORT1FROMMP(mp1), SHORT2FROMMP(mp1) } ;
PS.Transform ( CVTC_DEVICE, CVTC_DEFAULTPAGE, 1, &Mouse ) ;
PS.Transform ( CVTC_DEVICE, CVTC_DEFAULTPAGE, Rectangle ) ;
POINTL ButtonSize = { 8, 8 } ;
PS.Transform ( CVTC_DEVICE, CVTC_PAGE, 1, &ButtonSize ) ;
#ifdef DEBUG
Log ( "HRuler::Button1Up: Mouse at %i,%i (%i,%i). Rectangle %i,%i-%i,%i. ButtonSize %i.%i (8x8).",
Mouse.x, Mouse.y, SHORT1FROMMP(mp1), SHORT2FROMMP(mp1),
Rectangle.xLeft, Rectangle.yBottom, Rectangle.xRight, Rectangle.yTop,
ButtonSize.x, ButtonSize.y ) ;
#endif
/***************************************************************************
* Erase the previous hairline. *
***************************************************************************/
PS.SetMix ( FM_INVERT ) ;
PS.SetLineType ( LINETYPE_ALTERNATE ) ;
POINTL Point = { Data->Tick, Rectangle.yBottom } ;
PS.Move ( Point ) ;
Point.y = Rectangle.yTop ;
PS.DrawLine ( Point ) ;
/***************************************************************************
* Release the mouse. *
***************************************************************************/
Data->Capture = FALSE ;
Sys_ReleaseCapture ( ) ;
/***************************************************************************
* Restore the normal mouse pointer. *
***************************************************************************/
HPOINTER Ptr = WinQuerySysPointer ( HWND_DESKTOP, SPTR_ARROW, FALSE ) ;
WinSetPointer ( HWND_DESKTOP, Ptr ) ;
/***************************************************************************
* Restore the keyboard focus. *
***************************************************************************/
Sys_SetFocus ( Data->HadFocus ) ;
/***************************************************************************
* Process final location of mouse. *
***************************************************************************/
switch ( Data->Mode ) {
case MOVELEFT:
{
Data->Tick = TICK(Mouse.x) ;
if ( ( Data->Tick < 0 ) OR ( Data->Tick >= Data->RightMargin ) )
{
Sys_BeepError ( ) ;
break ;
}
Sys_SendMessage ( OWNER(Window), WM_SET_LEFTMARGIN, MPFROMLONG(Data->Tick), 0 ) ;
break ;
}
case MOVERIGHT:
{
Data->Tick = TICK(Mouse.x) ;
if ( ( Data->Tick <= Data->LeftMargin ) OR ( Data->Tick > Data->PageWidth ) )
{
Sys_BeepError ( ) ;
break ;
//.........这里部分代码省略.........
开发者ID:OS2World,项目名称:APP-PRODUCTIVITY-Escriba,代码行数:101,代码来源:HRULER.CPP
示例15: MouseMove
static MRESULT APIENTRY MouseMove ( HWND Window, MESG msg, MPARAM1 mp1, MPARAM2 mp2 ) {
/***************************************************************************
* Find the instance data. *
***************************************************************************/
PDATA Data = PDATA ( Sys_GetWindowData ( Window ) ) ;
/***************************************************************************
* If the mouse wasn't captured, return. *
***************************************************************************/
if ( NOT Data->Capture )
return ( Sys_DefWindowProc ( Window, msg, mp1, mp2 ) ) ;
/***************************************************************************
* Get the presentation space. *
***************************************************************************/
WorkSpace PS ( "HRuler::MouseMove", 0, Window, Data->pDevice, int(Data->Metric) ) ;
PS.SetTransform ( Data->fxZoom, int(Data->TopLeft), 0 ) ;
/***************************************************************************
* Find out where the mouse touched. *
***************************************************************************/
RECTL Rectangle ;
WinQueryWindowRect ( Window, &Rectangle ) ;
POINTL Mouse = { SHORT1FROMMP(mp1), SHORT2FROMMP(mp1) } ;
PS.Transform ( CVTC_DEVICE, CVTC_DEFAULTPAGE, 1, &Mouse ) ;
PS.Transform ( CVTC_DEVICE, CVTC_DEFAULTPAGE, Rectangle ) ;
POINTL ButtonSize = { 8, 8 } ;
PS.Transform ( CVTC_DEVICE, CVTC_PAGE, 1, &ButtonSize ) ;
#ifdef DEBUG
Log ( "HRuler::MouseMove: Mouse at %i,%i (%i,%i). Rectangle %i,%i-%i,%i. ButtonSize %i.%i (8x8).",
Mouse.x, Mouse.y, SHORT1FROMMP(mp1), SHORT2FROMMP(mp1),
Rectangle.xLeft, Rectangle.yBottom, Rectangle.xRight, Rectangle.yTop,
ButtonSize.x, ButtonSize.y ) ;
#endif
/***************************************************************************
* Erase the previous hairline. *
***************************************************************************/
PS.SetMix ( FM_INVERT ) ;
PS.SetLineType ( LINETYPE_ALTERNATE ) ;
POINTL Point = { Data->Tick, Rectangle.yBottom } ;
PS.Move ( Point ) ;
Point.y = Rectangle.yTop ;
PS.DrawLine ( Point ) ;
/***************************************************************************
* Save the current hairline position. *
***************************************************************************/
Data->Tick = TICK(Mouse.x) ;
/***************************************************************************
* Draw a hairline showing the current position. *
***************************************************************************/
Point.x = Data->Tick ;
Point.y = Rectangle.yBottom ;
PS.Move ( Point ) ;
Point.y = Rectangle.yTop ;
PS.DrawLine ( Point ) ;
/***************************************************************************
* We're done. *
***************************************************************************/
return ( MRFROMSHORT ( TRUE ) ) ;
}
开发者ID:OS2World,项目名称:APP-PRODUCTIVITY-Escriba,代码行数:78,代码来源:HRULER.CPP
示例16: setTo
void Pops::setTo( const WorkSpace& _WSpace, PopsMode _Mode )
{
m_WSpace = &_WSpace;
m_Mode = _Mode;
m_AtomIndexes.clear();
m_Atoms.clear();
switch( m_Mode )
{
case AllAtom:
{
m_CurrentDat = &m_Atomic;
if( m_Atomic.atoms.size() == 0 )
{
throw ProcedureException("POPS: No data has yet been loaded for AllAtom mode.");
}
for( size_t i = 0; i < _WSpace.nAtoms(); i++ )
{
if( _WSpace.atom[i].isHydrogen() )
{
m_AtomIndexes.push_back(SIZE_T_FAIL);
continue;
}
else
{
m_AtomIndexes.push_back(m_Atoms.size());
}
bool found = false;
for( size_t j = 0; j < m_Atomic.atoms.size(); j++ )
{
if( 0 == m_Atomic.atoms[j].atomName.compare( _WSpace.atom[i].pdbname ) &&
0 == m_Atomic.atoms[j].resName.compare( _WSpace.atom[i].parentl3name ) )
{
m_Atoms.push_back( PopsAtom( m_Atomic.atoms[j], i, &_WSpace.atomxyz(i)) );
found = true;
break;
}
}
if( !found )
{
for( size_t j = 0; j < m_Atomic.atoms.size(); j++ )
{
if( 0 == m_Atomic.atoms[j].resName.compare( "*" ) &&
0 == m_Atomic.atoms[j].atomName.compare( _WSpace.atom[i].pdbname ) )
{
m_Atoms.push_back( PopsAtom( m_Atomic.atoms[j], i, &_WSpace.atomxyz(i)) );
found = true;
break;
}
}
}
if( !found )
{
StringBuilder sb;
sb.setFormat("POPS: Cannot find atom type %s %s in the database.\n")
(_WSpace.atom[i].pdbname)
(_WSpace.atom[i].parentl3name);
throw ProcedureException(sb.toString());
}
}
break;
}
case Coarse:
{
m_CurrentDat = &m_Coarse;
if( m_Coarse.atoms.size() == 0 )
{
throw ProcedureException("POPS: No data has yet been loaded for AllAtom mode.");
}
for( size_t i = 0; i < _WSpace.nAtoms(); i++ )
{
if( !_WSpace.atom[i].isCAlpha() )
{
m_AtomIndexes.push_back(SIZE_T_FAIL);
continue;
}
else
{
m_AtomIndexes.push_back(m_Atoms.size());
}
bool found = false;
for( size_t j = 0; j < m_Coarse.atoms.size(); j++ )
{
if( 0 == m_Coarse.atoms[j].atomName.compare( _WSpace.atom[i].pdbname ) &&
0 == m_Coarse.atoms[j].resName.compare( _WSpace.atom[i].parentl3name ) )
{
m_Atoms.push_back( PopsAtom( m_Coarse.atoms[j], i, &_WSpace.atomxyz(i)) );
found = true;
break;
}
}
if( !found )
{
for( size_t j = 0; j < m_Coarse.atoms.size(); j++ )
{
if( 0 == m_Coarse.atoms[j].resName.compare( "*" ) &&
0 == m_Coarse.atoms[j].atomName.compare( _WSpace.atom[i].pdbname ) )
//.........这里部分代码省略.........
开发者ID:JonnyWideFoot,项目名称:pd,代码行数:101,代码来源:pops.cpp
示例17: main
int main(int argc, char **argv)
{
srand (getpid());
Common_SetDebug (TRUE);
get_args(argc, argv);
JHMM *synthesis_hmm = NULL, *hmm[10];
Behavior *beh = NULL;
tl_message ("Loading hmm factor for synthesis");
hmm[0] = new JHMM;
hmm[1] = new JHMM;
hmm[2] = new JHMM;
hmm[0]->Load("./.tmp/squat/squat.hmm");
hmm[1]->Load("./.tmp/kick/kick.hmm");
hmm[2]->Load("./.tmp/punch/punch.hmm");
WorkSpace *work = NULL;
work = new WorkSpace();
work->LoadMotionDB ("../../script/learning_scriptfile_2");
//work->LoadHTKUnits ("../../script/htkunit_scriptfile_2");
work->SetHTKUnitsFromMotionDB ();
work->SetLabelFromHTKUnit();
work->BeforeRecognize();
//work->DisVectorLoad("../../script/symbol_data/tmp_distance_vector");
work->SpaceLoad ("../../script/symbol_data/tmp_dim.spc");
cerr << "num of htk_units = " << work->NumOfHTKUnits() << endl;
#if 0
work->CalcKLDivergenceMatrix();
work->SpaceFileOut ("./tmp_space_output.txt");
tl_message ("KL distance from 0 to 1 (by new algo.) = %g", work->GetNthHTKUnit(0)->CalcKLDistance ( work->GetNthHTKUnit(1) ) );
tl_message ("KL distance from 1 to 0 (by new algo.) = %g", work->GetNthHTKUnit(1)->CalcKLDistance ( work->GetNthHTKUnit(0) ) );
tl_message ("KL distance from 0 to 2 (by new algo.) = %g", work->GetNthHTKUnit(0)->CalcKLDistance ( work->GetNthHTKUnit(2) ) );
tl_message ("KL distance from 2 to 0 (by new algo.) = %g", work->GetNthHTKUnit(2)->CalcKLDistance ( work->GetNthHTKUnit(0) ) );
tl_message ("KL distance from 1 to 2 (by new algo.) = %g", work->GetNthHTKUnit(1)->CalcKLDistance ( work->GetNthHTKUnit(2) ) );
tl_message ("KL distance from 2 to 1 (by new algo.) = %g", work->GetNthHTKUnit(2)->CalcKLDistance ( work->GetNthHTKUnit(1) ) );
#else
work->CalcHellingerMatrix();
work->SpaceFileOut ("./tmp_space_output.txt");
tl_message ("Hellinger Distance from 0 to 1 = %g", work->GetNthHTKUnit(0)->CalcHellingerDistance ( *(work->GetNthHTKUnit(1)) ) );
tl_message ("Hellinger Distance from 1 to 0 = %g", work->GetNthHTKUnit(1)->CalcHellingerDistance ( *(work->GetNthHTKUnit(0)) ) );
tl_message ("Hellinger Distance from 0 to 2 = %g", work->GetNthHTKUnit(0)->CalcHellingerDistance ( *(work->GetNthHTKUnit(2)) ) );
//tl_message ("Hellinger Distance from 2 to 0 = %g", work->GetNthHTKUnit(2)->CalcHellingerDistance ( work->GetNthHTKUnit(0) ) );
tl_message ("Hellinger Distance from 1 to 2 = %g", work->GetNthHTKUnit(1)->CalcHellingerDistance ( *(work->GetNthHTKUnit(2)) ) );
//tl_message ("Hellinger Distance from 2 to 1 = %g", work->GetNthHTKUnit(2)->CalcHellingerDistance ( work->GetNthHTKUnit(1) ) );
#endif
vector<double> tmp_dis, tmp_cord;
tl_message ("Now generate a general synthesised HMM");
ofstream fout("./result.dat");
fout << "weight[0], weight[1], pseudo_distance to [0], pseudo_distance to [1], position_1, position_2" << endl;
for (int i=-20; i<=20; i++)
{
synthesis_hmm = new JHMM;
weight[0] = 0.1 * i;
weight[1] = 1.0 - 0.1 * i;
synthesis_hmm->InterpolationAny (hmm, weight, 2);
beh = synthesis_hmm->GenerateBehavior(100, 30);
delete synthesis_hmm;
work->CalcDistanceOfInputBehavior(beh, tmp_dis);
work->GetPsymbolSpace()->CoordinateFromDistanceData(tmp_dis, tmp_cord);
fout << weight[0] << "," << weight[1] << ",";
for (int i=0; i<(int)(tmp_dis.size()); i++)
fout << tmp_dis[i] << ",";
for (int i=0; i<(int)(tmp_cord.size()); i++)
fout << tmp_cord[i] << ",";
fout << endl;
cerr << "size of distance vector = " << tmp_dis.size() << ", and size of coordinate = " << tmp_cord.size() << endl;
}
delete beh;
for (int i=0; i<3; i++)
delete hmm[i];
return TRUE;
return TRUE;
}
开发者ID:raghavendrajain,项目名称:mimesis,代码行数:83,代码来源:synthesis_graph.cpp
示例18: test_extra_recognition
// Created on 2008-07-10
// Test for what's happen when the extrapolated motion patterns are recognized by mimesis
// also for RSJ conf. 2008
int test_extra_recognition(void)
{
tl_message ("start");
JHMM *hmm1 = NULL, *hmm2 = NULL, *hmm3 = NULL, *synthesis_hmm = NULL;
Behavior *beh = NULL;
JHMM *hmm_vec[3];
double weight[3];
int i;
hmm1 = new JHMM;
hmm2 = new JHMM;
hmm3 = new JHMM;
hmm1->Load("./.tmp/punch/punch.hmm");
hmm2->Load("./.tmp/squat/squat.hmm");
hmm3->Load("./.tmp/kick/kick.hmm");
hmm_vec[0] = hmm1;
hmm_vec[1] = hmm2;
hmm_vec[2] = hmm3;
WorkSpace *work = NULL;
work = new WorkSpace();
if (script_file[0]==0) { print_usage(); exit(0); }
work->LoadMotionDB (script_file);
work->SetHTKUnitsFromMotionDB ();
work->BeforeRecognize();
work->DistanceLoad ("../../script/symbol_data/tmp_distance_vector");
work->SpaceLoad ("../../script/symbol_data/tmp_dim.spc");
vector<double> tmp_dis, new_dis, hellinger, tmp_cord;
vector<double> likelihood;
tl_message ("# of motion db is : %d\n", work->GetNumOfMotionDB() );
cout << "c_1, c_2, ";
for (i=0; i<(int)(work->GetNumOfMotionDB()); i++)
cout << "old_KLdistance[" << i << "] ,";
for (i=0; i<(int)(work->GetNumOfMotionDB()); i++)
cout << "new_KLdivergence[" << i << "] ,";
for (i=0; i<(int)(work->GetNumOfMotionDB()); i++)
cout << "Hellinger Distance[" << i << "] ,";
for (i=0; i<(int)(work->GetPsymbolSpace()->GetDimension() ); i++)
cout << "x[" << i << "] , ";
cout << endl;
for (int i=-10; i<20; i++)
{
synthesis_hmm = new JHMM;
weight[0] = i * 0.1;
weight[1] = 1 - weight[0];
synthesis_hmm->InterpolationAny (hmm_vec, weight, 2);
beh = synthesis_hmm->GenerateBehavior(100, 30);
work->CalcHellingerDistanceOfOnlineBehavior(beh, hellinger);
tl_message ("step hoge %d.0", i);
for (int j=0; j<(int)(hellinger.size()); j++)
cout << hellinger[j] << " , ";
cout << endl;
tl_message ("step hoge %d.1", i);
work->CalcLikelihoodVector (beh, likelihood);
tl_message ("step hoge %d.2", i);
work->CalcDistanceOfInputBehavior (beh, tmp_dis);
tl_message ("step hoge %d.3", i);
work->CalcDistanceOfOnlineBehavior(beh, new_dis);
tl_message ("step hoge %d.4", i);
work->GetPsymbolSpace()->CoordinateFromDistanceData(tmp_dis, tmp_cord);
tl_message ("step hoge %d.5", i);
cout << weight[0] << " , " << weight[1] << " , ";
for (int j=0; j<(int)(tmp_dis.size()); j++)
cout << tmp_dis[j] << " , ";
for (int j=0; j<(int)(new_dis.size()); j++)
cout << new_dis[j] << " , ";
for (int j=0; j<(int)(hellinger.size()); j++)
cout << hellinger[j] << " , ";
for (int j=0; j<(int)(tmp_cord.size()); j++)
cout << tmp_cord[j] << " , ";
cout << endl;
delete synthesis_hmm;
}
delete beh;
delete hmm1;
delete hmm2;
delete hmm3;
delete synthesis_hmm;
return TRUE;
}
开发者ID:t-inamura,项目名称:mimesis,代码行数:92,代码来源:extra_test.cpp
示例19: main
int main(int argc, char **argv) {
Manager manager;
PropList props;
PROCESSOR_PATH(props) = "../../data/procs/op1.xml";
CACHE_CONFIG_PATH(props) = "../../data/caches/inst-64x16x1.xml";
try {
// Load program
if(argc < 2) {
cerr << "ERROR: no argument.\n"
<< "Syntax is : test_ipet <executable>\n";
return 2;
}
WorkSpace *fw = manager.load(argv[1], props);
assert(fw);
// Display information
cout << "PLATFORM INFORMATION\n";
Platform *pf = fw->platform();
cout << "Platform : " << pf->identification().name() << '\n';
cout << '\n';
// Display registers
cout << "REGISTERS\n";
for(int i = 0; i < pf->banks().count(); i++) {
const hard::RegBank *bank = pf->banks()[i];
cout << "Bank " << bank->name() << ", "
<< bank->size() << "bits, "
<< bank->count() << " registers, "
<< reg_kinds[bank->kind()];
for(int j = 0; j < bank->registers().count(); j++) {
if(j % 8 == 0)
cout << "\n\t";
else
cout << ", ";
cout << bank->registers()[j]->name();
}
cout << '\n';
}
cout << '\n';
// Display cache
cout << "CACHE CONFIGURATION\n";
const CacheConfiguration& cconf(pf->cache());
display_cache_level(1, cconf.instCache(), cconf.dataCache());
cout << '\n';
// Display some instructions
fw->require(DECODED_TEXT);
cout << "READ/WRITTEN REGS TEST\n";
String label("main");
Inst *inst = fw->process()->findInstAt("main");
//fw->findLabel(label));
if(!inst)
throw new otawa::Exception(CString("no main in this file ?"));
for(int i = 0; i < 10; i++, inst = inst->nextInst()) {
cout << '\n' << inst->address() << ": "
<< inst << " (" << io::hex(inst->kind()) << ")\n";
const elm::genstruct::Table<hard::Register *>& reads = inst->readRegs();
cout << "\tread registers : ";
for(int i = 0; i < reads.count(); i++)
cout << reads[i] << ' ';
cout << '\n';
const elm::genstruct::Table<hard::Register *>& writes = inst->writtenRegs();
cout << "\twritten registers : ";
for(int i = 0; i < writes.count(); i++)
cout << writes[i] << ' ';
cout << '\n';
}
cout << io::endl;
// Processor load test
cout << "Processor load test\n";
//pf->loadProcessor("proc.xml");
const hard::Processor *proc = pf->processor();
if(!proc)
cout << "NO PROCESSOR !\n";
else {
cout << "arch = " << proc->getArch() << io::endl;
cout << "model = " << proc->getModel() << io::endl;
cout << "builder = " << proc->getBuilder() << io::endl;
cout <<"stages =\n";
const elm::genstruct::Table<hard::Stage *>& stages = proc->getStages();
for(int i = 0; i< stages.count(); i++) {
cout << '\t'
<< stages[i]->getName() << " "
<< stages[i]->getType() << " "
<< stages[i]->getWidth() << " "
<< stages[i]->getLatency() << " "
<< io::pointer(stages[i]) << io::endl;
const elm::genstruct::Table<hard::FunctionalUnit *>& fus = stages[i]->getFUs();
if(fus) {
cout << "\tfus=\n";
for(int i = 0; i < fus.count(); i++)
cout << "\t\t" << fus[i]->getName() << ' '
<< fus[i]->getWidth() << ' '
<< fus[i]->getLatency() << ' '
//.........这里部分代码省略.........
开发者ID:t-crest,项目名称:patmos-otawa,代码行数:101,代码来源:test_hard.cpp
示例20: Button1Down
static MRESULT APIENTRY Button1Down ( HWND Window, MESG, MPARAM1 mp1,
|
请发表评论