本文整理汇总了C++中_List类的典型用法代码示例。如果您正苦于以下问题:C++ _List类的具体用法?C++ _List怎么用?C++ _List使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了_List类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ReadModelList
void ReadModelList(void)
{
if (templateModelList.lLength > 0) return;
_String modelListFile (_HYStandardDirectory (HY_HBL_DIRECTORY_TEMPLATE_MODELS) & "models.lst");
FILE* modelList = doFileOpen (modelListFile.getStr(),"rb");
if (!modelList) {
return;
}
_String theData (modelList);
fclose (modelList);
if (theData.sLength) {
_ElementaryCommand::ExtractConditions(theData,0,templateModelList);
for (unsigned long i = 0; i<templateModelList.countitems(); i++) {
_String* thisString = (_String*)templateModelList(i);
_List thisModel;
_ElementaryCommand::ExtractConditions(*thisString,thisString->FirstNonSpaceIndex(),thisModel,',');
if (thisModel.lLength!=5) {
templateModelList.Delete(i);
i--;
continue;
}
for (long j = 0; j<5; j++) {
((_String*)thisModel(j))->StripQuotes();
}
((_String*)thisModel(0))->UpCase();
templateModelList.Replace(i,&thisModel,true);
}
}
}
开发者ID:Dietermielke,项目名称:hyphy,代码行数:31,代码来源:batchlanhelpers.cpp
示例2: SplitVariableIDsIntoLocalAndGlobal
//__________________________________________________________________________________
void SplitVariableIDsIntoLocalAndGlobal (const _SimpleList& theList, _List& splitStorage)
{
splitStorage.Clear();
splitStorage.AppendNewInstance(new _SimpleList);
splitStorage.AppendNewInstance(new _SimpleList);
for (unsigned long k=0; k<theList.lLength; k++) {
long varID = theList.lData[k];
(*(_SimpleList*)splitStorage(1-LocateVar (varID)->IsGlobal())) << varID;
}
}
开发者ID:HyperionRiaz,项目名称:hyphy,代码行数:12,代码来源:parser.cpp
示例3: GenerateFontList
void GenerateFontList (_List& fonts)
{
fonts.Clear();
PangoFontFamily **families;
PangoFontFamily *match_family = NULL;
gint n_families, i;
pango_context_list_families ((screenPContext),&families, &n_families);
for (i=0; i<n_families; i++) {
fonts.AppendNewInstance(new _String(pango_font_family_get_name (families[i])));
}
fonts.Sort();
g_free (families);
}
开发者ID:Nicholas-NVS,项目名称:hyphy,代码行数:14,代码来源:HYPlatformUtils.cpp
示例4: HandlePullDown
_String HandlePullDown (_List& menuOptions, long l, long t,long startPos)
{
lastPopupMenuSelection = -1;
lastPopupMenuItemStrings.Clear();
if (lastPopupFactory) {
delete lastPopupFactory;
}
if (menuOptions.lLength) {
ListToPopUpMenu (menuOptions);
GtkWidget *menu;
int button = 0;
guint32 event_time = gtk_get_current_event_time ();
GtkItemFactory * menu_items = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<HY_POPUP>", NULL);
gtk_item_factory_create_items (menu_items, menuOptions.lLength, lastPopupFactory, menu);
menu = gtk_item_factory_get_widget (menu_items, "<HY_POPUP>/Popup");
g_signal_connect (menu, "selection-done", (GCallback)hyphy_popup_menu_close, menu_items);
lastPopupMenuSelection = -1;
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time);
gtk_main ();
gtk_widget_destroy (menu);
g_object_unref(menu_items);
if (lastPopupMenuSelection>=0) {
return *(_String*)menuOptions (lastPopupMenuSelection);
}
}
return empty;
}
开发者ID:Nicholas-NVS,项目名称:hyphy,代码行数:35,代码来源:HYPlatformUtils.cpp
示例5: CompileListOfUserExpressions
//__________________________________________________________________________________
void CompileListOfUserExpressions (_SimpleList& varRefs,_List& rec, bool doAll)
{
rec.Clear();
if (varRefs.lLength == 0) {
return;
}
long i;
_SimpleList startVars;
_VariableContainer* firstVar = (_VariableContainer*)LocateVar(varRefs.lData[0]);
firstVar->ScanAndAttachVariables();
{
_AVLList sA (&startVars);
if (doAll) {
firstVar->ScanForVariables (sA,sA);
firstVar->ScanForGVariables (sA,sA);
}
firstVar->ScanForDVariables (sA,sA);
sA.ReorderList ();
}
if (!doAll) {
for (i=startVars.lLength-1; i>=0; i--) {
if (firstVar->IsModelVar(i)) {
startVars.Delete(i);
}
}
}
for (i=0; i<startVars.lLength; i++) {
_String thisName (LocateVar(startVars.lData[i])->GetName()->Cut
(LocateVar(startVars.lData[i])->GetName()->FindBackwards('.',0,-1),-1));
rec && &thisName;
}
for (i=varRefs.lLength-1; i>=1; i--) {
firstVar = (_VariableContainer*)LocateVar(varRefs.lData[i]);
firstVar->ScanAndAttachVariables();
firstVar->MatchParametersToList (rec,doAll);
}
for (i=rec.lLength-1; i>=0; i--) {
_String* thisLine = ((_String*)rec(i));
thisLine->Trim(1,-1);
if (doAll)
if (LocateVarByName(*thisLine)<0) {
*thisLine = _String('!')&*thisLine;
}
}
}
开发者ID:HyperionRiaz,项目名称:hyphy,代码行数:56,代码来源:parser.cpp
示例6: ReadInTemplateFiles
//__________________________________________________________________________________
void ReadInTemplateFiles(void)
{
_String fileIndex;
fileIndex = *((_String*)pathNames(0)) &"TemplateBatchFiles/files.lst";
FILE* modelList = fopen (fileIndex.getStr(),"r");
if (!modelList)
{
fileIndex = baseArgDir&"TemplateBatchFiles/files.lst";
modelList = fopen (fileIndex.getStr(),"r");
if (!modelList)
return;
}
else
baseArgDir = *((_String*)pathNames(0));
fseek (modelList,0,SEEK_END);
unsigned long fLength = ftell(modelList);
if (fLength)
{
rewind (modelList);
_String theData (fLength);
fread (theData.getStr(),sizeof (char), fLength, modelList);
_ElementaryCommand::ExtractConditions(theData,0,availableTemplateFiles);
for (long i = 0; i<availableTemplateFiles.countitems(); i++)
{
_String* thisString = (_String*)availableTemplateFiles(i);
_List thisFile;
_ElementaryCommand::ExtractConditions(*thisString,thisString->FirstNonSpaceIndex(),thisFile,',');
if (thisFile.lLength!=3)
{
availableTemplateFiles.Delete(i);
i--;
continue;
}
for (long j = 0; j<3; j++)
((_String*)thisFile(j))->StripQuotes();
availableTemplateFiles.Replace(i,&thisFile,true);
}
}
}
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:42,代码来源:main-unix.cpp
示例7: FindUnusedObjectName
void FindUnusedObjectName (_String& prefix, _String& partName, _List& names, bool sorted)
{
if (partName.sLength==0) {
partName = prefix;
}
_String tryName (partName);
long k = 1;
if (sorted)
while (names.BinaryFind(&tryName)>=0) {
k++;
tryName = partName&k;
}
else
while (names.Find(&tryName)>=0) {
k++;
tryName = partName&k;
}
partName = tryName;
}
开发者ID:HyperionRiaz,项目名称:hyphy,代码行数:22,代码来源:parser.cpp
示例8:
//__________________________________________________________________
void _HYSequencePane::SelectSequenceNames (_List& list, bool send)
{
selection.Clear();
vselection.Clear();
for (long k=0; k<rowHeaders.lLength; k++)
{
_String * aSeq = (_String*)rowHeaders(speciesIndex.lData[k]);
if (list.BinaryFind (aSeq) >= 0)
vselection << k;
}
BuildPane();
_MarkForUpdate();
if (send)
SendSelectionChange (true);
}
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:18,代码来源:HYSequencePanel.cpp
示例9: switch
void _HYObjectInspector::BuildListOfObjects (long index)
{
_HYTable* oList = (_HYTable*)GetCellObject (HY_OBJECT_INSPECTOR_TABLE_ROW,0);
_HYTable* oHead = (_HYTable*)GetCellObject (HY_OBJECT_INSPECTOR_TABLE_ROW-1,0);
_HYButtonBar* b1 = (_HYButtonBar*)GetCellObject (0,0);
_HYPullDown* p1 = (_HYPullDown*)GetCellObject (0,2);
long k,
rowCount = 0;
oList->ClearTable();
_String newStat;
switch (index) {
case 0: { // trees
for (k=0; k<variablePtrs.lLength; k++) {
_Variable * thisVar = LocateVar(k);
if (thisVar&&(thisVar->ObjectClass()==TREE)) {
oList->AddRow (-1,20,HY_TABLE_STATIC_TEXT);
_SimpleList deps;
TreeDependencies (deps,thisVar->GetAVariable());
if (deps.lLength) {
oList->SetCellData (thisVar->GetName(),rowCount,0,HY_TABLE_STATIC_TEXT|HY_TABLE_ITALIC|HY_TABLE_BOLD,true);
} else {
oList->SetCellData (thisVar->GetName(),rowCount,0,HY_TABLE_STATIC_TEXT|HY_TABLE_ITALIC,true);
}
_TheTree * thisTree = (_TheTree*)thisVar;
_PMathObj tc = thisTree->TipCount();
newStat = _String ((long)tc->Value()) & " leaves ";
DeleteObject (tc);
tc = thisTree->BranchCount();
newStat = newStat& ", " & _String ((long)tc->Value()+1) & " internal nodes.";
DeleteObject (tc);
oList->SetCellData (&newStat,rowCount,1,HY_TABLE_STATIC_TEXT,true);
rowCount++;
}
}
b1->EnableButton (2,true);
b1->EnableButton (3,true);
break;
}
case 1: { // data sets
for (k=0; k<dataSetNamesList.lLength; k++) {
_String* thisDS = (_String*)dataSetNamesList(k);
if (thisDS->sLength) {
oList->AddRow (-1,20,HY_TABLE_STATIC_TEXT);
_SimpleList deps;
DSDependencies (deps,k);
if (deps.lLength) {
oList->SetCellData (thisDS,rowCount,0,HY_TABLE_STATIC_TEXT|HY_TABLE_ITALIC|HY_TABLE_BOLD,true);
} else {
oList->SetCellData (thisDS,rowCount,0,HY_TABLE_STATIC_TEXT|HY_TABLE_ITALIC,true);
}
_DataSet* theDS = (_DataSet*)dataSetList(dataSetNamesList.Find(thisDS));
if (theDS->GetTT()->IsStandardNucleotide()) {
newStat = "Nucleotide data";
} else if (theDS->GetTT()->IsStandardAA()) {
newStat = "Aminoacid data";
} else if (theDS->GetTT()->IsStandardBinary()) {
newStat = "Binary data";
} else {
newStat = "Custom data";
}
newStat = newStat & ". "& _String (theDS->NoOfColumns()) &" sites ("&_String (theDS->NoOfUniqueColumns())&" distinct patterns), "&_String(theDS->NoOfSpecies())& " species.";
oList->SetCellData (&newStat,rowCount,1,HY_TABLE_STATIC_TEXT,true);
rowCount++;
}
}
b1->EnableButton (2,true);
b1->EnableButton (3,false);
break;
}
case 2: { // Models
for (k=0; k<modelTemplates.lLength; k++) {
_List * thisModel = (_List*) modelTemplates(k);
_SimpleList * modelParameters = (_SimpleList*) (*thisModel)(1);
oList->AddRow (-1,20,HY_TABLE_STATIC_TEXT);
if (modelParameters->lData[0] & HY_DATAPANEL_MODEL_MODELS) {
oList->SetCellData ((*thisModel)(0),rowCount,0,HY_TABLE_STATIC_TEXT,true);
} else {
oList->SetCellData ((*thisModel)(0),rowCount,0,HY_TABLE_STATIC_TEXT|HY_TABLE_ITALIC,true);
}
if (modelParameters->lData[1]==4) {
newStat = "Nucleotide model";
} else if (modelParameters->lData[1]==16) {
newStat = "Dinucleotide Model";
} else if (modelParameters->lData[1]==20) {
newStat = "Aminoacid Model";
} else {
newStat = "Codon Model";
}
newStat = newStat & ".";
oList->SetCellData (&newStat,rowCount,1,HY_TABLE_STATIC_TEXT,true);
rowCount++;
//.........这里部分代码省略.........
开发者ID:Dietermielke,项目名称:hyphy,代码行数:101,代码来源:HYObjectInspector.cpp
示例10: HandlePullDownWithFont
long HandlePullDownWithFont (_List& menuOptions, long l, long t,long startPos,_String fName,long fSize)
{
_String selRes = HandlePullDown (menuOptions, l, t, startPos);
return menuOptions.Find (&selRes);
}
开发者ID:Nicholas-NVS,项目名称:hyphy,代码行数:5,代码来源:HYPlatformUtils.cpp
示例11: ReadInPostFiles
//__________________________________________________________________________________
void ReadInPostFiles(void)
{
//if (!likeFuncList.lLength)
// return;
_String fileIndex;
FILE* modelList = fopen (fileIndex.getStr(),"r");
fileIndex = baseArgDir &"TemplateBatchFiles/postprocessors.lst";
modelList = fopen (fileIndex.getStr(),"r");
fseek (modelList,0,SEEK_END);
unsigned long fLength = ftell(modelList);
fseek (modelList,0,SEEK_END);
fLength = ftell(modelList);
if (fLength)
{
rewind (modelList);
_String theData (fLength);
fread (theData.getStr(),sizeof (char), fLength, modelList);
_ElementaryCommand::ExtractConditions(theData,0,availablePostProcessors);
for (long i = 0; i<availablePostProcessors.countitems(); i++)
{
_String* thisString = (_String*)availablePostProcessors(i);
_List thisFile;
_ElementaryCommand::ExtractConditions(*thisString,thisString->FirstNonSpaceIndex(),thisFile,',');
if (thisFile.lLength!=3)
{
availablePostProcessors.Delete(i);
i--;
continue;
}
for (long j = 0; j<3; j++)
((_String*)thisFile(j))->StripQuotes();
if (*(_String*)thisFile(0)!=_String("SEPARATOR"))
{
fileIndex = *((_String*)pathNames(0)) &"TemplateBatchFiles/" & *(_String*)thisFile(1);
FILE* dummyFile = fopen (fileIndex,"r");
if (!dummyFile)
{
fileIndex =baseArgDir&"TemplateBatchFiles/"& *(_String*)thisFile(1);
dummyFile = fopen (fileIndex,"r");
}
if (dummyFile)
{
fclose (dummyFile);
_String* condition = (_String*)thisFile(2);
if (condition->sLength)
{
_Formula condCheck (*condition,nil);
_PMathObj condCheckRes = condCheck.Compute();
if ((!condCheckRes)||(condCheckRes->Value()<.5))
{
availablePostProcessors.Delete(i);
i--;
continue;
}
}
*(_String*)thisFile(1) = fileIndex;
availablePostProcessors.Replace(i,&thisFile,true);
continue;
}
}
availablePostProcessors.Delete(i);
i--;
}
}
}
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:69,代码来源:main-unix.cpp
示例12: ComputeHashMarkPlacement
//__________________________________________________________________
long ComputeHashMarkPlacement (_HYRect line, _Parameter min, _Parameter max, _Parameter& tickStep,
_Parameter&minLabel, _SimpleList& offsets, _List& labels,
int count, _HYFont& f)
{
if (max>min)
{
offsets.Clear();
labels.Clear();
long w = line.right-line.left,
h = line.bottom-line.top,
t = 0;
_Parameter scalingFactor = (w>h)?w/(max-min):h/(max-min);
tickStep = log(max-min)/log(10.);
tickStep = pow (10.,floor (tickStep))*2.;
minLabel = min;
t = count-1;
while (t<count)
{
tickStep/=2.;
if (tickStep>1.)
tickStep = floor (tickStep);
if (min)
minLabel = ceil(min/tickStep)*tickStep;
t = ceil((max-minLabel)/tickStep);
if (min)
minLabel = ceil(min/tickStep)*tickStep;
}
if (h>w)
{
_Parameter tracer = minLabel;
long res = 0,
last = -100000,
k,
sw;
w = h;
for (h=0; h<=t; h++,tracer+=tickStep)
{
_String buffer (tracer);
sw = GetVisibleStringWidth (buffer,f);
k = (tracer-min)*scalingFactor;
if (k>w)
break;
if (k-last>f.size)
{
offsets << k;
offsets << sw;
labels && & buffer;
last = k;
}
if (sw>res)
res = sw;
}
return res;
}
else
{
_Parameter tracer = minLabel;
long res = 0,
last = -100000,
k,
sw;
for (h=0; h<=t; h++,tracer+=tickStep)
{
_String buffer (tracer);
sw = GetVisibleStringWidth (buffer,f);
k = (tracer-min)*scalingFactor;
if (k>w)
break;
if (k-last>sw)
{
offsets << k;
offsets << sw;
labels && & buffer;
last = k;
}
}
}
return f.size;
}
return 0;
}
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:93,代码来源:HYGraphicPane.cpp
示例13: ComputeTableCellPlacement
//__________________________________________________________________
long ComputeTableCellPlacement (_List& theStrings, _List& thePlacements, _HYRect margins, _HYFont& f)
{
_SimpleList columnWidths;
_List stringWidths;
long i1,i2,w;
for (i1=0; i1<theStrings.lLength; i1++)
{
_List *thisRow = (_List*)theStrings(i1);
_SimpleList *rowWidths = new _SimpleList;
checkPointer (rowWidths);
for (i2=0; i2<thisRow->lLength;i2++)
{
w = GetVisibleStringWidth (*(_String*)((*thisRow)(i2)),f);
if (columnWidths.lLength<=i2)
columnWidths << w;
else
if (columnWidths.lData[i2]<w)
columnWidths.lData[i2] = w;
(*rowWidths) << w;
}
stringWidths << rowWidths;
DeleteObject (rowWidths);
}
thePlacements.Clear();
w = f.size+margins.top;
for (i1=0; i1<theStrings.lLength; i1++)
{
_SimpleList *thisRow = (_SimpleList*)stringWidths(i1),
*rowPlacements = new _SimpleList;
checkPointer (rowPlacements);
long cumW = margins.left;
for (i2=0; i2<thisRow->lLength;i2++)
{
(*rowPlacements) << w;
(*rowPlacements) << cumW;
(*rowPlacements) << columnWidths.lData[i2]-thisRow->lData[i2];
cumW += columnWidths.lData[i2]+margins.right+margins.left;
}
thePlacements << rowPlacements;
w += f.size+margins.top+margins.bottom;
DeleteObject (rowPlacements);
}
w = 0;
for (i1=0; i1<columnWidths.lLength; i1++)
{
w += columnWidths.lData[i1];
w += margins.left;
w += margins.right;
}
return w;
}
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:66,代码来源:HYGraphicPane.cpp
示例14: windowTitle
void _HYObjectInspector::OpenObjectWindow (void)
{
_HYTable* dl = (_HYTable*)GetCellObject (HY_OBJECT_INSPECTOR_TABLE_ROW,0);
_HYButtonBar* b1 = (_HYButtonBar*)GetCellObject (0,0);
_HYPullDown* p1 = (_HYPullDown*)GetCellObject (0,2);
_SimpleList sel;
dl->GetSelection (sel);
if (sel.lLength) {
b1->EnableButton (0,true);
for (long k = 0; k<sel.lLength; k+=2) {
_String windowTitle (*(_String*)dl->GetCellData (0,sel.lData[k]/2));
long f;
switch (p1->GetSelection()) {
case 0: {
_String winTitle (windowTitle);
windowTitle = _String ("Tree ")&windowTitle;
f = FindWindowByName (windowTitle);
if (f<0) {
_HYTreePanel* newTreePanel = new _HYTreePanel (winTitle,winTitle);
newTreePanel->_Zoom(true);
newTreePanel->BringToFront();
//newTreePanel->Show();
} else {
_HYPlatformWindow* thisWindow = (_HYPlatformWindow*)windowObjects(f);
thisWindow->_Activate();
}
break;
}
case 1: {
_String winTitle (windowTitle);
windowTitle = _String ("DataSet ")&windowTitle;
f = FindWindowByName (windowTitle);
if (f<0) {
_HYDataPanel* newDataPanel = new _HYDataPanel (winTitle,winTitle);
newDataPanel->BringToFront();
} else {
_HYPlatformWindow* thisWindow = (_HYPlatformWindow*)windowObjects(f);
thisWindow->_Activate();
}
break;
}
case 2: {
_String winTitle (windowTitle);
windowTitle = _String ("Model ")&windowTitle;
f = FindWindowByName (windowTitle);
if (f<0) {
if (dl->cellTypes.lData[sel.lData[k]] & HY_TABLE_ITALIC) {
if (!warnModelOpen) {
windowTitle = _String ("Model \"") & winTitle & "\" is a template model, and it can't be opened. You can open a new model based on it, though.";
if (!warnModelOpen) {
if (!ProceedPromptWithCheck (windowTitle, donotWarnAgain, warnModelOpen)) {
break;
}
}
NewObject ();
break;
}
} else {
if (sel.lData[k]/2<modelTemplates.lLength) {
_List* modelSpec = FindModelTemplate (&winTitle);
if (modelSpec) {
OpenModelFromFile(*(_String*)(*modelSpec)(2));
}
} else {
OpenModelFromMatrix (winTitle);
}
}
} else {
_HYWindow* thisWindow = (_HYWindow*)windowObjectRefs(f);
thisWindow->BringToFront();
}
break;
}
case 3: {
_String winTitle (windowTitle);
windowTitle = _String ("Likelihood Function ")&windowTitle;
f = FindWindowByName (windowTitle);
if (f<0) {
f = likeFuncNamesList.Find(&winTitle);
if (f>=0) {
_HYParameterTable* newParameterTable = new _HYParameterTable (windowTitle,f);
newParameterTable->_Zoom(true);
newParameterTable->BringToFront();
}
} else {
_HYPlatformWindow* thisWindow = (_HYPlatformWindow*)windowObjects(f);
thisWindow->_Activate();
}
break;
}
}
}
}
}
开发者ID:Dietermielke,项目名称:hyphy,代码行数:96,代码来源:HYObjectInspector.cpp
示例15: ReplaceVar
//__________________________________________________________________________________
void ReplaceVar (_Variable* theV)
{
long pos = variableNames.Find (theV->theName);
if (pos>=0) {
pos = variableNames.GetXtra(pos);
UpdateChangingFlas (pos);
variablePtrs.Replace (pos,theV,true);
} else {
InsertVar (theV);
}
}
开发者ID:HyperionRiaz,项目名称:hyphy,代码行数:12,代码来源:parser.cpp
示例16: SetupOperationLists
//__________________________________________________________________________________
void SetupOperationLists (void)
{
BinOps<<'|'*256+'|';
opPrecedence<<1;
BinOps<<'&'*256+'&';
opPrecedence<<2;
BinOps<<'='*256+'=';
opPrecedence<<3;
BinOps<<'!'*256+'=';
opPrecedence<<3;
BinOps<<'<';
opPrecedence<<4;
BinOps<<'>';
opPrecedence<<4;
BinOps<<'<'*256+'=';
opPrecedence<<4;
BinOps<<'>'*256+'=';
opPrecedence<<4;
BinOps<<'+';
associativeOps << opPrecedence.lLength;
opPrecedence<<5;
BinOps<<'-';
opPrecedence<<5;
BinOps<<'*';
associativeOps << opPrecedence.lLength;
opPrecedence<<6;
BinOps<<'/';
opPrecedence<<6;
BinOps<<'%';
opPrecedence<<6;
BinOps<<'$';
opPrecedence<<6;
BinOps<<'^';
opPrecedence<<7;
BinOps<<'+'*256+'=';
opPrecedence<<8;
if (BuiltInFunctions.lLength==0)
// construct a list of operations
// don't forget to update SimplifyConstants, simpleOperationCodes, InternalDifferentiate, InternalSimplify, Formula::HasChanged and all Execute commands
// also MAccess and MCoord codes are used in Parse to merge multiple matrix access operations
{
//HY_OP_CODE_NOT
BuiltInFunctions.AppendNewInstance (new _String ('!'));
//HY_OP_CODE_NEQ
BuiltInFunctions.AppendNewInstance (new _String ("!="));
//HY_OP_CODE_IDIV
BuiltInFunctions.AppendNewInstance (new _String ('$'));
//HY_OP_CODE_MOD
BuiltInFunctions.AppendNewInstance (new _String ('%'));
//HY_OP_CODE_AND
BuiltInFunctions.AppendNewInstance (new _String ("&&"));
simpleOperationCodes << HY_OP_CODE_AND;
simpleOperationFunctions<< (long)AndNumbers;
//HY_OP_CODE_MUL
BuiltInFunctions.AppendNewInstance (new _String ('*'));
simpleOperationCodes << HY_OP_CODE_MUL;
simpleOperationFunctions<< (long)MultNumbers;
//HY_OP_CODE_ADD
BuiltInFunctions.AppendNewInstance (new _String ('+'));
simpleOperationCodes<< HY_OP_CODE_ADD;
simpleOperationFunctions<<(long)AddNumbers;
//HY_OP_CODE_SUB
BuiltInFunctions.AppendNewInstance (new _String ('-'));
simpleOperationCodes<<HY_OP_CODE_SUB;
simpleOperationFunctions<<(long)SubNumbers;
//HY_OP_CODE_DIV
BuiltInFunctions.AppendNewInstance (new _String ('/'));
simpleOperationCodes<<HY_OP_CODE_DIV;
simpleOperationFunctions<<(long)DivNumbers;
//HY_OP_CODE_LESS
BuiltInFunctions.AppendNewInstance (new _String ('<'));
simpleOperationCodes<<HY_OP_CODE_LESS;
simpleOperationFunctions<<(long)LessThan;
//HY_OP_CODE_LEQ
BuiltInFunctions.AppendNewInstance (new _String ("<="));
simpleOperationCodes<<HY_OP_CODE_LEQ;
simpleOperationFunctions<<(long)LessThanE;
//HY_OP_CODE_EQ
BuiltInFunctions.AppendNewInstance (new _String ("=="));
simpleOperationCodes<<HY_OP_CODE_EQ;
simpleOperationFunctions<<(long)EqualNumbers;
//HY_OP_CODE_GREATER
BuiltInFunctions.AppendNewInstance (new _String ('>'));
simpleOperationCodes<<HY_OP_CODE_GREATER;
//.........这里部分代码省略.........
开发者ID:HyperionRiaz,项目名称:hyphy,代码行数:101,代码来源:parser.cpp
注:本文中的_List类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论