Comments (2)
Two issues in _AssociativeList::Merge
- delete p_keys would actually delete all the keys in "b" in the above example (bad idea)
- I rewrote the function to use AVL traversal, because otherwise we may run into issues where some of the elements in the dataList are empty (results of deletion operations on the list, for example), which would cause a different segfault.
Please use the following code patch for ::Merge
//_____________________________________________________________________________________________
void _AssociativeList::Merge (_PMathObj p)
{
//SW20111207: I don't think we should ever have to worry about avl traversing
//here as long as the other methods are implemented properly
if(p==this){
return;
}
if (p && p->ObjectClass() == ASSOCIATIVE_LIST) {
_AssociativeList *rhs = (_AssociativeList*) p;
_SimpleList hist;
long ls,
cn = rhs->avl.Traverser (hist,ls,rhs->avl.GetRoot());
/* SLKP20120111: we need to skip over "blanks" (e.g. resulting from previous delete operations)
here; using the traversal of the second list is the easiest way to go. */
while (cn >= 0) {
MStore(*(_String*)(*(_List*)rhs->avl.dataList)(cn),(_PMathObj)rhs->avl.GetXtra (cn),true);
cn = avl.Traverser (hist,ls);
}
}
else {
WarnError ("Associative list merge operation requires an associative list argument.");
}
}
from hyphy.
Ah I introduced the bug. I should have taken a look at the code before assigning it to you.
My apologies.
I'll go ahead and apply the patch.
The idea behind my change was to start reusing methods that explicitly take care of storage in an effort to reduce the lines and complexity in some parts of the code. I notice a few problems where I was a bit short-sighted though. I understand what you're doing now.
from hyphy.
Related Issues (20)
- amino acid sequences HOT 2
- busted creates tree but then errors HOT 4
- DATAMONKEY - MULTI-HIT HOT 4
- Error when using RELAX HOT 5
- Datamonkey does not recognized some sequences HOT 3
- Skipped user prompt in SM-2019.bf HOT 2
- Standard Error aBSREL HOT 4
- Questions about BUSTED and an error code 102 HOT 7
- FEL not working - Error included HOT 1
- Fix code scanning alert - Wrong type of arguments to formatting function
- hyphy MolecularClockF81.bf failed to compute a valid transition matrix HOT 2
- Multiple Testing Correction in BUSTED vs absREL HOT 4
- When does RELAX collapse rate classes? HOT 4
- Error: Internal error Constrained optimization failed, since a starting point within the domain specified for the variables couldn't be found. Set it by hand, or check your constraints for compatibility. HOT 3
- BUSTED error: tree_id_0 is not a supported object type in call to SetParameter HOT 6
- What is HyPhy calling the 2 nodes pointed at with arrows in this tree (image and txt file attached)? HOT 2
- aBSREL run time HOT 5
- Persistent error when running Gard HOT 3
- How to select positive signals of the foreground branch from the results of aBSREL modle HOT 3
- error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyphy.