Closed azmfaridee closed 12 years ago
Here is a quick list of what might be the issues with transferring python code to C++
radom.shuffle(list)
function. In C++ this can be easily done by using random_shuffle(vector.begin(), vector.end())
random.randint(upperLimit)
which we've been using so far. ISO C++ does not have a Mersenne Twister implementation but rand()
function could be used here without much problem. The point is further discussed in Issue #18vector< vector <int> >
for the matrix representation (which is automatically memory managed?) or use dynamic allocated array to do this (which is a lot faster)classify.shared
command then implement the rest centered around that.As mentioned in issue #18, I think rand()
is fine for now. If there's time at the end you can spend time implementing the mersenne twister algo.
A vector of vectors should be fine although if you're not doing a lot of manipulation a 2d array is pretty easy to implement array[width * height] and array[width * row + col] = x
I don't think there's a built in matrix transpose. It's probably easiest to just write a for-loop.
I don't think there's a built in matrix transpose. It's probably easiest to just write a for-loop.
I know matrix transpose is a simple problem, well it might be the simplest problem that is given to freshers. The reason I'm concerned about this is that we are talking about huge amount of data. In these cases (consider a matrix of 4000x400 or even bigger), efficient implementation becomes a important factor, even for the simplest of operations.
Check these three links, and you'll understand why I'm concerned about this:
We'll at this point, this may sound like overkill, but I'd definitely want to implement a faster implementation of matrix transpose than a 2-3 liner nested for, if I can get some spare time later :)
Related Issues: #3, #14, #15, #16, #17, #19, #20
This is weeks task is pretty straight forward. Begin working on porting the python code to C++ with mothur integration.
We've already some some initial R&D on mothur's framework in issue #4, #5, #6 and #7. Continuing from those investigation, we need to port our current algorithm to work with mothur.