Commit 3cedfc7a authored by Andrey Filippov's avatar Andrey Filippov

Found multithreaded Cholesky almost 10 times faster than single-threaded

for n=2300, 16 threads
parent 663a964a
This diff is collapsed.
This diff is collapsed.
......@@ -96,6 +96,8 @@ import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.cameras.ColorProcParameters;
import com.elphel.imagej.cameras.EyesisCorrectionParameters;
import com.elphel.imagej.cameras.ThermalColor;
import com.elphel.imagej.common.CholeskyLDLTMulti;
import com.elphel.imagej.common.CholeskyLLTMulti;
import com.elphel.imagej.common.DoubleFHT;
import com.elphel.imagej.common.DoubleGaussianBlur;
import com.elphel.imagej.common.GenericJTabbedDialog;
......@@ -865,6 +867,8 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
addButton("Vegetation LMA", panelOrange, color_process);
addButton("Combine LMA Segments", panelOrange, color_process);
addButton("Generate LWIR target", panelOrange, color_process);
addButton("Test LDLT Cholesky", panelOrange, color_process);
addButton("Test LLT Cholesky", panelOrange, color_process);
plugInFrame.add(panelOrange);
}
plugInFrame.pack();
......@@ -5807,8 +5811,20 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
SYNC_COMMAND, // // SyncCommand SYNC_COMMAND,
CLT_PARAMETERS, //CLTParameters clt_parameters,
true); //boolean combine_segments);
} else if (label.equals("Generate LWIR target")) {
VegetationSegment.generateSineTarget();
} else if (label.equals("Test LDLT Cholesky")) {
ImagePlus imp_sel = WindowManager.getCurrentImage();
if (imp_sel == null) {
IJ.showMessage("Error", "No images selected");
return;
}
CholeskyLDLTMulti.testCholesky(imp_sel); // ImagePlus imp.);
} else if (label.equals("Test LLT Cholesky")) {
ImagePlus imp_sel = WindowManager.getCurrentImage();
if (imp_sel == null) {
IJ.showMessage("Error", "No images selected");
return;
}
CholeskyLLTMulti.testCholesky(imp_sel); // ImagePlus imp.);
}
//
}
......
......@@ -1907,9 +1907,32 @@ public class VegetationLMA {
Matrix mdelta_cholesky = choleskyDecomposition.solve(jty);
Matrix mdelta_cholesky_multi = choleskyLDLTMulti.solve(jty);
*/
CholeskyLDLTMulti.testCholesky(
wjtjlambda, // Matrix wjtjlambda,
jty);
boolean save_cholesky = true;
boolean debug_cholesky = true;
if (save_cholesky) {
int dbg_n = wjtjlambda.getRowDimension();
double [] dbg_a0 = wjtjlambda.getRowPackedCopy();
double [] dbg_a = new double[dbg_n*(dbg_n+1)];
for (int i = 0; i < dbg_n; i++) {
System.arraycopy(
dbg_a0,
i*dbg_n,
dbg_a,
i*(dbg_n+1),
dbg_n);
dbg_a[(i+1)*(dbg_n+1)-1] = jty.get(i,0);
}
ShowDoubleFloatArrays.showArrays(
dbg_a, // double[] pixels,
dbg_n+1, // int width,
dbg_n, // int height,
"spd_a_"+debug_iter); // String title)
}
if (debug_cholesky) {
CholeskyLDLTMulti.testCholesky(
wjtjlambda, // Matrix wjtjlambda,
jty);
}
if (debug_level>2) {
System.out.println("mdelta");
mdelta.print(18, 6);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment