-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Umbu and Threads versions are now available and new flags #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny requests
generateChunkOutTif(input, criteriaName, chunk, values, sumAccum); | ||
} | ||
|
||
TIFFClose(input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FMota0 could we delete below-commented code?
@@ -0,0 +1,19 @@ | |||
#!/bin/bash | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented code detected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
caja/playground/src/umbu.cpp
Outdated
using MaskMatrixLine = vector<bool>; | ||
|
||
using MaskMatrix = vector<MaskMatrixLine>; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented code detected
vector<string> convertToVector(int argc, char * argv[]){ | ||
vector<string> args; | ||
for(int i = 1; i < argc; i++) args.push_back(argv[i]); | ||
return args; | ||
} | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no need to use two lines for this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... use a single line, break it when it reaches ~80 chars, e.g
@@ -15,6 +15,9 @@ | |||
#include "functions/optimized/linear_with_indifference_function.h" | |||
#include <string> | |||
|
|||
/** | |||
* Ugly structure to make possible vanilla/optimized have the same input reader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove ugly. if you think it should be refactored later, add a TODO
/** | ||
./run -um AEMMF.tif 0.47 -chunk=1111 -ismax -type=linear (args...) | ||
**/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need improvement. one need to know the all the possible args (I accept adding a TODO telling so)
void PrometheeUmbu::init(vector<string> args, int divideBy){ | ||
this->divideBy = divideBy; | ||
|
||
// Get type of function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no need for this comment. code is simple enough
cerr << "Error: incorrect arguments." << endl; | ||
exit(0); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above. remove doc
} | ||
} | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could be improved. describe the purpose of the function and its parameters (all)
adopt the following standard
paramentername - description
paramentername - description
* input, values, sumAccum, cnt are arguments to make calc of flow | ||
* */ | ||
void PrometheeUmbu::generateChunkOutTifUnbu(string &outputFile, string &nextFile, TIFF *input, vector<ldouble> & values, vector<ldouble> & sumAccum, vector<unsigned int> &cntAccum){ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not clear why we need current out and next out. Unclear code should be explained
TIFF *out = TIFFOpen(outputFile.c_str(), "rm"); | ||
TIFF *nxt = openFile(nextFile, this->width, this->height); | ||
|
||
ldouble *line = new ldouble[this->width]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems line should be inputline
ldouble *line = new ldouble[this->width]; | ||
ldouble *outline = new ldouble[this->width]; | ||
for (int i = 0; i < this->height; i++){ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity, is this read operation buffered? and, for our typical tiffs, how big is a line (in bytes)
The flag -hq now is available you can use it like
./run samples/sample3/input samples/sample3/meta out/sample3 -hq=2
also, the flag of vanilla was changed, to use vanilla you can run as in the example:
./run -van samples/sample1/input samples/sample1/meta out/sample1 -hq=4
And the main is simpler now.
The flag -thr will run promethee optimized with threads.
The flag -um will run promethee umbu.
For promethee umbu the following command options should be specified:
Example:
./run -um tif weight -chunk=1111 -ismax -type=linear (args...)
-chunk=, for max amount of distinct values in a chunk.
-ismax, for indicate that the objective is to maximaze.
-type=, what type of function to be used ("linear" or "linearWithIndifference")
(args...), represent the arguments for the specified type of function
Solve issues #45 and #50.
The issue #37 can be seen as solved, since the input reader change depending of the promethee version, Umbu reads from tif, others read from txt