From 72646217fda1b6f15683b37c657f62661f3c88fb Mon Sep 17 00:00:00 2001 From: roeezis Date: Wed, 24 Mar 2021 20:53:44 +0200 Subject: [PATCH 1/4] Fix exploding values Fix non-converging local smoothing filter (with eventual NaN rnorm) --- .settings/org.eclipse.buildship.core.prefs | 13 ++ core/.classpath | 32 +++++ core/.project | 34 +++++ .../org.eclipse.buildship.core.prefs | 2 + core/bin/main/edu/mines/jtk/awt/package.html | 7 + .../bin/main/edu/mines/jtk/bench/package.html | 11 ++ core/bin/main/edu/mines/jtk/dsp/package.html | 7 + .../main/edu/mines/jtk/interp/package.html | 7 + core/bin/main/edu/mines/jtk/io/package.html | 7 + core/bin/main/edu/mines/jtk/la/package.html | 13 ++ .../main/edu/mines/jtk/lapack/package.html | 25 ++++ core/bin/main/edu/mines/jtk/mesh/package.html | 7 + .../edu/mines/jtk/mosaic/TileAxisResizing.txt | 90 +++++++++++++ .../bin/main/edu/mines/jtk/mosaic/Track16.gif | Bin 0 -> 198 bytes core/bin/main/edu/mines/jtk/mosaic/Zoom24.gif | Bin 0 -> 485 bytes .../main/edu/mines/jtk/mosaic/ZoomIn16.gif | Bin 0 -> 304 bytes .../main/edu/mines/jtk/mosaic/package.html | 11 ++ core/bin/main/edu/mines/jtk/ogl/package.html | 11 ++ core/bin/main/edu/mines/jtk/opt/package.html | 8 ++ .../mines/jtk/sgl/AxisAlignedPanelDesign.txt | 95 +++++++++++++ .../edu/mines/jtk/sgl/SelectDragCursor16.png | Bin 0 -> 210 bytes .../edu/mines/jtk/sgl/SelectDragIcon16.png | Bin 0 -> 518 bytes .../edu/mines/jtk/sgl/ViewHandCursor16.png | Bin 0 -> 246 bytes .../main/edu/mines/jtk/sgl/ViewHandIcon16.png | Bin 0 -> 785 bytes core/bin/main/edu/mines/jtk/sgl/package.html | 10 ++ .../mines/jtk/util/CleanHandler.properties | 1 + .../edu/mines/jtk/util/Localize.properties | 10 ++ .../edu/mines/jtk/util/Localize_ch.properties | 8 ++ .../edu/mines/jtk/util/Localize_de.properties | 8 ++ .../edu/mines/jtk/util/Localize_es.properties | 8 ++ .../edu/mines/jtk/util/LogMonitor.properties | 9 ++ .../mines/jtk/util/LogMonitor_ch.properties | 8 ++ .../mines/jtk/util/LogMonitor_de.properties | 6 + .../mines/jtk/util/LogMonitor_es.properties | 6 + .../main/edu/mines/jtk/util/UnitsParser.jj | 125 ++++++++++++++++++ core/bin/main/edu/mines/jtk/util/package.html | 11 ++ .../mines/jtk/util/LocalizeTest.properties | 4 + .../mines/jtk/util/LocalizeTestAlt.properties | 1 + .../mines/jtk/util/LocalizeTest_fr.properties | 4 + .../mines/jtk/dsp/LocalSmoothingFilter.java | 96 +++++++------- demo/.classpath | 18 +++ demo/.project | 34 +++++ .../org.eclipse.buildship.core.prefs | 2 + demo/bin/main/jtkdemo/mosaic/Poles16.png | Bin 0 -> 601 bytes demo/bin/main/jtkdemo/mosaic/Zeros16.png | Bin 0 -> 659 bytes 45 files changed, 701 insertions(+), 48 deletions(-) create mode 100644 .settings/org.eclipse.buildship.core.prefs create mode 100644 core/.classpath create mode 100644 core/.project create mode 100644 core/.settings/org.eclipse.buildship.core.prefs create mode 100644 core/bin/main/edu/mines/jtk/awt/package.html create mode 100644 core/bin/main/edu/mines/jtk/bench/package.html create mode 100644 core/bin/main/edu/mines/jtk/dsp/package.html create mode 100644 core/bin/main/edu/mines/jtk/interp/package.html create mode 100644 core/bin/main/edu/mines/jtk/io/package.html create mode 100644 core/bin/main/edu/mines/jtk/la/package.html create mode 100644 core/bin/main/edu/mines/jtk/lapack/package.html create mode 100644 core/bin/main/edu/mines/jtk/mesh/package.html create mode 100644 core/bin/main/edu/mines/jtk/mosaic/TileAxisResizing.txt create mode 100644 core/bin/main/edu/mines/jtk/mosaic/Track16.gif create mode 100644 core/bin/main/edu/mines/jtk/mosaic/Zoom24.gif create mode 100644 core/bin/main/edu/mines/jtk/mosaic/ZoomIn16.gif create mode 100644 core/bin/main/edu/mines/jtk/mosaic/package.html create mode 100644 core/bin/main/edu/mines/jtk/ogl/package.html create mode 100644 core/bin/main/edu/mines/jtk/opt/package.html create mode 100644 core/bin/main/edu/mines/jtk/sgl/AxisAlignedPanelDesign.txt create mode 100644 core/bin/main/edu/mines/jtk/sgl/SelectDragCursor16.png create mode 100644 core/bin/main/edu/mines/jtk/sgl/SelectDragIcon16.png create mode 100644 core/bin/main/edu/mines/jtk/sgl/ViewHandCursor16.png create mode 100644 core/bin/main/edu/mines/jtk/sgl/ViewHandIcon16.png create mode 100644 core/bin/main/edu/mines/jtk/sgl/package.html create mode 100644 core/bin/main/edu/mines/jtk/util/CleanHandler.properties create mode 100644 core/bin/main/edu/mines/jtk/util/Localize.properties create mode 100644 core/bin/main/edu/mines/jtk/util/Localize_ch.properties create mode 100644 core/bin/main/edu/mines/jtk/util/Localize_de.properties create mode 100644 core/bin/main/edu/mines/jtk/util/Localize_es.properties create mode 100644 core/bin/main/edu/mines/jtk/util/LogMonitor.properties create mode 100644 core/bin/main/edu/mines/jtk/util/LogMonitor_ch.properties create mode 100644 core/bin/main/edu/mines/jtk/util/LogMonitor_de.properties create mode 100644 core/bin/main/edu/mines/jtk/util/LogMonitor_es.properties create mode 100644 core/bin/main/edu/mines/jtk/util/UnitsParser.jj create mode 100644 core/bin/main/edu/mines/jtk/util/package.html create mode 100644 core/bin/test/edu/mines/jtk/util/LocalizeTest.properties create mode 100644 core/bin/test/edu/mines/jtk/util/LocalizeTestAlt.properties create mode 100644 core/bin/test/edu/mines/jtk/util/LocalizeTest_fr.properties create mode 100644 demo/.classpath create mode 100644 demo/.project create mode 100644 demo/.settings/org.eclipse.buildship.core.prefs create mode 100644 demo/bin/main/jtkdemo/mosaic/Poles16.png create mode 100644 demo/bin/main/jtkdemo/mosaic/Zeros16.png diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 00000000..b43a53d9 --- /dev/null +++ b/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,13 @@ +arguments= +auto.sync=false +build.scans.enabled=false +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) +connection.project.dir= +eclipse.preferences.version=1 +gradle.user.home= +java.home=C\:/Program Files/Java/jdk-15.0.2 +jvm.arguments= +offline.mode=false +override.workspace.settings=true +show.console.view=true +show.executions.view=true diff --git a/core/.classpath b/core/.classpath new file mode 100644 index 00000000..93711e04 --- /dev/null +++ b/core/.classpath @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/.project b/core/.project new file mode 100644 index 00000000..7afbf916 --- /dev/null +++ b/core/.project @@ -0,0 +1,34 @@ + + + core + Project core created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1616610733506 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/core/.settings/org.eclipse.buildship.core.prefs b/core/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 00000000..b1886adb --- /dev/null +++ b/core/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=.. +eclipse.preferences.version=1 diff --git a/core/bin/main/edu/mines/jtk/awt/package.html b/core/bin/main/edu/mines/jtk/awt/package.html new file mode 100644 index 00000000..c548b78e --- /dev/null +++ b/core/bin/main/edu/mines/jtk/awt/package.html @@ -0,0 +1,7 @@ + + +awt + +Components for use with the standard Java AWT and Swing packages. + + diff --git a/core/bin/main/edu/mines/jtk/bench/package.html b/core/bin/main/edu/mines/jtk/bench/package.html new file mode 100644 index 00000000..c21ff0a4 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/bench/package.html @@ -0,0 +1,11 @@ + + +bench + +A workbench for experimenting and benchmarking. +When the development of other packages requires experimenting or +benchmarking, we put the programs for those experiments and benchmarks +in this package, so that they are well documented. +The classes in this package should not be used by those in other packages. + + diff --git a/core/bin/main/edu/mines/jtk/dsp/package.html b/core/bin/main/edu/mines/jtk/dsp/package.html new file mode 100644 index 00000000..82077b85 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/dsp/package.html @@ -0,0 +1,7 @@ + + +dsp + +Digital signal processing. + + diff --git a/core/bin/main/edu/mines/jtk/interp/package.html b/core/bin/main/edu/mines/jtk/interp/package.html new file mode 100644 index 00000000..5aa06ca4 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/interp/package.html @@ -0,0 +1,7 @@ + + +interp + +Interpolation and gridding of scattered (irregularly sampled) data. + + diff --git a/core/bin/main/edu/mines/jtk/io/package.html b/core/bin/main/edu/mines/jtk/io/package.html new file mode 100644 index 00000000..2d0e4a64 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/io/package.html @@ -0,0 +1,7 @@ + + +io + +Input/output capabilities not provided by standard packages. + + diff --git a/core/bin/main/edu/mines/jtk/la/package.html b/core/bin/main/edu/mines/jtk/la/package.html new file mode 100644 index 00000000..123f1928 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/la/package.html @@ -0,0 +1,13 @@ + + +la + +Linear algebra. +

+This pure Java package was adapted from the public-domain package Jama, +which was developed by +Joe Hicklin, Cleve Moler, and Peter Webb of The MathWorks, Inc., and by +Ronald Boisvert, Bruce Miller, Roldan Pozo, and Karin Remington of the +National Institue of Standards and Technology. + + diff --git a/core/bin/main/edu/mines/jtk/lapack/package.html b/core/bin/main/edu/mines/jtk/lapack/package.html new file mode 100644 index 00000000..5447d1b9 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/lapack/package.html @@ -0,0 +1,25 @@ + + +lapack + +Linear algebra via LAPACK. +

+This Java package depends on the +netlib-java project, +which has translated LAPACK (Linear Algebra PACKage) Fortran subroutines +into Java methods. +This package works as pure Java, but can also use native implementations +of BLAS and LAPACK if provided. +

+For more information on LAPACK, see +Anderson, E., Bai, Z., Bischof, C., Blackford, S., Demmel, J., Dongarra, J., +Du Croz, J., Greenbaum, A, Hammarling, S, McKenney, A, and Sorensen, D., +1999, LAPACK Users' Guide, 3rd Edition, SIAM. +

+The interface presented by this package is adapted from that of the +public-domain pure Java package Jama, which was developed by +Joe Hicklin, Cleve Moler, and Peter Webb of The MathWorks, Inc., and by +Ronald Boisvert, Bruce Miller, Roldan Pozo, and Karin Remington of the +National Institue of Standards and Technology. + + diff --git a/core/bin/main/edu/mines/jtk/mesh/package.html b/core/bin/main/edu/mines/jtk/mesh/package.html new file mode 100644 index 00000000..cf4dd834 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/mesh/package.html @@ -0,0 +1,7 @@ + + +mesh + +Unstructured meshs of triangles and tetrahedra. + + diff --git a/core/bin/main/edu/mines/jtk/mosaic/TileAxisResizing.txt b/core/bin/main/edu/mines/jtk/mosaic/TileAxisResizing.txt new file mode 100644 index 00000000..1b2293ba --- /dev/null +++ b/core/bin/main/edu/mines/jtk/mosaic/TileAxisResizing.txt @@ -0,0 +1,90 @@ +Dave Hale's notes on the TileAxis resizing problem. + +During layout, a child must provide it's preferred size. +Suppose the child's preferred width depends on its height. +Then, when the parent sets its height, child needs a way +to indicate that its preferred size has changed. The +child cannot invalidate or revalidate itself during a +validate traversal and layout, because validate will +mark the child and its ancestors valid. + +///////////////////////////////////////////////////////////////////////////// +Current solution + +Implement a field revalidatePending and method revalidateLater in +the class TileAxis. The method revalidateLater uses invokeLater to +queue a runnable that will call revalidate *after* the current +validate traversal is complete. This method also sets the field +revalidatePending to true. We must call revalidateLater only in +the method setBounds. Elsewhere we can simply call revalidate. + +Also provide a static method revalidatePending in TileAxis that +will return true if any TileAxis child of a specified container +has the revalidatePending flag set to true. Then, such containers +can delay any processing (using invokeLater) until no revalidates +are pending. + +///////////////////////////////////////////////////////////////////////////// +Important methods + +JComponent.revalidate + Container.invalidate + RepaintManager.addInvalidComponent(this) + +Container.invalidate + tells layout manager to ignore any info cached for this + Component.invalidate + +Component.invalidate + valid = false + nullifies cached prefSize,minSize,maxSize + if parent is valid, + parent.invalidate() + +Container.validate + if not valid: + calls validateTree on self + calls doLayout on self + calls validate on children + valid = true + +Component.validate + if not valid: + calls layout on peer + valid = true + +RepaintManager.addInvalidComponent(this) + maintains a list of components to update + finds validateRoot for this + if validateRoot is already in list, + return + else + adds validateRoot for this to list + queues a request to + validateInvalidComponents + paintDirtyRegions + +RepaintManager.validateInvalidComponents + copies invalidComponents list to ic + sets invalidComponents list to null + for all components c in ic + c.validate() + +///////////////////////////////////////////////////////////////////////////// +Problem, in terms of classes and methods outlined above + +when first validated, axis minimum size is too big +when axis bounds are first set by mosaic doLayout, + axis updates tics, because now it has non-zero size + this update may change axis minimum size + if minimum size changed, revalidate will + set valid=false upwards in tree + add validateRoot to repaint manager's invalid list + after doLayout of mosaic, + Container.validateTree sets valid = true + Container.validate sets valid = true + this setting valid=true will continue up to the validateRoot +therefore, revalidate will have no effect + although validateRoot is in repaint manager's invalid list, + it and its children are marked valid, so validate does nothing! +in summary, calling revalidate within validate/doLayout does not work diff --git a/core/bin/main/edu/mines/jtk/mosaic/Track16.gif b/core/bin/main/edu/mines/jtk/mosaic/Track16.gif new file mode 100644 index 0000000000000000000000000000000000000000..77cee5d62488a7171c04b823251a50722675f9d4 GIT binary patch literal 198 zcmZ?wbhEHb6krfwSoELa|NsAI&itP_^GsUWOa=yq0|yQONgz=C$->CMz{;Ql;(*jL zFk3|Iy5p^<#gwYN@RnrTwi^#}U0;M=2~T5rAjHgIJY~(^kIYl#_ZZusQc+*286*9q zV~K#kOpj&Cj0}qZ{GIa)DvL7HGfEVU3=9kuk}4H~OY;$>7zjVpoqet!<7$n--=5=)~nmBRgym{MJuRgML>E2D7 zPHo(Ha>tGf`}bepx9{4SGf$5my?goc>&us4UAlDd%$e&)k6w8A@Y$6sH$Qy%{P^*+ z88g=>8ZhM9^0wuL9p1kB+@Wn7r`N5TSUIyg>BQ3B^_@kBrq|uyGWXM`PkDKHyu7>z z4jceEf?S~ZlZBCiL7PDbWB|xd3~cKUOfB%xk?KE@62zLYYRYl7XN?;JW?WD_&~!3G zug7_@(}{H<6T6RH5XhHd6$!Z-Yi!nQo)pl)Bv+Ql$05kY!st~ZUfEN@B~a)Uo!HaT z&)ME7(j?8yB)};&(TlaRnRmKyVTTusXmjfVVeXlcEUX(Bva)FUrfKXxsKLk}ui&4? zc=&L-f}GNcG*>MpImL^YoV65{Rc_o&S5Z}$ec+;{t|s%$MONn28<(PwUjiH%6#w}< z=ND8KWu|A8C>R+S7$_uFDg>A2Dfnh47v&dM7MG;v7V9W@<|XSXIOgOi1c4M5D+Hw$ frxul^rs(lKX8IF<1its}i(k literal 0 HcmV?d00001 diff --git a/core/bin/main/edu/mines/jtk/mosaic/ZoomIn16.gif b/core/bin/main/edu/mines/jtk/mosaic/ZoomIn16.gif new file mode 100644 index 0000000000000000000000000000000000000000..2329426e4817c9edf7f8db004d72cc096d0888e0 GIT binary patch literal 304 zcmZ?wbhEHb6krfwIP#wX2>$>7Z(xvUYn#{7GN-F+(To`z=FQu-di9b0`>!88diUnd zPe+elc=+(yl`A(NKYli2=K4efhC|cqczJmb95?{dj~6KZWMO1r5Mj^(sRG%_z#6Wg z+Lsc^B%ClU^RdB!4P6eOeOOdjvj2)OxIR*d@ReD)B=LZ?AqUrigBxyqRp{(w+?YL$ zttr#gbTJFd0|tjCE%tj;N>hU5e3d3u#+ICa|5LD_KCM|*k-=J#LGhozbACZ(QD%BZ ziGq=Vfq_C&r9yCNo`P>?a#4P9WpPPrZn2JnXI`?Nf@4mOLJ&w{u|iO4acWUnYKk5& XmzR&5f_socSZa}ip`HOR7lSnb*>7nx literal 0 HcmV?d00001 diff --git a/core/bin/main/edu/mines/jtk/mosaic/package.html b/core/bin/main/edu/mines/jtk/mosaic/package.html new file mode 100644 index 00000000..ba55be1b --- /dev/null +++ b/core/bin/main/edu/mines/jtk/mosaic/package.html @@ -0,0 +1,11 @@ + + +mosaic + +A system for 2-D graphics. +In this system, 2-D graphics are displayed in a a mosaic of tiles, in which +each tile contains one or more graphical views. +A mosaic aligns these tiles and tiled views so that they share coordinate +systems and zoom and scroll consistently. + + diff --git a/core/bin/main/edu/mines/jtk/ogl/package.html b/core/bin/main/edu/mines/jtk/ogl/package.html new file mode 100644 index 00000000..0e26e1f1 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/ogl/package.html @@ -0,0 +1,11 @@ + + +ogl + +OpenGL for Java, based on JOGL. +

+This package depends on the soon-to-be standard (JSR 231) JOGL packages. +Currently, to use this package, you must obtain the freely-available JAR +files and native code libraries for JOGL from https://jogl.dev.java.net/. + + diff --git a/core/bin/main/edu/mines/jtk/opt/package.html b/core/bin/main/edu/mines/jtk/opt/package.html new file mode 100644 index 00000000..2710f7e5 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/opt/package.html @@ -0,0 +1,8 @@ + + +opt + +Code for Gauss-Newton and conjugate-gradient inversion and optimization. +See documents in doc/opt_package/ for a description of the design and API. + + diff --git a/core/bin/main/edu/mines/jtk/sgl/AxisAlignedPanelDesign.txt b/core/bin/main/edu/mines/jtk/sgl/AxisAlignedPanelDesign.txt new file mode 100644 index 00000000..3c451a80 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/sgl/AxisAlignedPanelDesign.txt @@ -0,0 +1,95 @@ +Dave Hale's notes for design of +AxisAlignedFrame +AxisAlignedPanel +AxisAlignedQuad +AxisAlignedBox +ImagePanel + +///////////////////////////////////////////////////////////////////////////// + +public enum Axis + X,Y,Z + +///////////////////////////////////////////////////////////////////////////// + +public class AxisAlignedBox extends Group implements Selectable, Dragable + constructs six frame children + can get frame for any of six faces of box + moving and resizing with mouse + constructs and manages handles + implements selection and dragging + when corners set explicitly + sets corners of frames + +///////////////////////////////////////////////////////////////////////////// + +public class AxisAlignedQuad extends Group implements Selectable, Dragable + constructs one frame child + can get frame + moving and resizing with mouse + constructs and manages handles + implements selection and dragging + when corners set explicitly + sets corners of frame + +///////////////////////////////////////////////////////////////////////////// + +scenario + user drags quad + quad sets frame corners + frame constrains corners + +scenario + panel added to frame (dirty bsphere and draw) + panel sets box constraint of frame + frame constrains corners (dirty bsphere and draw) + +scenario + panel changes its sampling (dirty bsphere and draw) + panel sets box constraint of frame + frame constrains corners (dirty bsphere and draw) + +///////////////////////////////////////////////////////////////////////////// + +public class AxisAlignedFrame extends Group + typically constructed by parent quad or box + has axis + initialized when frame constructed + accessible and immutable + has corners + initialized when frame constructed + accessible and mutable (dirty bsphere and draw) + when a child panel is added + ensures panel's frame is currently null + sets panel's frame to this + when a child panel is removed + ensures panel's frame is this frame + sets panel's frame to null + has a box constraint (null if none) + typically set by panels + last constraint set rules + +///////////////////////////////////////////////////////////////////////////// + +public class AxisAlignedPanel extends Node + may be constructed with a frame or not + when non-null frame is set (when child panel is added to frame) + gets its box constraint (default is null; may be overridden) + if not null, sets box constraint of frame + if parent is a frame + implements pick and computeBoundingSphere + using frame axis and corners + else + does not implement pick or computeBoundingSphere + +///////////////////////////////////////////////////////////////////////////// + +public class ImagePanel extends AxisAlignedPanel + constructed with samplings and floats + knows what box constraint + when sampling changes + sets box constraint of frame + has a cache of textures + implements draw + if necessary, updates texture cache + draws textures diff --git a/core/bin/main/edu/mines/jtk/sgl/SelectDragCursor16.png b/core/bin/main/edu/mines/jtk/sgl/SelectDragCursor16.png new file mode 100644 index 0000000000000000000000000000000000000000..cf1a244415782154d5ed978093fe8de2f5fcb5d6 GIT binary patch literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=DjSL74G){)!Z!AbW|YuPggiHgOSYMWdU!mw-a?o-U3d6}R?YJjiuGfrt5m%A5c7 zmb>351i5=1ytnFErXWLt^fp7y{zlD5`gh&7Xe!)v3b9$*`oh4!=S9A;V@QjGk=s1m zJ=@w#L)!OzSvMhtWtk$2`H}Sj!tZJyPpx9yKF5M_eM{UDpj8Z>u6{1-oD!M<4oOKX literal 0 HcmV?d00001 diff --git a/core/bin/main/edu/mines/jtk/sgl/SelectDragIcon16.png b/core/bin/main/edu/mines/jtk/sgl/SelectDragIcon16.png new file mode 100644 index 0000000000000000000000000000000000000000..d905ef33bf0055db25a73e9bc294de9f6e0e14e9 GIT binary patch literal 518 zcmV+h0{Q)kP)VGd000McNliru)dm+69T%>4Nk{+y0h38Y zK~#9!ozo#}96=Po@&AM=yoD5YUE;bT&?`jT5pzdO56;}eiCfpGHs7FWU1g~XRjo|E z!NwG>s;LNU+(iU(qT*ysp(6tK#K2bUb}Di?l8hYQy!U%=X3W*)6jiN6#PEo2;-sirTd7$spcXji(3=IxQ=zln;^6&3Bbl$1{1>S5 z=f=@{nW3s7ARp(H=VcYIFMlWYpWxbE^YPOms)|_Q==h6?;{*T!)YtpBZ=n&qd;5X@ zphtJ7je6zu=Xr${k|ag}L6)`=X0ZQyk8~q7*=Ptr@vQ(~w;~o4W!crPi4{8Cp4r^o zFo@9I?VI#jiu>(2Ju54*QIkYgyaNkZNTP`73GBal1;FI{1Z9C(LA~BS?HhquA(jLL z;`M~#AT!}(`MU>*1v9-ULxoVugX$v0i9}$VHauY#FSa}U1p)`E{uX_o?=O?0SP z`%m}wCfx%YrL9)Z(3z^YZTc*+D?#k<(rsANHonkV-{DrGAE39VGd000McNliru)dm+5IWYTHcd`Hg0-i}k zK~#9!ZIeHU6jvO_KeHL(4Jhmw7jEE$OqY=e?qZ5tV&Q;>yCX#mShyi5HVL*?VkJu| z4=XF(D(s~=G!Qsbd60j*g<-Ea*a;YzgDalk!F!N__X8(PikUqv{8g{`{=WbCJ#W4@ z<9(C8%$dEIRY4Gtd>ng8lDrq^A1!1Vv%Ps0h9U8C@#Q zlGy8>?Lk>@w-yAmy?HgfH{{lLw-9mF?p_AK(y55q?wp%9ZZf#~6;HOFRqsms08$F^ z=@aotWxP4Af*_=OF7a9b%2&i6Mc(dTQvlY!xI(^PFG(r2 z-DcbyM|v@3Z8hcLqfymbfWk05QUX|8U8^7ETM`iiKyRf_w7i6QZSb=!B#f2Ghqd4kS|9j1Ry+4=Q1T8lQ-amD19=ZGxqHrYjpmLfzf$`6R+nEanP zlNU33-5%cL_vdUs+o|r}xeZD+g*7B)9YIP5BA7xD5%Pna;l29|z8QEeTGEh2(`t;zn*5fQqdBz1&1j%l~s-o}FsL=47iTwySW8YwK+8l-R- zW61Y4+dpqJxHj+vY67JK;^hc^pqXbGQV3Giinefw1LtZ-T5F^by5|$ZKsBfAE5c5j z^it}L9*xll8f^?B4(9|{N<$_*-Fiy8ntF?SX(?Z!8W&Ng&H8HUjeZ=1fcsaPP6TTW z`F@T*)T9^sD5X$-@b)h#Um;B&)>^FCqZ5`A^r2-kozU<0z=z + +sgl + +A scene graph for interactive 3-D graphics via OpenGL. Unlike some +systems for scientific visualization, this scene graph is designed +for interactive editing, typically by selecting and dragging objects +with a mouse or some other pointing device. + + diff --git a/core/bin/main/edu/mines/jtk/util/CleanHandler.properties b/core/bin/main/edu/mines/jtk/util/CleanHandler.properties new file mode 100644 index 00000000..98b32273 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/util/CleanHandler.properties @@ -0,0 +1 @@ +testmessage=Substituted string diff --git a/core/bin/main/edu/mines/jtk/util/Localize.properties b/core/bin/main/edu/mines/jtk/util/Localize.properties new file mode 100644 index 00000000..2980cc0f --- /dev/null +++ b/core/bin/main/edu/mines/jtk/util/Localize.properties @@ -0,0 +1,10 @@ +second=second +seconds=seconds +minute=minute +minutes=minutes +hour=hour +hours=hours +day=day +days=days + + diff --git a/core/bin/main/edu/mines/jtk/util/Localize_ch.properties b/core/bin/main/edu/mines/jtk/util/Localize_ch.properties new file mode 100644 index 00000000..7561299f --- /dev/null +++ b/core/bin/main/edu/mines/jtk/util/Localize_ch.properties @@ -0,0 +1,8 @@ +second=秒 +seconds=秒 +minute=分 +minutes=分 +hour=小时 +hours=小时 +day=天 +days=天 diff --git a/core/bin/main/edu/mines/jtk/util/Localize_de.properties b/core/bin/main/edu/mines/jtk/util/Localize_de.properties new file mode 100644 index 00000000..8716dc94 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/util/Localize_de.properties @@ -0,0 +1,8 @@ +second=Sekunde +seconds=Sekunden +minute=Minute +minutes=Minuten +hour=Stunde +hours=Stunden +day=Tag +days=Tage diff --git a/core/bin/main/edu/mines/jtk/util/Localize_es.properties b/core/bin/main/edu/mines/jtk/util/Localize_es.properties new file mode 100644 index 00000000..64e0a1d6 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/util/Localize_es.properties @@ -0,0 +1,8 @@ +second=secundo +seconds=secundos +minute=minuto +minutes=minutos +hour=hora +hours=horas +day=dia +days=dias diff --git a/core/bin/main/edu/mines/jtk/util/LogMonitor.properties b/core/bin/main/edu/mines/jtk/util/LogMonitor.properties new file mode 100644 index 00000000..295f863e --- /dev/null +++ b/core/bin/main/edu/mines/jtk/util/LogMonitor.properties @@ -0,0 +1,9 @@ +Test=Test +progress=progress +complete_at=complete at +remaining=remaining +total=total +so_far=so far +Finished_in=Finished in + + diff --git a/core/bin/main/edu/mines/jtk/util/LogMonitor_ch.properties b/core/bin/main/edu/mines/jtk/util/LogMonitor_ch.properties new file mode 100644 index 00000000..3fb027c5 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/util/LogMonitor_ch.properties @@ -0,0 +1,8 @@ +Test=实验 +progress=进步 +complete_at=做了 +remaining=省下 +total=一共 +so_far=到现在 +Finished_in=一共用了 + diff --git a/core/bin/main/edu/mines/jtk/util/LogMonitor_de.properties b/core/bin/main/edu/mines/jtk/util/LogMonitor_de.properties new file mode 100644 index 00000000..db0bdcb7 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/util/LogMonitor_de.properties @@ -0,0 +1,6 @@ +progress=Fortschritt +complete_at=beendet um +remaining=verbleibend +total=insgesammt +so_far=mittlerweile +Finished_in=in beendet diff --git a/core/bin/main/edu/mines/jtk/util/LogMonitor_es.properties b/core/bin/main/edu/mines/jtk/util/LogMonitor_es.properties new file mode 100644 index 00000000..5bbab4b6 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/util/LogMonitor_es.properties @@ -0,0 +1,6 @@ +progress=progresso +complete_at=completo a +remaining=se quedan +total=total +so_far=hasta ahora +Finished_in=terminado en diff --git a/core/bin/main/edu/mines/jtk/util/UnitsParser.jj b/core/bin/main/edu/mines/jtk/util/UnitsParser.jj new file mode 100644 index 00000000..07651fe3 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/util/UnitsParser.jj @@ -0,0 +1,125 @@ +options { + STATIC=true; +} + +PARSER_BEGIN(UnitsParser) +package edu.mines.jtk.util; + +import java.io.*; + +/** + * Parser (generated from UnitsParser.jj via JavaCC) to create Units + * from a string that conforms to the following (extended BNF) grammar: + *

+ * unit -> expr EOF
+ * expr -> term ( ("+" | "-") (DOUBLE|INTEGER) )?
+ * term -> factor ( ("*")? factor | "/" factor )*
+ * factor -> primary ("^" INTEGER)?
+ * primary -> NAME | (DOUBLE|INTEGER) | "(" expr ")"
+ * 
+ * + * @author Dave Hale + * @version 1998.07.06 + */ +final class UnitsParser { + + /** + * Parse a String containing a unit definition. + * @param the unit definition, as in "coulomb/volt". + * @exception ParseException if the definition is not valid. + */ + static synchronized Units parse(String definition) throws ParseException { + ReInit(new StringReader(definition)); + return units(); + } +} + +PARSER_END(UnitsParser) + +SKIP : { + " " + | "\t" +} + +TOKEN : { + < PLUS: "+" > + | < MINUS: "-" > + | < MUL: ("*"|".") > + | < DIV: ("/"|"per"|"PER") > + | < POW: ("^"|"**") > + | < LP: "(" > + | < RP: ")" > + | < NAME: "%" | ()*(()+()+)* > + | < INTEGER: ("-")?()+ > + | < DOUBLE: ("-")?(["e","E"](["-","+"])?)? > + | < #ALPHA: | "_" > + | < #LETTER: ["a"-"z","A"-"Z"] > + | < #FLOAT: | (".")? | "." > + | < #DIGIT: ["0"-"9"] > +} + +Units units() : { + Units e; +} { + e=expr() { + return e; + } +} + +Units expr() : { + Units t; + Token n; +} { + t=term() ( + (n=|n=) { + t.shift(Double.valueOf(n.image).doubleValue()); + } | (n=|n=) { + t.shift(-Double.valueOf(n.image).doubleValue()); + } + )? { + return t; + } +} + +Units term() : { + Units f,fb; +} { + f=factor() ( + ()? fb=factor() { + f.mul(fb); + } |
fb=factor() { + f.div(fb); + } + )* { + return f; + } +} + +Units factor() : { + Units p; + Token n; +} { + p=primary() ( + n= { + p.pow(Integer.valueOf(n.image).intValue()); + } + )? { + return p; + } +} + +Units primary() : { + Units e,p; + Token n; +} { + n= { + p = Units.unitsFromName(n.image); + if (p==null) throw new ParseException("Units \""+n.image+"\" are undefined."); + return p; + } | (n=|n=) { + double d = (new Double(n.image)).doubleValue(); + return (new Units()).scale(d); + } | e=expr() { + return e; + } +} diff --git a/core/bin/main/edu/mines/jtk/util/package.html b/core/bin/main/edu/mines/jtk/util/package.html new file mode 100644 index 00000000..d1fe6e01 --- /dev/null +++ b/core/bin/main/edu/mines/jtk/util/package.html @@ -0,0 +1,11 @@ + + +util + +Generally useful utilities. +Classes in this package are likely to be used by classes in one or more +other packages. +Classes in this package reference no other classes except those in this +package and those in standard Java packages. + + diff --git a/core/bin/test/edu/mines/jtk/util/LocalizeTest.properties b/core/bin/test/edu/mines/jtk/util/LocalizeTest.properties new file mode 100644 index 00000000..e4f537b7 --- /dev/null +++ b/core/bin/test/edu/mines/jtk/util/LocalizeTest.properties @@ -0,0 +1,4 @@ +junk = foo +msg1 = A number %g here, and another #%d +junk2 = bar + diff --git a/core/bin/test/edu/mines/jtk/util/LocalizeTestAlt.properties b/core/bin/test/edu/mines/jtk/util/LocalizeTestAlt.properties new file mode 100644 index 00000000..6f38938b --- /dev/null +++ b/core/bin/test/edu/mines/jtk/util/LocalizeTestAlt.properties @@ -0,0 +1 @@ +msg1=A custom file with number %g, and another #%d diff --git a/core/bin/test/edu/mines/jtk/util/LocalizeTest_fr.properties b/core/bin/test/edu/mines/jtk/util/LocalizeTest_fr.properties new file mode 100644 index 00000000..dc5f5b44 --- /dev/null +++ b/core/bin/test/edu/mines/jtk/util/LocalizeTest_fr.properties @@ -0,0 +1,4 @@ +junk = foo +msg1 = Un nombre %g ici, et un autre #%d +junk2 = bar + diff --git a/core/src/main/java/edu/mines/jtk/dsp/LocalSmoothingFilter.java b/core/src/main/java/edu/mines/jtk/dsp/LocalSmoothingFilter.java index 25159822..98029cea 100644 --- a/core/src/main/java/edu/mines/jtk/dsp/LocalSmoothingFilter.java +++ b/core/src/main/java/edu/mines/jtk/dsp/LocalSmoothingFilter.java @@ -77,7 +77,7 @@ public LocalSmoothingFilter() { * @param niter stop when number of iterations exceeds this limit. */ public LocalSmoothingFilter(double small, int niter) { - _small = (float)small; + _small = small; _niter = niter; _ldk = new LocalDiffusionKernel(LocalDiffusionKernel.Stencil.D22); } @@ -92,7 +92,7 @@ public LocalSmoothingFilter(double small, int niter) { public LocalSmoothingFilter( double small, int niter, LocalDiffusionKernel ldk) { - _small = (float)small; + _small = small; _niter = niter; _ldk = ldk; } @@ -361,7 +361,7 @@ public void applySmoothL(double kmax, float[][][] x, float[][][] y) { private static Logger log = Logger.getLogger(LocalSmoothingFilter.class.getName()); - private float _small; // stop iterations when residuals are small + private double _small; // stop iterations when residuals are small private int _niter; // number of iterations private boolean _pc; // true, for preconditioned CG iterations private LocalDiffusionKernel _ldk; // computes y += (I+G'DG)x @@ -618,23 +618,23 @@ private void solve(Operator2 a, float[][] b, float[][] x) { a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax scopy(r,d); // d = r - float delta = sdot(r,r); // delta = r'r - float bnorm = sqrt(sdot(b,b)); - float rnorm = sqrt(delta); - float rnormBegin = rnorm; - float rnormSmall = bnorm*_small; + double delta = sdot(r,r); // delta = r'r + double bnorm = sqrt(sdot(b,b)); + double rnorm = sqrt(delta); + double rnormBegin = rnorm; + double rnormSmall = bnorm*_small; int iter; log.fine("solve: bnorm="+bnorm+" rnorm="+rnorm); for (iter=0; iter<_niter && rnorm>rnormSmall; ++iter) { log.finer(" iter="+iter+" rnorm="+rnorm+" ratio="+rnorm/rnormBegin); a.apply(d,q); // q = Ad - float dq = sdot(d,q); // d'q = d'Ad - float alpha = delta/dq; // alpha = r'r/d'Ad + double dq = sdot(d,q); // d'q = d'Ad + double alpha = delta/dq; // alpha = r'r/d'Ad saxpy( alpha,d,x); // x = x+alpha*d saxpy(-alpha,q,r); // r = r-alpha*q - float deltaOld = delta; + double deltaOld = delta; delta = sdot(r,r); // delta = r'r - float beta = delta/deltaOld; + double beta = delta/deltaOld; sxpay(beta,r,d); // d = r+beta*d rnorm = sqrt(delta); } @@ -649,27 +649,27 @@ private void solve(Operator3 a, float[][][] b, float[][][] x) { float[][][] r = new float[n3][n2][n1]; scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax scopy(r,d); - float delta = sdot(r,r); - float bnorm = sqrt(sdot(b,b)); - float rnorm = sqrt(delta); - float rnormBegin = rnorm; - float rnormSmall = bnorm*_small; + double delta = sdot(r,r); + double bnorm = sqrt(sdot(b,b)); + double rnorm = sqrt(delta); + double rnormBegin = rnorm; + double rnormSmall = bnorm*_small; int iter; log.fine("solve: bnorm="+bnorm+" rnorm="+rnorm); for (iter=0; iter<_niter && rnorm>rnormSmall; ++iter) { log.finer(" iter="+iter+" rnorm="+rnorm+" ratio="+rnorm/rnormBegin); a.apply(d,q); - float dq = sdot(d,q); - float alpha = delta/dq; + double dq = sdot(d,q); + double alpha = delta/dq; saxpy( alpha,d,x); if (iter%100<99) { saxpy(-alpha,q,r); } else { scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); } - float deltaOld = delta; + double deltaOld = delta; delta = sdot(r,r); - float beta = delta/deltaOld; + double beta = delta/deltaOld; sxpay(beta,r,d); rnorm = sqrt(delta); } @@ -688,25 +688,25 @@ private void solve(Operator2 a, Operator2 m, float[][] b, float[][] x) { scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax - float bnorm = sqrt(sdot(b,b)); - float rnorm = sqrt(sdot(r,r)); - float rnormBegin = rnorm; - float rnormSmall = bnorm*_small; + double bnorm = sqrt(sdot(b,b)); + double rnorm = sqrt(sdot(r,r)); + double rnormBegin = rnorm; + double rnormSmall = bnorm*_small; m.apply(r,s); // s = Mr scopy(s,d); // d = s - float delta = sdot(r,s); // r's = r'Mr + double delta = sdot(r,s); // r's = r'Mr int iter; log.fine("msolve: bnorm="+bnorm+" rnorm="+rnorm); for (iter=0; iter<_niter && rnorm>rnormSmall; ++iter) { log.finer(" iter="+iter+" rnorm="+rnorm+" ratio="+rnorm/rnormBegin); a.apply(d,q); // q = Ad - float alpha = delta/sdot(d,q); // alpha = r'Mr/d'Ad + double alpha = delta/sdot(d,q); // alpha = r'Mr/d'Ad saxpy( alpha,d,x); // x = x+alpha*d saxpy(-alpha,q,r); // r = r-alpha*q m.apply(r,s); // s = Mr - float deltaOld = delta; + double deltaOld = delta; delta = sdot(r,s); // delta = r's = r'Mr - float beta = delta/deltaOld; + double beta = delta/deltaOld; sxpay(beta,s,d); // d = s+beta*d rnorm = sqrt(sdot(r,r)); } @@ -721,19 +721,19 @@ private void solve(Operator3 a, Operator3 m, float[][][] b, float[][][] x) { float[][][] r = new float[n3][n2][n1]; float[][][] s = new float[n3][n2][n1]; scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax - float bnorm = sqrt(sdot(b,b)); - float rnorm = sqrt(sdot(r,r)); - float rnormBegin = rnorm; - float rnormSmall = bnorm*_small; + double bnorm = sqrt(sdot(b,b)); + double rnorm = sqrt(sdot(r,r)); + double rnormBegin = rnorm; + double rnormSmall = bnorm*_small; m.apply(r,s); // s = Mr scopy(s,d); // d = s - float delta = sdot(r,s); // r's = r'Mr + double delta = sdot(r,s); // r's = r'Mr int iter; log.fine("msolve: bnorm="+bnorm+" rnorm="+rnorm); for (iter=0; iter<_niter && rnorm>rnormSmall; ++iter) { log.finer(" iter="+iter+" rnorm="+rnorm+" ratio="+rnorm/rnormBegin); a.apply(d,q); // q = Ad - float alpha = delta/sdot(d,q); // alpha = r'Mr/d'Ad + double alpha = delta/sdot(d,q); // alpha = r'Mr/d'Ad saxpy( alpha,d,x); // x = x+alpha*d if (iter%100<99) { saxpy(-alpha,q,r); // r = r-alpha*q @@ -741,9 +741,9 @@ private void solve(Operator3 a, Operator3 m, float[][][] b, float[][][] x) { scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax } m.apply(r,s); // s = Mr - float deltaOld = delta; + double deltaOld = delta; delta = sdot(r,s); // delta = r's = r'Mr - float beta = delta/deltaOld; + double beta = delta/deltaOld; sxpay(beta,s,d); // d = s+beta*d rnorm = sqrt(sdot(r,r)); } @@ -783,34 +783,34 @@ public void compute(int i3) { } // Returns the dot product x'y. - private static float sdot(float[][] x, float[][] y) { + private static double sdot(float[][] x, float[][] y) { int n1 = x[0].length; int n2 = x.length; - float d = 0.0f; + double d = 0.0; for (int i2=0; i2 + + + + + + + + + + + + + + + + + diff --git a/demo/.project b/demo/.project new file mode 100644 index 00000000..37b17810 --- /dev/null +++ b/demo/.project @@ -0,0 +1,34 @@ + + + demo + Project demo created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1616610733513 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/demo/.settings/org.eclipse.buildship.core.prefs b/demo/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 00000000..b1886adb --- /dev/null +++ b/demo/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=.. +eclipse.preferences.version=1 diff --git a/demo/bin/main/jtkdemo/mosaic/Poles16.png b/demo/bin/main/jtkdemo/mosaic/Poles16.png new file mode 100644 index 0000000000000000000000000000000000000000..344582b6386994260cefc553b981eee6ab074f56 GIT binary patch literal 601 zcmV-f0;c_mP)VGd000McNliru)&~p#DjsDa$8i7v0p>|W zK~#9!m6N}V6HySyKO0tfue&V{44lPwdB+L9kj4X>6v7=?n9fU)La{mRtmG;QR>8l( zCXuxelB+`C4ue%J0((UuTUcx(7*NTWCbEtgu-7+k)=ruq% znbLgI#BrQ8`m^UR{>oT;T+0C5Tm@!f@bCCIj?=JyZFav#@3My~`E4mZ^gRXBNl1=| z2JjhZ?FepJTLT~*k2rmFN?}z&F7pjg1A<&|V0AaE>WT-qNq#1{Q54a=?B_GR0*b&x zU|@9>;L6$nm>ZK3aQ^a~<#M^J-vKbUGT1hDKLzNDrm&gA|Gm*Tq^!#n>a`jduP?Uk zfi3%smC6<;46lbMr6>qja;W@mw(r}XPpn*7-FiC481#|KTJU{8KSmAofO-zJZgqM! z#`;+u0~vr2l76qda_;2W-kMGaKp$yzMd3-2?E$X9+ux(x>$d-~g#c|;Qtj$Vb#qL@ z71>Wniu(|B-qXJx^7Kj8!D`9UG$H;zqxG&u^}#Vh2!ty)w;)`Bv3#UyN@~*V;sCRN nAHPyYUq>A4?2zOw0WSOjfoPx-j>kxX00000NkvXXu0mjfEP@Bm literal 0 HcmV?d00001 diff --git a/demo/bin/main/jtkdemo/mosaic/Zeros16.png b/demo/bin/main/jtkdemo/mosaic/Zeros16.png new file mode 100644 index 0000000000000000000000000000000000000000..f9f9016d46a60ca4b4b7714dc01da0f31d4b0f35 GIT binary patch literal 659 zcmV;E0&M+>P)VGd000McNliru)&~p#CKw?1El28q-6$FS4< z+`_ASSeAuMI!Gyp^2~lhvx(<7ux%S>GC>dqLghH)Nv1e^snfgLSy z8Mp^rEx#+jlu74{W!bnFB{X~wJqH_D0oH)&A?;3UYz45rdX4#8^ThsE0HlF2;4N@C zMBq?kV?a7Fd5+*mK&;tpQh2@wkOYnapZ_0UbCO-9z=T-!Lyh8A5nvqn4TK{ELd_Z9 zukWLjA~x6q3OEhKM+n3cX*W$Qm(8;LWEtQ9I0K|c2&6RUpt@Z}N=ZzZ7BkWT z*aJ=gizBwMs5yH|Dco7vYr%0GfFoc7m;%;;o4VwstWt6#| z8JJ0!q8AB^!~_&yzlti`)z1Apxz0bIj4%vneQi^CQ6O_=4j}}>v<6-fra Date: Wed, 24 Mar 2021 21:04:28 +0200 Subject: [PATCH 2/4] Revert "Fix exploding values" This reverts commit 72646217fda1b6f15683b37c657f62661f3c88fb. --- .settings/org.eclipse.buildship.core.prefs | 13 -- core/.classpath | 32 ----- core/.project | 34 ----- .../org.eclipse.buildship.core.prefs | 2 - core/bin/main/edu/mines/jtk/awt/package.html | 7 - .../bin/main/edu/mines/jtk/bench/package.html | 11 -- core/bin/main/edu/mines/jtk/dsp/package.html | 7 - .../main/edu/mines/jtk/interp/package.html | 7 - core/bin/main/edu/mines/jtk/io/package.html | 7 - core/bin/main/edu/mines/jtk/la/package.html | 13 -- .../main/edu/mines/jtk/lapack/package.html | 25 ---- core/bin/main/edu/mines/jtk/mesh/package.html | 7 - .../edu/mines/jtk/mosaic/TileAxisResizing.txt | 90 ------------- .../bin/main/edu/mines/jtk/mosaic/Track16.gif | Bin 198 -> 0 bytes core/bin/main/edu/mines/jtk/mosaic/Zoom24.gif | Bin 485 -> 0 bytes .../main/edu/mines/jtk/mosaic/ZoomIn16.gif | Bin 304 -> 0 bytes .../main/edu/mines/jtk/mosaic/package.html | 11 -- core/bin/main/edu/mines/jtk/ogl/package.html | 11 -- core/bin/main/edu/mines/jtk/opt/package.html | 8 -- .../mines/jtk/sgl/AxisAlignedPanelDesign.txt | 95 ------------- .../edu/mines/jtk/sgl/SelectDragCursor16.png | Bin 210 -> 0 bytes .../edu/mines/jtk/sgl/SelectDragIcon16.png | Bin 518 -> 0 bytes .../edu/mines/jtk/sgl/ViewHandCursor16.png | Bin 246 -> 0 bytes .../main/edu/mines/jtk/sgl/ViewHandIcon16.png | Bin 785 -> 0 bytes core/bin/main/edu/mines/jtk/sgl/package.html | 10 -- .../mines/jtk/util/CleanHandler.properties | 1 - .../edu/mines/jtk/util/Localize.properties | 10 -- .../edu/mines/jtk/util/Localize_ch.properties | 8 -- .../edu/mines/jtk/util/Localize_de.properties | 8 -- .../edu/mines/jtk/util/Localize_es.properties | 8 -- .../edu/mines/jtk/util/LogMonitor.properties | 9 -- .../mines/jtk/util/LogMonitor_ch.properties | 8 -- .../mines/jtk/util/LogMonitor_de.properties | 6 - .../mines/jtk/util/LogMonitor_es.properties | 6 - .../main/edu/mines/jtk/util/UnitsParser.jj | 125 ------------------ core/bin/main/edu/mines/jtk/util/package.html | 11 -- .../mines/jtk/util/LocalizeTest.properties | 4 - .../mines/jtk/util/LocalizeTestAlt.properties | 1 - .../mines/jtk/util/LocalizeTest_fr.properties | 4 - .../mines/jtk/dsp/LocalSmoothingFilter.java | 96 +++++++------- demo/.classpath | 18 --- demo/.project | 34 ----- .../org.eclipse.buildship.core.prefs | 2 - demo/bin/main/jtkdemo/mosaic/Poles16.png | Bin 601 -> 0 bytes demo/bin/main/jtkdemo/mosaic/Zeros16.png | Bin 659 -> 0 bytes 45 files changed, 48 insertions(+), 701 deletions(-) delete mode 100644 .settings/org.eclipse.buildship.core.prefs delete mode 100644 core/.classpath delete mode 100644 core/.project delete mode 100644 core/.settings/org.eclipse.buildship.core.prefs delete mode 100644 core/bin/main/edu/mines/jtk/awt/package.html delete mode 100644 core/bin/main/edu/mines/jtk/bench/package.html delete mode 100644 core/bin/main/edu/mines/jtk/dsp/package.html delete mode 100644 core/bin/main/edu/mines/jtk/interp/package.html delete mode 100644 core/bin/main/edu/mines/jtk/io/package.html delete mode 100644 core/bin/main/edu/mines/jtk/la/package.html delete mode 100644 core/bin/main/edu/mines/jtk/lapack/package.html delete mode 100644 core/bin/main/edu/mines/jtk/mesh/package.html delete mode 100644 core/bin/main/edu/mines/jtk/mosaic/TileAxisResizing.txt delete mode 100644 core/bin/main/edu/mines/jtk/mosaic/Track16.gif delete mode 100644 core/bin/main/edu/mines/jtk/mosaic/Zoom24.gif delete mode 100644 core/bin/main/edu/mines/jtk/mosaic/ZoomIn16.gif delete mode 100644 core/bin/main/edu/mines/jtk/mosaic/package.html delete mode 100644 core/bin/main/edu/mines/jtk/ogl/package.html delete mode 100644 core/bin/main/edu/mines/jtk/opt/package.html delete mode 100644 core/bin/main/edu/mines/jtk/sgl/AxisAlignedPanelDesign.txt delete mode 100644 core/bin/main/edu/mines/jtk/sgl/SelectDragCursor16.png delete mode 100644 core/bin/main/edu/mines/jtk/sgl/SelectDragIcon16.png delete mode 100644 core/bin/main/edu/mines/jtk/sgl/ViewHandCursor16.png delete mode 100644 core/bin/main/edu/mines/jtk/sgl/ViewHandIcon16.png delete mode 100644 core/bin/main/edu/mines/jtk/sgl/package.html delete mode 100644 core/bin/main/edu/mines/jtk/util/CleanHandler.properties delete mode 100644 core/bin/main/edu/mines/jtk/util/Localize.properties delete mode 100644 core/bin/main/edu/mines/jtk/util/Localize_ch.properties delete mode 100644 core/bin/main/edu/mines/jtk/util/Localize_de.properties delete mode 100644 core/bin/main/edu/mines/jtk/util/Localize_es.properties delete mode 100644 core/bin/main/edu/mines/jtk/util/LogMonitor.properties delete mode 100644 core/bin/main/edu/mines/jtk/util/LogMonitor_ch.properties delete mode 100644 core/bin/main/edu/mines/jtk/util/LogMonitor_de.properties delete mode 100644 core/bin/main/edu/mines/jtk/util/LogMonitor_es.properties delete mode 100644 core/bin/main/edu/mines/jtk/util/UnitsParser.jj delete mode 100644 core/bin/main/edu/mines/jtk/util/package.html delete mode 100644 core/bin/test/edu/mines/jtk/util/LocalizeTest.properties delete mode 100644 core/bin/test/edu/mines/jtk/util/LocalizeTestAlt.properties delete mode 100644 core/bin/test/edu/mines/jtk/util/LocalizeTest_fr.properties delete mode 100644 demo/.classpath delete mode 100644 demo/.project delete mode 100644 demo/.settings/org.eclipse.buildship.core.prefs delete mode 100644 demo/bin/main/jtkdemo/mosaic/Poles16.png delete mode 100644 demo/bin/main/jtkdemo/mosaic/Zeros16.png diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs deleted file mode 100644 index b43a53d9..00000000 --- a/.settings/org.eclipse.buildship.core.prefs +++ /dev/null @@ -1,13 +0,0 @@ -arguments= -auto.sync=false -build.scans.enabled=false -connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) -connection.project.dir= -eclipse.preferences.version=1 -gradle.user.home= -java.home=C\:/Program Files/Java/jdk-15.0.2 -jvm.arguments= -offline.mode=false -override.workspace.settings=true -show.console.view=true -show.executions.view=true diff --git a/core/.classpath b/core/.classpath deleted file mode 100644 index 93711e04..00000000 --- a/core/.classpath +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core/.project b/core/.project deleted file mode 100644 index 7afbf916..00000000 --- a/core/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - core - Project core created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1616610733506 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/core/.settings/org.eclipse.buildship.core.prefs b/core/.settings/org.eclipse.buildship.core.prefs deleted file mode 100644 index b1886adb..00000000 --- a/core/.settings/org.eclipse.buildship.core.prefs +++ /dev/null @@ -1,2 +0,0 @@ -connection.project.dir=.. -eclipse.preferences.version=1 diff --git a/core/bin/main/edu/mines/jtk/awt/package.html b/core/bin/main/edu/mines/jtk/awt/package.html deleted file mode 100644 index c548b78e..00000000 --- a/core/bin/main/edu/mines/jtk/awt/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -awt - -Components for use with the standard Java AWT and Swing packages. - - diff --git a/core/bin/main/edu/mines/jtk/bench/package.html b/core/bin/main/edu/mines/jtk/bench/package.html deleted file mode 100644 index c21ff0a4..00000000 --- a/core/bin/main/edu/mines/jtk/bench/package.html +++ /dev/null @@ -1,11 +0,0 @@ - - -bench - -A workbench for experimenting and benchmarking. -When the development of other packages requires experimenting or -benchmarking, we put the programs for those experiments and benchmarks -in this package, so that they are well documented. -The classes in this package should not be used by those in other packages. - - diff --git a/core/bin/main/edu/mines/jtk/dsp/package.html b/core/bin/main/edu/mines/jtk/dsp/package.html deleted file mode 100644 index 82077b85..00000000 --- a/core/bin/main/edu/mines/jtk/dsp/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -dsp - -Digital signal processing. - - diff --git a/core/bin/main/edu/mines/jtk/interp/package.html b/core/bin/main/edu/mines/jtk/interp/package.html deleted file mode 100644 index 5aa06ca4..00000000 --- a/core/bin/main/edu/mines/jtk/interp/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -interp - -Interpolation and gridding of scattered (irregularly sampled) data. - - diff --git a/core/bin/main/edu/mines/jtk/io/package.html b/core/bin/main/edu/mines/jtk/io/package.html deleted file mode 100644 index 2d0e4a64..00000000 --- a/core/bin/main/edu/mines/jtk/io/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -io - -Input/output capabilities not provided by standard packages. - - diff --git a/core/bin/main/edu/mines/jtk/la/package.html b/core/bin/main/edu/mines/jtk/la/package.html deleted file mode 100644 index 123f1928..00000000 --- a/core/bin/main/edu/mines/jtk/la/package.html +++ /dev/null @@ -1,13 +0,0 @@ - - -la - -Linear algebra. -

-This pure Java package was adapted from the public-domain package Jama, -which was developed by -Joe Hicklin, Cleve Moler, and Peter Webb of The MathWorks, Inc., and by -Ronald Boisvert, Bruce Miller, Roldan Pozo, and Karin Remington of the -National Institue of Standards and Technology. - - diff --git a/core/bin/main/edu/mines/jtk/lapack/package.html b/core/bin/main/edu/mines/jtk/lapack/package.html deleted file mode 100644 index 5447d1b9..00000000 --- a/core/bin/main/edu/mines/jtk/lapack/package.html +++ /dev/null @@ -1,25 +0,0 @@ - - -lapack - -Linear algebra via LAPACK. -

-This Java package depends on the -netlib-java project, -which has translated LAPACK (Linear Algebra PACKage) Fortran subroutines -into Java methods. -This package works as pure Java, but can also use native implementations -of BLAS and LAPACK if provided. -

-For more information on LAPACK, see -Anderson, E., Bai, Z., Bischof, C., Blackford, S., Demmel, J., Dongarra, J., -Du Croz, J., Greenbaum, A, Hammarling, S, McKenney, A, and Sorensen, D., -1999, LAPACK Users' Guide, 3rd Edition, SIAM. -

-The interface presented by this package is adapted from that of the -public-domain pure Java package Jama, which was developed by -Joe Hicklin, Cleve Moler, and Peter Webb of The MathWorks, Inc., and by -Ronald Boisvert, Bruce Miller, Roldan Pozo, and Karin Remington of the -National Institue of Standards and Technology. - - diff --git a/core/bin/main/edu/mines/jtk/mesh/package.html b/core/bin/main/edu/mines/jtk/mesh/package.html deleted file mode 100644 index cf4dd834..00000000 --- a/core/bin/main/edu/mines/jtk/mesh/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -mesh - -Unstructured meshs of triangles and tetrahedra. - - diff --git a/core/bin/main/edu/mines/jtk/mosaic/TileAxisResizing.txt b/core/bin/main/edu/mines/jtk/mosaic/TileAxisResizing.txt deleted file mode 100644 index 1b2293ba..00000000 --- a/core/bin/main/edu/mines/jtk/mosaic/TileAxisResizing.txt +++ /dev/null @@ -1,90 +0,0 @@ -Dave Hale's notes on the TileAxis resizing problem. - -During layout, a child must provide it's preferred size. -Suppose the child's preferred width depends on its height. -Then, when the parent sets its height, child needs a way -to indicate that its preferred size has changed. The -child cannot invalidate or revalidate itself during a -validate traversal and layout, because validate will -mark the child and its ancestors valid. - -///////////////////////////////////////////////////////////////////////////// -Current solution - -Implement a field revalidatePending and method revalidateLater in -the class TileAxis. The method revalidateLater uses invokeLater to -queue a runnable that will call revalidate *after* the current -validate traversal is complete. This method also sets the field -revalidatePending to true. We must call revalidateLater only in -the method setBounds. Elsewhere we can simply call revalidate. - -Also provide a static method revalidatePending in TileAxis that -will return true if any TileAxis child of a specified container -has the revalidatePending flag set to true. Then, such containers -can delay any processing (using invokeLater) until no revalidates -are pending. - -///////////////////////////////////////////////////////////////////////////// -Important methods - -JComponent.revalidate - Container.invalidate - RepaintManager.addInvalidComponent(this) - -Container.invalidate - tells layout manager to ignore any info cached for this - Component.invalidate - -Component.invalidate - valid = false - nullifies cached prefSize,minSize,maxSize - if parent is valid, - parent.invalidate() - -Container.validate - if not valid: - calls validateTree on self - calls doLayout on self - calls validate on children - valid = true - -Component.validate - if not valid: - calls layout on peer - valid = true - -RepaintManager.addInvalidComponent(this) - maintains a list of components to update - finds validateRoot for this - if validateRoot is already in list, - return - else - adds validateRoot for this to list - queues a request to - validateInvalidComponents - paintDirtyRegions - -RepaintManager.validateInvalidComponents - copies invalidComponents list to ic - sets invalidComponents list to null - for all components c in ic - c.validate() - -///////////////////////////////////////////////////////////////////////////// -Problem, in terms of classes and methods outlined above - -when first validated, axis minimum size is too big -when axis bounds are first set by mosaic doLayout, - axis updates tics, because now it has non-zero size - this update may change axis minimum size - if minimum size changed, revalidate will - set valid=false upwards in tree - add validateRoot to repaint manager's invalid list - after doLayout of mosaic, - Container.validateTree sets valid = true - Container.validate sets valid = true - this setting valid=true will continue up to the validateRoot -therefore, revalidate will have no effect - although validateRoot is in repaint manager's invalid list, - it and its children are marked valid, so validate does nothing! -in summary, calling revalidate within validate/doLayout does not work diff --git a/core/bin/main/edu/mines/jtk/mosaic/Track16.gif b/core/bin/main/edu/mines/jtk/mosaic/Track16.gif deleted file mode 100644 index 77cee5d62488a7171c04b823251a50722675f9d4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmZ?wbhEHb6krfwSoELa|NsAI&itP_^GsUWOa=yq0|yQONgz=C$->CMz{;Ql;(*jL zFk3|Iy5p^<#gwYN@RnrTwi^#}U0;M=2~T5rAjHgIJY~(^kIYl#_ZZusQc+*286*9q zV~K#kOpj&Cj0}qZ{GIa)DvL7HGfEVU3=9kuk}4H~OY;$>7zjVpoqet!<7$n--=5=)~nmBRgym{MJuRgML>E2D7 zPHo(Ha>tGf`}bepx9{4SGf$5my?goc>&us4UAlDd%$e&)k6w8A@Y$6sH$Qy%{P^*+ z88g=>8ZhM9^0wuL9p1kB+@Wn7r`N5TSUIyg>BQ3B^_@kBrq|uyGWXM`PkDKHyu7>z z4jceEf?S~ZlZBCiL7PDbWB|xd3~cKUOfB%xk?KE@62zLYYRYl7XN?;JW?WD_&~!3G zug7_@(}{H<6T6RH5XhHd6$!Z-Yi!nQo)pl)Bv+Ql$05kY!st~ZUfEN@B~a)Uo!HaT z&)ME7(j?8yB)};&(TlaRnRmKyVTTusXmjfVVeXlcEUX(Bva)FUrfKXxsKLk}ui&4? zc=&L-f}GNcG*>MpImL^YoV65{Rc_o&S5Z}$ec+;{t|s%$MONn28<(PwUjiH%6#w}< z=ND8KWu|A8C>R+S7$_uFDg>A2Dfnh47v&dM7MG;v7V9W@<|XSXIOgOi1c4M5D+Hw$ frxul^rs(lKX8IF<1its}i(k diff --git a/core/bin/main/edu/mines/jtk/mosaic/ZoomIn16.gif b/core/bin/main/edu/mines/jtk/mosaic/ZoomIn16.gif deleted file mode 100644 index 2329426e4817c9edf7f8db004d72cc096d0888e0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 304 zcmZ?wbhEHb6krfwIP#wX2>$>7Z(xvUYn#{7GN-F+(To`z=FQu-di9b0`>!88diUnd zPe+elc=+(yl`A(NKYli2=K4efhC|cqczJmb95?{dj~6KZWMO1r5Mj^(sRG%_z#6Wg z+Lsc^B%ClU^RdB!4P6eOeOOdjvj2)OxIR*d@ReD)B=LZ?AqUrigBxyqRp{(w+?YL$ zttr#gbTJFd0|tjCE%tj;N>hU5e3d3u#+ICa|5LD_KCM|*k-=J#LGhozbACZ(QD%BZ ziGq=Vfq_C&r9yCNo`P>?a#4P9WpPPrZn2JnXI`?Nf@4mOLJ&w{u|iO4acWUnYKk5& XmzR&5f_socSZa}ip`HOR7lSnb*>7nx diff --git a/core/bin/main/edu/mines/jtk/mosaic/package.html b/core/bin/main/edu/mines/jtk/mosaic/package.html deleted file mode 100644 index ba55be1b..00000000 --- a/core/bin/main/edu/mines/jtk/mosaic/package.html +++ /dev/null @@ -1,11 +0,0 @@ - - -mosaic - -A system for 2-D graphics. -In this system, 2-D graphics are displayed in a a mosaic of tiles, in which -each tile contains one or more graphical views. -A mosaic aligns these tiles and tiled views so that they share coordinate -systems and zoom and scroll consistently. - - diff --git a/core/bin/main/edu/mines/jtk/ogl/package.html b/core/bin/main/edu/mines/jtk/ogl/package.html deleted file mode 100644 index 0e26e1f1..00000000 --- a/core/bin/main/edu/mines/jtk/ogl/package.html +++ /dev/null @@ -1,11 +0,0 @@ - - -ogl - -OpenGL for Java, based on JOGL. -

-This package depends on the soon-to-be standard (JSR 231) JOGL packages. -Currently, to use this package, you must obtain the freely-available JAR -files and native code libraries for JOGL from https://jogl.dev.java.net/. - - diff --git a/core/bin/main/edu/mines/jtk/opt/package.html b/core/bin/main/edu/mines/jtk/opt/package.html deleted file mode 100644 index 2710f7e5..00000000 --- a/core/bin/main/edu/mines/jtk/opt/package.html +++ /dev/null @@ -1,8 +0,0 @@ - - -opt - -Code for Gauss-Newton and conjugate-gradient inversion and optimization. -See documents in doc/opt_package/ for a description of the design and API. - - diff --git a/core/bin/main/edu/mines/jtk/sgl/AxisAlignedPanelDesign.txt b/core/bin/main/edu/mines/jtk/sgl/AxisAlignedPanelDesign.txt deleted file mode 100644 index 3c451a80..00000000 --- a/core/bin/main/edu/mines/jtk/sgl/AxisAlignedPanelDesign.txt +++ /dev/null @@ -1,95 +0,0 @@ -Dave Hale's notes for design of -AxisAlignedFrame -AxisAlignedPanel -AxisAlignedQuad -AxisAlignedBox -ImagePanel - -///////////////////////////////////////////////////////////////////////////// - -public enum Axis - X,Y,Z - -///////////////////////////////////////////////////////////////////////////// - -public class AxisAlignedBox extends Group implements Selectable, Dragable - constructs six frame children - can get frame for any of six faces of box - moving and resizing with mouse - constructs and manages handles - implements selection and dragging - when corners set explicitly - sets corners of frames - -///////////////////////////////////////////////////////////////////////////// - -public class AxisAlignedQuad extends Group implements Selectable, Dragable - constructs one frame child - can get frame - moving and resizing with mouse - constructs and manages handles - implements selection and dragging - when corners set explicitly - sets corners of frame - -///////////////////////////////////////////////////////////////////////////// - -scenario - user drags quad - quad sets frame corners - frame constrains corners - -scenario - panel added to frame (dirty bsphere and draw) - panel sets box constraint of frame - frame constrains corners (dirty bsphere and draw) - -scenario - panel changes its sampling (dirty bsphere and draw) - panel sets box constraint of frame - frame constrains corners (dirty bsphere and draw) - -///////////////////////////////////////////////////////////////////////////// - -public class AxisAlignedFrame extends Group - typically constructed by parent quad or box - has axis - initialized when frame constructed - accessible and immutable - has corners - initialized when frame constructed - accessible and mutable (dirty bsphere and draw) - when a child panel is added - ensures panel's frame is currently null - sets panel's frame to this - when a child panel is removed - ensures panel's frame is this frame - sets panel's frame to null - has a box constraint (null if none) - typically set by panels - last constraint set rules - -///////////////////////////////////////////////////////////////////////////// - -public class AxisAlignedPanel extends Node - may be constructed with a frame or not - when non-null frame is set (when child panel is added to frame) - gets its box constraint (default is null; may be overridden) - if not null, sets box constraint of frame - if parent is a frame - implements pick and computeBoundingSphere - using frame axis and corners - else - does not implement pick or computeBoundingSphere - -///////////////////////////////////////////////////////////////////////////// - -public class ImagePanel extends AxisAlignedPanel - constructed with samplings and floats - knows what box constraint - when sampling changes - sets box constraint of frame - has a cache of textures - implements draw - if necessary, updates texture cache - draws textures diff --git a/core/bin/main/edu/mines/jtk/sgl/SelectDragCursor16.png b/core/bin/main/edu/mines/jtk/sgl/SelectDragCursor16.png deleted file mode 100644 index cf1a244415782154d5ed978093fe8de2f5fcb5d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=DjSL74G){)!Z!AbW|YuPggiHgOSYMWdU!mw-a?o-U3d6}R?YJjiuGfrt5m%A5c7 zmb>351i5=1ytnFErXWLt^fp7y{zlD5`gh&7Xe!)v3b9$*`oh4!=S9A;V@QjGk=s1m zJ=@w#L)!OzSvMhtWtk$2`H}Sj!tZJyPpx9yKF5M_eM{UDpj8Z>u6{1-oD!M<4oOKX diff --git a/core/bin/main/edu/mines/jtk/sgl/SelectDragIcon16.png b/core/bin/main/edu/mines/jtk/sgl/SelectDragIcon16.png deleted file mode 100644 index d905ef33bf0055db25a73e9bc294de9f6e0e14e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 518 zcmV+h0{Q)kP)VGd000McNliru)dm+69T%>4Nk{+y0h38Y zK~#9!ozo#}96=Po@&AM=yoD5YUE;bT&?`jT5pzdO56;}eiCfpGHs7FWU1g~XRjo|E z!NwG>s;LNU+(iU(qT*ysp(6tK#K2bUb}Di?l8hYQy!U%=X3W*)6jiN6#PEo2;-sirTd7$spcXji(3=IxQ=zln;^6&3Bbl$1{1>S5 z=f=@{nW3s7ARp(H=VcYIFMlWYpWxbE^YPOms)|_Q==h6?;{*T!)YtpBZ=n&qd;5X@ zphtJ7je6zu=Xr${k|ag}L6)`=X0ZQyk8~q7*=Ptr@vQ(~w;~o4W!crPi4{8Cp4r^o zFo@9I?VI#jiu>(2Ju54*QIkYgyaNkZNTP`73GBal1;FI{1Z9C(LA~BS?HhquA(jLL z;`M~#AT!}(`MU>*1v9-ULxoVugX$v0i9}$VHauY#FSa}U1p)`E{uX_o?=O?0SP z`%m}wCfx%YrL9)Z(3z^YZTc*+D?#k<(rsANHonkV-{DrGAE39VGd000McNliru)dm+5IWYTHcd`Hg0-i}k zK~#9!ZIeHU6jvO_KeHL(4Jhmw7jEE$OqY=e?qZ5tV&Q;>yCX#mShyi5HVL*?VkJu| z4=XF(D(s~=G!Qsbd60j*g<-Ea*a;YzgDalk!F!N__X8(PikUqv{8g{`{=WbCJ#W4@ z<9(C8%$dEIRY4Gtd>ng8lDrq^A1!1Vv%Ps0h9U8C@#Q zlGy8>?Lk>@w-yAmy?HgfH{{lLw-9mF?p_AK(y55q?wp%9ZZf#~6;HOFRqsms08$F^ z=@aotWxP4Af*_=OF7a9b%2&i6Mc(dTQvlY!xI(^PFG(r2 z-DcbyM|v@3Z8hcLqfymbfWk05QUX|8U8^7ETM`iiKyRf_w7i6QZSb=!B#f2Ghqd4kS|9j1Ry+4=Q1T8lQ-amD19=ZGxqHrYjpmLfzf$`6R+nEanP zlNU33-5%cL_vdUs+o|r}xeZD+g*7B)9YIP5BA7xD5%Pna;l29|z8QEeTGEh2(`t;zn*5fQqdBz1&1j%l~s-o}FsL=47iTwySW8YwK+8l-R- zW61Y4+dpqJxHj+vY67JK;^hc^pqXbGQV3Giinefw1LtZ-T5F^by5|$ZKsBfAE5c5j z^it}L9*xll8f^?B4(9|{N<$_*-Fiy8ntF?SX(?Z!8W&Ng&H8HUjeZ=1fcsaPP6TTW z`F@T*)T9^sD5X$-@b)h#Um;B&)>^FCqZ5`A^r2-kozU<0z=z - -sgl - -A scene graph for interactive 3-D graphics via OpenGL. Unlike some -systems for scientific visualization, this scene graph is designed -for interactive editing, typically by selecting and dragging objects -with a mouse or some other pointing device. - - diff --git a/core/bin/main/edu/mines/jtk/util/CleanHandler.properties b/core/bin/main/edu/mines/jtk/util/CleanHandler.properties deleted file mode 100644 index 98b32273..00000000 --- a/core/bin/main/edu/mines/jtk/util/CleanHandler.properties +++ /dev/null @@ -1 +0,0 @@ -testmessage=Substituted string diff --git a/core/bin/main/edu/mines/jtk/util/Localize.properties b/core/bin/main/edu/mines/jtk/util/Localize.properties deleted file mode 100644 index 2980cc0f..00000000 --- a/core/bin/main/edu/mines/jtk/util/Localize.properties +++ /dev/null @@ -1,10 +0,0 @@ -second=second -seconds=seconds -minute=minute -minutes=minutes -hour=hour -hours=hours -day=day -days=days - - diff --git a/core/bin/main/edu/mines/jtk/util/Localize_ch.properties b/core/bin/main/edu/mines/jtk/util/Localize_ch.properties deleted file mode 100644 index 7561299f..00000000 --- a/core/bin/main/edu/mines/jtk/util/Localize_ch.properties +++ /dev/null @@ -1,8 +0,0 @@ -second=秒 -seconds=秒 -minute=分 -minutes=分 -hour=小时 -hours=小时 -day=天 -days=天 diff --git a/core/bin/main/edu/mines/jtk/util/Localize_de.properties b/core/bin/main/edu/mines/jtk/util/Localize_de.properties deleted file mode 100644 index 8716dc94..00000000 --- a/core/bin/main/edu/mines/jtk/util/Localize_de.properties +++ /dev/null @@ -1,8 +0,0 @@ -second=Sekunde -seconds=Sekunden -minute=Minute -minutes=Minuten -hour=Stunde -hours=Stunden -day=Tag -days=Tage diff --git a/core/bin/main/edu/mines/jtk/util/Localize_es.properties b/core/bin/main/edu/mines/jtk/util/Localize_es.properties deleted file mode 100644 index 64e0a1d6..00000000 --- a/core/bin/main/edu/mines/jtk/util/Localize_es.properties +++ /dev/null @@ -1,8 +0,0 @@ -second=secundo -seconds=secundos -minute=minuto -minutes=minutos -hour=hora -hours=horas -day=dia -days=dias diff --git a/core/bin/main/edu/mines/jtk/util/LogMonitor.properties b/core/bin/main/edu/mines/jtk/util/LogMonitor.properties deleted file mode 100644 index 295f863e..00000000 --- a/core/bin/main/edu/mines/jtk/util/LogMonitor.properties +++ /dev/null @@ -1,9 +0,0 @@ -Test=Test -progress=progress -complete_at=complete at -remaining=remaining -total=total -so_far=so far -Finished_in=Finished in - - diff --git a/core/bin/main/edu/mines/jtk/util/LogMonitor_ch.properties b/core/bin/main/edu/mines/jtk/util/LogMonitor_ch.properties deleted file mode 100644 index 3fb027c5..00000000 --- a/core/bin/main/edu/mines/jtk/util/LogMonitor_ch.properties +++ /dev/null @@ -1,8 +0,0 @@ -Test=实验 -progress=进步 -complete_at=做了 -remaining=省下 -total=一共 -so_far=到现在 -Finished_in=一共用了 - diff --git a/core/bin/main/edu/mines/jtk/util/LogMonitor_de.properties b/core/bin/main/edu/mines/jtk/util/LogMonitor_de.properties deleted file mode 100644 index db0bdcb7..00000000 --- a/core/bin/main/edu/mines/jtk/util/LogMonitor_de.properties +++ /dev/null @@ -1,6 +0,0 @@ -progress=Fortschritt -complete_at=beendet um -remaining=verbleibend -total=insgesammt -so_far=mittlerweile -Finished_in=in beendet diff --git a/core/bin/main/edu/mines/jtk/util/LogMonitor_es.properties b/core/bin/main/edu/mines/jtk/util/LogMonitor_es.properties deleted file mode 100644 index 5bbab4b6..00000000 --- a/core/bin/main/edu/mines/jtk/util/LogMonitor_es.properties +++ /dev/null @@ -1,6 +0,0 @@ -progress=progresso -complete_at=completo a -remaining=se quedan -total=total -so_far=hasta ahora -Finished_in=terminado en diff --git a/core/bin/main/edu/mines/jtk/util/UnitsParser.jj b/core/bin/main/edu/mines/jtk/util/UnitsParser.jj deleted file mode 100644 index 07651fe3..00000000 --- a/core/bin/main/edu/mines/jtk/util/UnitsParser.jj +++ /dev/null @@ -1,125 +0,0 @@ -options { - STATIC=true; -} - -PARSER_BEGIN(UnitsParser) -package edu.mines.jtk.util; - -import java.io.*; - -/** - * Parser (generated from UnitsParser.jj via JavaCC) to create Units - * from a string that conforms to the following (extended BNF) grammar: - *

- * unit -> expr EOF
- * expr -> term ( ("+" | "-") (DOUBLE|INTEGER) )?
- * term -> factor ( ("*")? factor | "/" factor )*
- * factor -> primary ("^" INTEGER)?
- * primary -> NAME | (DOUBLE|INTEGER) | "(" expr ")"
- * 
- * - * @author Dave Hale - * @version 1998.07.06 - */ -final class UnitsParser { - - /** - * Parse a String containing a unit definition. - * @param the unit definition, as in "coulomb/volt". - * @exception ParseException if the definition is not valid. - */ - static synchronized Units parse(String definition) throws ParseException { - ReInit(new StringReader(definition)); - return units(); - } -} - -PARSER_END(UnitsParser) - -SKIP : { - " " - | "\t" -} - -TOKEN : { - < PLUS: "+" > - | < MINUS: "-" > - | < MUL: ("*"|".") > - | < DIV: ("/"|"per"|"PER") > - | < POW: ("^"|"**") > - | < LP: "(" > - | < RP: ")" > - | < NAME: "%" | ()*(()+()+)* > - | < INTEGER: ("-")?()+ > - | < DOUBLE: ("-")?(["e","E"](["-","+"])?)? > - | < #ALPHA: | "_" > - | < #LETTER: ["a"-"z","A"-"Z"] > - | < #FLOAT: | (".")? | "." > - | < #DIGIT: ["0"-"9"] > -} - -Units units() : { - Units e; -} { - e=expr() { - return e; - } -} - -Units expr() : { - Units t; - Token n; -} { - t=term() ( - (n=|n=) { - t.shift(Double.valueOf(n.image).doubleValue()); - } | (n=|n=) { - t.shift(-Double.valueOf(n.image).doubleValue()); - } - )? { - return t; - } -} - -Units term() : { - Units f,fb; -} { - f=factor() ( - ()? fb=factor() { - f.mul(fb); - } |
fb=factor() { - f.div(fb); - } - )* { - return f; - } -} - -Units factor() : { - Units p; - Token n; -} { - p=primary() ( - n= { - p.pow(Integer.valueOf(n.image).intValue()); - } - )? { - return p; - } -} - -Units primary() : { - Units e,p; - Token n; -} { - n= { - p = Units.unitsFromName(n.image); - if (p==null) throw new ParseException("Units \""+n.image+"\" are undefined."); - return p; - } | (n=|n=) { - double d = (new Double(n.image)).doubleValue(); - return (new Units()).scale(d); - } | e=expr() { - return e; - } -} diff --git a/core/bin/main/edu/mines/jtk/util/package.html b/core/bin/main/edu/mines/jtk/util/package.html deleted file mode 100644 index d1fe6e01..00000000 --- a/core/bin/main/edu/mines/jtk/util/package.html +++ /dev/null @@ -1,11 +0,0 @@ - - -util - -Generally useful utilities. -Classes in this package are likely to be used by classes in one or more -other packages. -Classes in this package reference no other classes except those in this -package and those in standard Java packages. - - diff --git a/core/bin/test/edu/mines/jtk/util/LocalizeTest.properties b/core/bin/test/edu/mines/jtk/util/LocalizeTest.properties deleted file mode 100644 index e4f537b7..00000000 --- a/core/bin/test/edu/mines/jtk/util/LocalizeTest.properties +++ /dev/null @@ -1,4 +0,0 @@ -junk = foo -msg1 = A number %g here, and another #%d -junk2 = bar - diff --git a/core/bin/test/edu/mines/jtk/util/LocalizeTestAlt.properties b/core/bin/test/edu/mines/jtk/util/LocalizeTestAlt.properties deleted file mode 100644 index 6f38938b..00000000 --- a/core/bin/test/edu/mines/jtk/util/LocalizeTestAlt.properties +++ /dev/null @@ -1 +0,0 @@ -msg1=A custom file with number %g, and another #%d diff --git a/core/bin/test/edu/mines/jtk/util/LocalizeTest_fr.properties b/core/bin/test/edu/mines/jtk/util/LocalizeTest_fr.properties deleted file mode 100644 index dc5f5b44..00000000 --- a/core/bin/test/edu/mines/jtk/util/LocalizeTest_fr.properties +++ /dev/null @@ -1,4 +0,0 @@ -junk = foo -msg1 = Un nombre %g ici, et un autre #%d -junk2 = bar - diff --git a/core/src/main/java/edu/mines/jtk/dsp/LocalSmoothingFilter.java b/core/src/main/java/edu/mines/jtk/dsp/LocalSmoothingFilter.java index 98029cea..25159822 100644 --- a/core/src/main/java/edu/mines/jtk/dsp/LocalSmoothingFilter.java +++ b/core/src/main/java/edu/mines/jtk/dsp/LocalSmoothingFilter.java @@ -77,7 +77,7 @@ public LocalSmoothingFilter() { * @param niter stop when number of iterations exceeds this limit. */ public LocalSmoothingFilter(double small, int niter) { - _small = small; + _small = (float)small; _niter = niter; _ldk = new LocalDiffusionKernel(LocalDiffusionKernel.Stencil.D22); } @@ -92,7 +92,7 @@ public LocalSmoothingFilter(double small, int niter) { public LocalSmoothingFilter( double small, int niter, LocalDiffusionKernel ldk) { - _small = small; + _small = (float)small; _niter = niter; _ldk = ldk; } @@ -361,7 +361,7 @@ public void applySmoothL(double kmax, float[][][] x, float[][][] y) { private static Logger log = Logger.getLogger(LocalSmoothingFilter.class.getName()); - private double _small; // stop iterations when residuals are small + private float _small; // stop iterations when residuals are small private int _niter; // number of iterations private boolean _pc; // true, for preconditioned CG iterations private LocalDiffusionKernel _ldk; // computes y += (I+G'DG)x @@ -618,23 +618,23 @@ private void solve(Operator2 a, float[][] b, float[][] x) { a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax scopy(r,d); // d = r - double delta = sdot(r,r); // delta = r'r - double bnorm = sqrt(sdot(b,b)); - double rnorm = sqrt(delta); - double rnormBegin = rnorm; - double rnormSmall = bnorm*_small; + float delta = sdot(r,r); // delta = r'r + float bnorm = sqrt(sdot(b,b)); + float rnorm = sqrt(delta); + float rnormBegin = rnorm; + float rnormSmall = bnorm*_small; int iter; log.fine("solve: bnorm="+bnorm+" rnorm="+rnorm); for (iter=0; iter<_niter && rnorm>rnormSmall; ++iter) { log.finer(" iter="+iter+" rnorm="+rnorm+" ratio="+rnorm/rnormBegin); a.apply(d,q); // q = Ad - double dq = sdot(d,q); // d'q = d'Ad - double alpha = delta/dq; // alpha = r'r/d'Ad + float dq = sdot(d,q); // d'q = d'Ad + float alpha = delta/dq; // alpha = r'r/d'Ad saxpy( alpha,d,x); // x = x+alpha*d saxpy(-alpha,q,r); // r = r-alpha*q - double deltaOld = delta; + float deltaOld = delta; delta = sdot(r,r); // delta = r'r - double beta = delta/deltaOld; + float beta = delta/deltaOld; sxpay(beta,r,d); // d = r+beta*d rnorm = sqrt(delta); } @@ -649,27 +649,27 @@ private void solve(Operator3 a, float[][][] b, float[][][] x) { float[][][] r = new float[n3][n2][n1]; scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax scopy(r,d); - double delta = sdot(r,r); - double bnorm = sqrt(sdot(b,b)); - double rnorm = sqrt(delta); - double rnormBegin = rnorm; - double rnormSmall = bnorm*_small; + float delta = sdot(r,r); + float bnorm = sqrt(sdot(b,b)); + float rnorm = sqrt(delta); + float rnormBegin = rnorm; + float rnormSmall = bnorm*_small; int iter; log.fine("solve: bnorm="+bnorm+" rnorm="+rnorm); for (iter=0; iter<_niter && rnorm>rnormSmall; ++iter) { log.finer(" iter="+iter+" rnorm="+rnorm+" ratio="+rnorm/rnormBegin); a.apply(d,q); - double dq = sdot(d,q); - double alpha = delta/dq; + float dq = sdot(d,q); + float alpha = delta/dq; saxpy( alpha,d,x); if (iter%100<99) { saxpy(-alpha,q,r); } else { scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); } - double deltaOld = delta; + float deltaOld = delta; delta = sdot(r,r); - double beta = delta/deltaOld; + float beta = delta/deltaOld; sxpay(beta,r,d); rnorm = sqrt(delta); } @@ -688,25 +688,25 @@ private void solve(Operator2 a, Operator2 m, float[][] b, float[][] x) { scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax - double bnorm = sqrt(sdot(b,b)); - double rnorm = sqrt(sdot(r,r)); - double rnormBegin = rnorm; - double rnormSmall = bnorm*_small; + float bnorm = sqrt(sdot(b,b)); + float rnorm = sqrt(sdot(r,r)); + float rnormBegin = rnorm; + float rnormSmall = bnorm*_small; m.apply(r,s); // s = Mr scopy(s,d); // d = s - double delta = sdot(r,s); // r's = r'Mr + float delta = sdot(r,s); // r's = r'Mr int iter; log.fine("msolve: bnorm="+bnorm+" rnorm="+rnorm); for (iter=0; iter<_niter && rnorm>rnormSmall; ++iter) { log.finer(" iter="+iter+" rnorm="+rnorm+" ratio="+rnorm/rnormBegin); a.apply(d,q); // q = Ad - double alpha = delta/sdot(d,q); // alpha = r'Mr/d'Ad + float alpha = delta/sdot(d,q); // alpha = r'Mr/d'Ad saxpy( alpha,d,x); // x = x+alpha*d saxpy(-alpha,q,r); // r = r-alpha*q m.apply(r,s); // s = Mr - double deltaOld = delta; + float deltaOld = delta; delta = sdot(r,s); // delta = r's = r'Mr - double beta = delta/deltaOld; + float beta = delta/deltaOld; sxpay(beta,s,d); // d = s+beta*d rnorm = sqrt(sdot(r,r)); } @@ -721,19 +721,19 @@ private void solve(Operator3 a, Operator3 m, float[][][] b, float[][][] x) { float[][][] r = new float[n3][n2][n1]; float[][][] s = new float[n3][n2][n1]; scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax - double bnorm = sqrt(sdot(b,b)); - double rnorm = sqrt(sdot(r,r)); - double rnormBegin = rnorm; - double rnormSmall = bnorm*_small; + float bnorm = sqrt(sdot(b,b)); + float rnorm = sqrt(sdot(r,r)); + float rnormBegin = rnorm; + float rnormSmall = bnorm*_small; m.apply(r,s); // s = Mr scopy(s,d); // d = s - double delta = sdot(r,s); // r's = r'Mr + float delta = sdot(r,s); // r's = r'Mr int iter; log.fine("msolve: bnorm="+bnorm+" rnorm="+rnorm); for (iter=0; iter<_niter && rnorm>rnormSmall; ++iter) { log.finer(" iter="+iter+" rnorm="+rnorm+" ratio="+rnorm/rnormBegin); a.apply(d,q); // q = Ad - double alpha = delta/sdot(d,q); // alpha = r'Mr/d'Ad + float alpha = delta/sdot(d,q); // alpha = r'Mr/d'Ad saxpy( alpha,d,x); // x = x+alpha*d if (iter%100<99) { saxpy(-alpha,q,r); // r = r-alpha*q @@ -741,9 +741,9 @@ private void solve(Operator3 a, Operator3 m, float[][][] b, float[][][] x) { scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax } m.apply(r,s); // s = Mr - double deltaOld = delta; + float deltaOld = delta; delta = sdot(r,s); // delta = r's = r'Mr - double beta = delta/deltaOld; + float beta = delta/deltaOld; sxpay(beta,s,d); // d = s+beta*d rnorm = sqrt(sdot(r,r)); } @@ -783,34 +783,34 @@ public void compute(int i3) { } // Returns the dot product x'y. - private static double sdot(float[][] x, float[][] y) { + private static float sdot(float[][] x, float[][] y) { int n1 = x[0].length; int n2 = x.length; - double d = 0.0; + float d = 0.0f; for (int i2=0; i2 - - - - - - - - - - - - - - - - - diff --git a/demo/.project b/demo/.project deleted file mode 100644 index 37b17810..00000000 --- a/demo/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - demo - Project demo created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1616610733513 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/demo/.settings/org.eclipse.buildship.core.prefs b/demo/.settings/org.eclipse.buildship.core.prefs deleted file mode 100644 index b1886adb..00000000 --- a/demo/.settings/org.eclipse.buildship.core.prefs +++ /dev/null @@ -1,2 +0,0 @@ -connection.project.dir=.. -eclipse.preferences.version=1 diff --git a/demo/bin/main/jtkdemo/mosaic/Poles16.png b/demo/bin/main/jtkdemo/mosaic/Poles16.png deleted file mode 100644 index 344582b6386994260cefc553b981eee6ab074f56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 601 zcmV-f0;c_mP)VGd000McNliru)&~p#DjsDa$8i7v0p>|W zK~#9!m6N}V6HySyKO0tfue&V{44lPwdB+L9kj4X>6v7=?n9fU)La{mRtmG;QR>8l( zCXuxelB+`C4ue%J0((UuTUcx(7*NTWCbEtgu-7+k)=ruq% znbLgI#BrQ8`m^UR{>oT;T+0C5Tm@!f@bCCIj?=JyZFav#@3My~`E4mZ^gRXBNl1=| z2JjhZ?FepJTLT~*k2rmFN?}z&F7pjg1A<&|V0AaE>WT-qNq#1{Q54a=?B_GR0*b&x zU|@9>;L6$nm>ZK3aQ^a~<#M^J-vKbUGT1hDKLzNDrm&gA|Gm*Tq^!#n>a`jduP?Uk zfi3%smC6<;46lbMr6>qja;W@mw(r}XPpn*7-FiC481#|KTJU{8KSmAofO-zJZgqM! z#`;+u0~vr2l76qda_;2W-kMGaKp$yzMd3-2?E$X9+ux(x>$d-~g#c|;Qtj$Vb#qL@ z71>Wniu(|B-qXJx^7Kj8!D`9UG$H;zqxG&u^}#Vh2!ty)w;)`Bv3#UyN@~*V;sCRN nAHPyYUq>A4?2zOw0WSOjfoPx-j>kxX00000NkvXXu0mjfEP@Bm diff --git a/demo/bin/main/jtkdemo/mosaic/Zeros16.png b/demo/bin/main/jtkdemo/mosaic/Zeros16.png deleted file mode 100644 index f9f9016d46a60ca4b4b7714dc01da0f31d4b0f35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 659 zcmV;E0&M+>P)VGd000McNliru)&~p#CKw?1El28q-6$FS4< z+`_ASSeAuMI!Gyp^2~lhvx(<7ux%S>GC>dqLghH)Nv1e^snfgLSy z8Mp^rEx#+jlu74{W!bnFB{X~wJqH_D0oH)&A?;3UYz45rdX4#8^ThsE0HlF2;4N@C zMBq?kV?a7Fd5+*mK&;tpQh2@wkOYnapZ_0UbCO-9z=T-!Lyh8A5nvqn4TK{ELd_Z9 zukWLjA~x6q3OEhKM+n3cX*W$Qm(8;LWEtQ9I0K|c2&6RUpt@Z}N=ZzZ7BkWT z*aJ=gizBwMs5yH|Dco7vYr%0GfFoc7m;%;;o4VwstWt6#| z8JJ0!q8AB^!~_&yzlti`)z1Apxz0bIj4%vneQi^CQ6O_=4j}}>v<6-fra Date: Wed, 24 Mar 2021 22:21:32 +0200 Subject: [PATCH 3/4] Fix exploding values in LocalSmoothingFilter Fix non convergence of the local smoothing filter iterations, eventually resulting in NaN rnorm --- .gitignore | 4 +- .../mines/jtk/dsp/LocalSmoothingFilter.java | 96 +++++++++---------- 2 files changed, 51 insertions(+), 49 deletions(-) diff --git a/.gitignore b/.gitignore index e73850b0..acd318a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /.cache /.classpath -/.project +/**/.project /.pydevproject /.idea /.gradle @@ -15,3 +15,5 @@ build/ core/out/ demo/out/ +core/bin/ +core/build/ \ No newline at end of file diff --git a/core/src/main/java/edu/mines/jtk/dsp/LocalSmoothingFilter.java b/core/src/main/java/edu/mines/jtk/dsp/LocalSmoothingFilter.java index 25159822..98029cea 100644 --- a/core/src/main/java/edu/mines/jtk/dsp/LocalSmoothingFilter.java +++ b/core/src/main/java/edu/mines/jtk/dsp/LocalSmoothingFilter.java @@ -77,7 +77,7 @@ public LocalSmoothingFilter() { * @param niter stop when number of iterations exceeds this limit. */ public LocalSmoothingFilter(double small, int niter) { - _small = (float)small; + _small = small; _niter = niter; _ldk = new LocalDiffusionKernel(LocalDiffusionKernel.Stencil.D22); } @@ -92,7 +92,7 @@ public LocalSmoothingFilter(double small, int niter) { public LocalSmoothingFilter( double small, int niter, LocalDiffusionKernel ldk) { - _small = (float)small; + _small = small; _niter = niter; _ldk = ldk; } @@ -361,7 +361,7 @@ public void applySmoothL(double kmax, float[][][] x, float[][][] y) { private static Logger log = Logger.getLogger(LocalSmoothingFilter.class.getName()); - private float _small; // stop iterations when residuals are small + private double _small; // stop iterations when residuals are small private int _niter; // number of iterations private boolean _pc; // true, for preconditioned CG iterations private LocalDiffusionKernel _ldk; // computes y += (I+G'DG)x @@ -618,23 +618,23 @@ private void solve(Operator2 a, float[][] b, float[][] x) { a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax scopy(r,d); // d = r - float delta = sdot(r,r); // delta = r'r - float bnorm = sqrt(sdot(b,b)); - float rnorm = sqrt(delta); - float rnormBegin = rnorm; - float rnormSmall = bnorm*_small; + double delta = sdot(r,r); // delta = r'r + double bnorm = sqrt(sdot(b,b)); + double rnorm = sqrt(delta); + double rnormBegin = rnorm; + double rnormSmall = bnorm*_small; int iter; log.fine("solve: bnorm="+bnorm+" rnorm="+rnorm); for (iter=0; iter<_niter && rnorm>rnormSmall; ++iter) { log.finer(" iter="+iter+" rnorm="+rnorm+" ratio="+rnorm/rnormBegin); a.apply(d,q); // q = Ad - float dq = sdot(d,q); // d'q = d'Ad - float alpha = delta/dq; // alpha = r'r/d'Ad + double dq = sdot(d,q); // d'q = d'Ad + double alpha = delta/dq; // alpha = r'r/d'Ad saxpy( alpha,d,x); // x = x+alpha*d saxpy(-alpha,q,r); // r = r-alpha*q - float deltaOld = delta; + double deltaOld = delta; delta = sdot(r,r); // delta = r'r - float beta = delta/deltaOld; + double beta = delta/deltaOld; sxpay(beta,r,d); // d = r+beta*d rnorm = sqrt(delta); } @@ -649,27 +649,27 @@ private void solve(Operator3 a, float[][][] b, float[][][] x) { float[][][] r = new float[n3][n2][n1]; scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax scopy(r,d); - float delta = sdot(r,r); - float bnorm = sqrt(sdot(b,b)); - float rnorm = sqrt(delta); - float rnormBegin = rnorm; - float rnormSmall = bnorm*_small; + double delta = sdot(r,r); + double bnorm = sqrt(sdot(b,b)); + double rnorm = sqrt(delta); + double rnormBegin = rnorm; + double rnormSmall = bnorm*_small; int iter; log.fine("solve: bnorm="+bnorm+" rnorm="+rnorm); for (iter=0; iter<_niter && rnorm>rnormSmall; ++iter) { log.finer(" iter="+iter+" rnorm="+rnorm+" ratio="+rnorm/rnormBegin); a.apply(d,q); - float dq = sdot(d,q); - float alpha = delta/dq; + double dq = sdot(d,q); + double alpha = delta/dq; saxpy( alpha,d,x); if (iter%100<99) { saxpy(-alpha,q,r); } else { scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); } - float deltaOld = delta; + double deltaOld = delta; delta = sdot(r,r); - float beta = delta/deltaOld; + double beta = delta/deltaOld; sxpay(beta,r,d); rnorm = sqrt(delta); } @@ -688,25 +688,25 @@ private void solve(Operator2 a, Operator2 m, float[][] b, float[][] x) { scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax - float bnorm = sqrt(sdot(b,b)); - float rnorm = sqrt(sdot(r,r)); - float rnormBegin = rnorm; - float rnormSmall = bnorm*_small; + double bnorm = sqrt(sdot(b,b)); + double rnorm = sqrt(sdot(r,r)); + double rnormBegin = rnorm; + double rnormSmall = bnorm*_small; m.apply(r,s); // s = Mr scopy(s,d); // d = s - float delta = sdot(r,s); // r's = r'Mr + double delta = sdot(r,s); // r's = r'Mr int iter; log.fine("msolve: bnorm="+bnorm+" rnorm="+rnorm); for (iter=0; iter<_niter && rnorm>rnormSmall; ++iter) { log.finer(" iter="+iter+" rnorm="+rnorm+" ratio="+rnorm/rnormBegin); a.apply(d,q); // q = Ad - float alpha = delta/sdot(d,q); // alpha = r'Mr/d'Ad + double alpha = delta/sdot(d,q); // alpha = r'Mr/d'Ad saxpy( alpha,d,x); // x = x+alpha*d saxpy(-alpha,q,r); // r = r-alpha*q m.apply(r,s); // s = Mr - float deltaOld = delta; + double deltaOld = delta; delta = sdot(r,s); // delta = r's = r'Mr - float beta = delta/deltaOld; + double beta = delta/deltaOld; sxpay(beta,s,d); // d = s+beta*d rnorm = sqrt(sdot(r,r)); } @@ -721,19 +721,19 @@ private void solve(Operator3 a, Operator3 m, float[][][] b, float[][][] x) { float[][][] r = new float[n3][n2][n1]; float[][][] s = new float[n3][n2][n1]; scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax - float bnorm = sqrt(sdot(b,b)); - float rnorm = sqrt(sdot(r,r)); - float rnormBegin = rnorm; - float rnormSmall = bnorm*_small; + double bnorm = sqrt(sdot(b,b)); + double rnorm = sqrt(sdot(r,r)); + double rnormBegin = rnorm; + double rnormSmall = bnorm*_small; m.apply(r,s); // s = Mr scopy(s,d); // d = s - float delta = sdot(r,s); // r's = r'Mr + double delta = sdot(r,s); // r's = r'Mr int iter; log.fine("msolve: bnorm="+bnorm+" rnorm="+rnorm); for (iter=0; iter<_niter && rnorm>rnormSmall; ++iter) { log.finer(" iter="+iter+" rnorm="+rnorm+" ratio="+rnorm/rnormBegin); a.apply(d,q); // q = Ad - float alpha = delta/sdot(d,q); // alpha = r'Mr/d'Ad + double alpha = delta/sdot(d,q); // alpha = r'Mr/d'Ad saxpy( alpha,d,x); // x = x+alpha*d if (iter%100<99) { saxpy(-alpha,q,r); // r = r-alpha*q @@ -741,9 +741,9 @@ private void solve(Operator3 a, Operator3 m, float[][][] b, float[][][] x) { scopy(b,r); a.apply(x,q); saxpy(-1.0f,q,r); // r = b-Ax } m.apply(r,s); // s = Mr - float deltaOld = delta; + double deltaOld = delta; delta = sdot(r,s); // delta = r's = r'Mr - float beta = delta/deltaOld; + double beta = delta/deltaOld; sxpay(beta,s,d); // d = s+beta*d rnorm = sqrt(sdot(r,r)); } @@ -783,34 +783,34 @@ public void compute(int i3) { } // Returns the dot product x'y. - private static float sdot(float[][] x, float[][] y) { + private static double sdot(float[][] x, float[][] y) { int n1 = x[0].length; int n2 = x.length; - float d = 0.0f; + double d = 0.0; for (int i2=0; i2 Date: Thu, 25 Mar 2021 10:19:10 +0200 Subject: [PATCH 4/4] add a newline at the end of the .gitignore file add a newline at the end of the .gitignore file --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index acd318a9..d04c5012 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,4 @@ build/ core/out/ demo/out/ core/bin/ -core/build/ \ No newline at end of file +core/build/