Skip to content
Snippets Groups Projects
Commit 985d31b6 authored by Matthew Webster's avatar Matthew Webster
Browse files

fixed uninit bug + some tidying

parent 86adc5b1
No related branches found
No related tags found
No related merge requests found
......@@ -514,15 +514,15 @@ namespace Melodic{
RowVector eta(30*n1);
float rangestepsize = (urange - lrange) / eta.Ncols();
for(int ctr_i = 0; ctr_i < eta.Ncols(); ctr_i++){
eta(ctr_i+1) = lrange + rangestepsize * (ctr_i);
for(int ctr_i = 1; ctr_i <= eta.Ncols(); ctr_i++){
eta(ctr_i) = lrange + rangestepsize * (ctr_i);
}
RowVector teta(10*n1);
teta = 0;
float stepsize = (bp - bm) / teta.Ncols();
for(int ctr_i = 0; ctr_i < teta.Ncols(); ctr_i++){
teta(ctr_i+1) = stepsize*(ctr_i);
for(int ctr_i = 1; ctr_i <= teta.Ncols(); ctr_i++){
teta(ctr_i) = stepsize*(ctr_i);
}
RowVector feta(teta);
......@@ -542,7 +542,8 @@ namespace Melodic{
}
RowVector Res(n1); //invert the CDF
for(int ctr_i = 1; ctr_i < eta.Ncols(); ctr_i++){
Res = 0;
for(int ctr_i = 1; ctr_i < eta.Ncols(); ctr_i++){ //Should this be <= instead of <?
if(floor(claw(ctr_i))>floor(claw(ctr_i+1))){
Res(int(floor(claw(ctr_i)))) = eta(ctr_i);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment