Skip to content
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

Merged
merged 53 commits into from
Oct 31, 2018

Conversation

FMota0
Copy link
Collaborator

@FMota0 FMota0 commented Sep 28, 2018

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

Copy link
Member

@thiagomanel thiagomanel left a 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);
Copy link
Member

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?

caja/playground/src/merge.cpp Show resolved Hide resolved
@@ -0,0 +1,19 @@
#!/bin/bash

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code detected

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using MaskMatrixLine = vector<bool>;

using MaskMatrix = vector<MaskMatrixLine>;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code detected

promethee/parse_args.cpp Show resolved Hide resolved
vector<string> convertToVector(int argc, char * argv[]){
vector<string> args;
for(int i = 1; i < argc; i++) args.push_back(argv[i]);
return args;
}

/**
Copy link
Member

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

Copy link
Member

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
Copy link
Member

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...)
**/

Copy link
Member

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
Copy link
Member

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);
}

Copy link
Member

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

}
}

/**
Copy link
Member

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){

Copy link
Member

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];
Copy link
Member

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++){

Copy link
Member

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants