Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
663a964a
Commit
663a964a
authored
Mar 12, 2025
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Testing parallel Cholesky
parent
54367395
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
481 additions
and
21 deletions
+481
-21
CholeskyLDLTMulti.java
...main/java/com/elphel/imagej/common/CholeskyLDLTMulti.java
+427
-0
VegetationLMA.java
...main/java/com/elphel/imagej/vegetation/VegetationLMA.java
+54
-21
No files found.
src/main/java/com/elphel/imagej/common/CholeskyLDLTMulti.java
0 → 100644
View file @
663a964a
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/vegetation/VegetationLMA.java
View file @
663a964a
...
...
@@ -12,6 +12,7 @@ import java.util.HashSet;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
com.elphel.imagej.common.CholeskyLDLTMulti
;
import
com.elphel.imagej.common.DoubleGaussianBlur
;
import
com.elphel.imagej.common.ShowDoubleFloatArrays
;
import
com.elphel.imagej.jp4.JP46_Reader_camera
;
...
...
@@ -21,6 +22,7 @@ import com.elphel.imagej.tileprocessor.QuadCLT;
import
com.elphel.imagej.tileprocessor.TileNeibs
;
import
com.elphel.imagej.tileprocessor.TileProcessor
;
import
Jama.CholeskyDecomposition
;
import
Jama.Matrix
;
import
ij.IJ
;
import
ij.ImagePlus
;
...
...
@@ -1852,31 +1854,62 @@ public class VegetationLMA {
System
.
out
.
println
(
"JtJ + lambda*diag(JtJ"
);
wjtjlambda
.
print
(
18
,
6
);
}
Matrix
jtjl_inv
=
null
;
try
{
jtjl_inv
=
wjtjlambda
.
inverse
();
// check for errors
}
catch
(
RuntimeException
e
)
{
rslt
[
1
]
=
true
;
if
(
debug_level
>
-
2
)
{
System
.
out
.
println
(
"Singular Matrix!"
);
}
return
rslt
;
}
if
(
debug_level
>
4
)
{
System
.
out
.
println
(
"(JtJ + lambda*diag(JtJ).inv()"
);
jtjl_inv
.
print
(
18
,
6
);
}
//last_jt has NaNs
// Matrix jty = (new Matrix(this.last_jt)).times(y_minus_fx_weighted);
Matrix
jty
=
(
new
Matrix
(
last_jt_decimated
)).
times
(
y_minus_fx_weighted
);
if
(
debug_level
>
2
)
{
System
.
out
.
println
(
"Jt * (y-fx)"
);
jty
.
print
(
18
,
6
);
Matrix
mdelta
=
null
;
// jtjl_inv.times(jty);
boolean
use_cholesky
=
true
;
// false;
double
matrix_start_time
=
((
double
)
System
.
nanoTime
())
*
1
E
-
9
;
if
(
use_cholesky
)
{
try
{
mdelta
=
(
new
CholeskyDecomposition
(
wjtjlambda
)).
solve
(
jty
);
}
catch
(
RuntimeException
e
)
{
rslt
[
1
]
=
true
;
if
(
debug_level
>
-
2
)
{
System
.
out
.
println
(
"Singular Matrix!"
);
}
return
rslt
;
}
}
else
{
// old way - inverse() using LU
Matrix
jtjl_inv
=
null
;
try
{
jtjl_inv
=
wjtjlambda
.
inverse
();
// check for errors
}
catch
(
RuntimeException
e
)
{
rslt
[
1
]
=
true
;
if
(
debug_level
>
-
2
)
{
System
.
out
.
println
(
"Singular Matrix!"
);
}
return
rslt
;
}
if
(
debug_level
>
4
)
{
System
.
out
.
println
(
"(JtJ + lambda*diag(JtJ).inv()"
);
jtjl_inv
.
print
(
18
,
6
);
}
//last_jt has NaNs
// Matrix jty = (new Matrix(last_jt_decimated)).times(y_minus_fx_weighted);
if
(
debug_level
>
2
)
{
System
.
out
.
println
(
"Jt * (y-fx)"
);
jty
.
print
(
18
,
6
);
}
mdelta
=
jtjl_inv
.
times
(
jty
);
}
Matrix
mdelta
=
jtjl_inv
.
times
(
jty
);
if
(
debug_level
>-
2
)
{
System
.
out
.
println
(
"lmaStep(): Matrix inverted in "
+((((
double
)
System
.
nanoTime
())
*
1
E
-
9
)-
matrix_start_time
)+
", used "
+(
use_cholesky
?
"Cholesky"
:
"LU"
));
}
//
/*
CholeskyDecomposition choleskyDecomposition = new CholeskyDecomposition(wjtjlambda);
CholeskyLDLTMulti choleskyLDLTMulti = new CholeskyLDLTMulti(wjtjlambda);
Matrix mdelta_cholesky = choleskyDecomposition.solve(jty);
Matrix mdelta_cholesky_multi = choleskyLDLTMulti.solve(jty);
*/
CholeskyLDLTMulti
.
testCholesky
(
wjtjlambda
,
// Matrix wjtjlambda,
jty
);
if
(
debug_level
>
2
)
{
System
.
out
.
println
(
"mdelta"
);
mdelta
.
print
(
18
,
6
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment