├── Documentation ├── A2Documentation.odt └── A2Documentation.pdf ├── FFTW ├── FFTW.Mod ├── FFTW.Tool ├── FFTWTest.Mod ├── FFTWTestf.Mod └── FFTWf.Mod ├── FreeImage ├── FreeImage.Tool ├── FreeImage.h ├── FreeImage3170.pdf ├── FreeImageDll.Mod ├── FreeImageUtils.Mod ├── TestFreeImage.Mod ├── TestFreeMemIO.Mod ├── TestFreeMeta.Mod ├── Whatsnew.txt ├── license-gplv2.txt └── license-gplv3.txt ├── Generics ├── G.Mod └── GenericsUse.Mod ├── Matrix ├── AVIEncoder.Mod ├── ComplexMathL.Mod ├── ErrorBase.Mod ├── ExtraSort.Mod ├── GeoTools.Mod ├── HypercubeBase.Mod ├── HypercubeMoments.Mod ├── HypercubeNabla.Mod ├── HypercubeTransform.Mod ├── ImageLabeler.Mod ├── JDMathL.Mod ├── LinearConvolve.Mod ├── LinearFFT.Mod ├── LinearFIRConvolve.Mod ├── LinearFIRConvolveLongReal.Mod ├── LinearFilters.Mod ├── LinearIIRConvolveLongReal.Mod ├── LinearMath.Mod ├── LinearPDE.Mod ├── LinearTransform.Mod ├── LinearWindowFunction.Mod ├── Linpack.txt ├── LinpackBenchmark.Mod ├── MLBase.Mod ├── MLClassifier.Mod ├── MLConvNet2D.Mod ├── MLConvNet3D.Mod ├── MLConvWavelets.Mod ├── MLKernelMeans.Mod ├── MLKernels.Mod ├── MLNeuralNet.Mod ├── MLRegression.Mod ├── MLRidgeRegression.Mod ├── MLTest.Mod ├── Matrix.Tool ├── MatrixAVI.Mod ├── MatrixActive.Mod ├── MatrixAffineOpticalFlow.Mod ├── MatrixAlgebraicMultigrid.Mod ├── MatrixBSplineInterpolation.Mod ├── MatrixBase.Mod ├── MatrixBlockSolvers.Mod ├── MatrixComputeObjects.Mod ├── MatrixEigen.Mod ├── MatrixFastMatrixMultiply.Mod ├── MatrixFigures.Mod ├── MatrixFilters.Mod ├── MatrixInterpolation.Mod ├── MatrixIterativeSolvers.Mod ├── MatrixKrylovCGS.Mod ├── MatrixKrylovGMRES.Mod ├── MatrixKrylovMINRES.Mod ├── MatrixLeastSquares.Mod ├── MatrixMoments.Mod ├── MatrixNorms.Mod ├── MatrixOpticalFlow.Mod ├── MatrixOptim.Mod ├── MatrixPolynomEq.Mod ├── MatrixPrincipalComponents.Mod ├── MatrixProjections.Mod ├── MatrixRaster.Mod ├── MatrixRoots.Mod ├── MatrixSVD.Mod ├── MatrixStandardSolvers.Mod ├── MatrixStreams.Mod ├── MatrixTransforms.Mod ├── MatrixUtilities.Mod ├── MatrixWarp.Mod ├── ModuleTesting.Mod ├── ModuleTestingSym.Mod ├── PMath.Mod ├── PMathSSE.Mod ├── PlanarBase.Mod ├── PlanarBlobDetectors.Mod ├── PlanarEdgeDetectors.Mod ├── PlanarFFT.Mod ├── PlanarMath.Mod ├── PlanarMorphology.Mod ├── PlanarNabla.Mod ├── PlanarNorms.Mod ├── PlanarPDE.Mod ├── PlanarPDE_ConstrainedLaplace.MtA ├── PlanarTransform.Mod ├── PlanarWavelets.Mod ├── SchistosomaPDE.Mod ├── StatisticsBase.Mod ├── StatisticsCombinatorics.Mod ├── StatisticsFunctions.Mod ├── StatisticsHistograms.Mod ├── StatisticsLinearRegression.Mod ├── StatisticsRandom.Mod ├── StatisticsRobustRegression.Mod ├── TensorFovea.Mod ├── TensorMath.Mod ├── TestComplexMathL.Mod ├── TestDataImage.Mod ├── TestLinearCrossCorrelation.Mod ├── TestMatrixOpticalFlow.Mod ├── TestMatrixOptim.Mod ├── TestMatrixStandardSolvers.Mod ├── TestPlanarPDE.Mod ├── TestPlanarPDESchistosoma.Mod ├── TestPlanarWavelets.Mod ├── TestVolumePDE.Mod ├── TestYUV.Mod ├── Thermal.lut ├── VolumeBase.Mod ├── VolumeBoundaries.Mod ├── VolumeFFT.Mod ├── VolumeMoments.Mod ├── VolumeMorphology.Mod ├── VolumeNabla.Mod ├── VolumePDE.Mod ├── VolumePDE_ConstrainedLaplace.MtA ├── VolumeTransform.Mod ├── WMArrayPanel.Mod ├── WMMatrix.Mod ├── WMMatrixComponents.rep ├── WMMatrixGraph.Mod ├── WMMatrixLoader.Mod ├── WMRaster.Mod ├── WMStack.Mod ├── WMTensor.Mod ├── Wavelets.Mod ├── linp32SSE2.exe ├── matrix.txt └── test ├── OCTK ├── Bird.Mod ├── FreehandUS.Mod ├── I386.octkComplexOptimized.Mod ├── I386.octkFIRConvolveOptimized.Mod ├── I386.octkLDSPFFTOptimized.Mod ├── I386.octkNUSIOptimized.Mod ├── Kernels.XML ├── OCTK.Tool ├── SNTP.Mod ├── loadnd.m ├── octkAMDCAL.Mod ├── octkAMDCALArrays.Mod ├── octkAMDCALComputeObjects.Mod ├── octkAMDCALKernelTools.Mod ├── octkAMDCALObjects.Mod ├── octkAMDCALTest.Mod ├── octkArrayBool.Mod ├── octkArrayDataTypes.Mod ├── octkArrayIO.Mod ├── octkArrayMultiway.Mod ├── octkArrayNumeric.Mod ├── octkArrayObjects.Mod ├── octkArrayPermute.Mod ├── octkArraySepHandling.Mod ├── octkBSplKernels.Mod ├── octkBSplKernelsDiff.Mod ├── octkBSplMultires.Mod ├── octkBSplTransforms.Mod ├── octkBase.Mod ├── octkClusterBase.Mod ├── octkClusterTest.Mod ├── octkClusterTools.Mod ├── octkComplex.Mod ├── octkComputeClusterNodes.Mod ├── octkComputeHostObjects.Mod ├── octkComputeManager.Mod ├── octkComputeObjects.Mod ├── octkComputeRemoteObjects.Mod ├── octkComputeServices.Mod ├── octkComputeTCPServices.Mod ├── octkComputeTest.Mod ├── octkErrorBase.Mod ├── octkFFT.Mod ├── octkFIRConvolve.Mod ├── octkIIRConvolve.Mod ├── octkLDSPFFT.Mod ├── octkLDSPFFTReal.Mod ├── octkLDSPFFTRealTest.Mod ├── octkLDSPFFTTest.Mod ├── octkMatrixSparse.Mod ├── octkMatrixSparseTest.Mod ├── octkMultiThreadBase.Mod ├── octkNUSI.Mod ├── octkNUSICluster.Mod ├── octkNUSIMultigrid.Mod ├── octkNUSIMultires.Mod ├── octkNUSIRegularize.Mod ├── octkNUSITest.Mod ├── octkNUSIVector.Mod ├── octkPDE.Mod ├── octkQuickSort.Mod ├── octkRAPIClient.Mod ├── octkRAPIServer.Mod ├── octkRandomBase.Mod ├── octkRandomUniform.Mod ├── octkResample.Mod ├── octkServices.Mod ├── octkSimpleNUSI.Mod ├── octkSolverBICGSTAB.Mod ├── octkSolverBase.Mod ├── octkSolverCG.Mod ├── octkSolverJacobi.Mod ├── octkSolverMultigrid.Mod ├── octkSolverTest.Mod ├── octkSortBase.Mod ├── octkStopwatch.Mod ├── octkTensor.Mod ├── octkTensorTest.Mod ├── octkTime.Mod ├── octkTrace.Mod └── savend.m ├── OpenDocument ├── OpenDocument.Mod ├── OpenDocumentCodecs.Mod ├── OpenDocumentHowto.Text ├── OpenDocumentTransforms.Mod └── XMLSignatures.Mod ├── PH ├── Contents.txt ├── IPMonitor.Mod ├── PHRegistries.Mod ├── PHUserRegistry.Mod └── PHWebSyndication.Mod ├── Reanimator └── JAOS │ ├── Documentation │ ├── JAOSReportDE.pdf │ ├── SSW04_9_JVM_1x.pdf │ └── eth-26497-02.pdf │ ├── README │ ├── bin │ └── glibj-0.6.zip │ ├── classpath │ └── vm │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── kaffe │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── java │ │ │ ├── Makefile.am │ │ │ └── Makefile.in │ │ ├── kaffe │ │ │ ├── Makefile.am │ │ │ └── Makefile.in │ │ └── native │ │ │ ├── Makefile.am │ │ │ └── Makefile.in │ │ └── reference │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── gnu │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ └── vm │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ └── stack │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── StackFrame.java │ │ │ └── StackTrace.java │ │ ├── java │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ └── lang │ │ │ ├── Class.java │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── Runtime.java │ │ │ ├── Thread.java │ │ │ ├── Throwable.java │ │ │ ├── VMClassLoader.java │ │ │ ├── VMObject.java │ │ │ ├── VMSecurityManager.java │ │ │ ├── VMSystem.java │ │ │ └── reflect │ │ │ ├── Constructor.java │ │ │ ├── Field.java │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ └── Method.java │ │ └── oberon │ │ └── OberonEnv.java │ └── source │ ├── JVM.Mod │ ├── JVM.OpCodeInfo │ ├── JVMBase.Mod │ ├── JVMCompiler.Mod │ ├── JVMCompiler0.Mod │ ├── JVMConsole.Mod │ ├── JVMConverter.Mod │ ├── JVMDebug.Mod │ ├── JVMEmpty.Mod │ ├── JVMExceptions.Mod │ ├── JVMInterfaces.Mod │ ├── JVMLinker.Mod │ ├── JVMLoader.Mod │ ├── JVMOptCompiler.Mod │ ├── JVMParser.Mod │ ├── JVMRefs.Mod │ ├── JVMStubs.Mod │ ├── JVMSystem.Mod │ ├── JVMThreads.Mod │ ├── JVMTypes.Mod │ ├── JVMUI.Mod │ ├── Jaos.Tool │ ├── JaosLicense.Text │ ├── jjNio.Mod │ ├── jjaAosGraphics.Mod │ ├── jjaGraphics.Mod │ ├── jjiFile.Mod │ ├── jjiFileDescriptor.Mod │ ├── jjiFileInputStream.Mod │ ├── jjiFileOutputStream.Mod │ ├── jjiInputStream.Mod │ ├── jjiOutputStream.Mod │ ├── jjlDouble.Mod │ ├── jjlFloat.Mod │ ├── jjlMath.Mod │ ├── jjlNumber.Mod │ ├── jjlObject.Mod │ ├── jjlStackTraceElement.Mod │ ├── jjlString.Mod │ ├── jjlSystem.Mod │ ├── jjlThrowable.Mod │ ├── jjlVMClassLoader.Mod │ ├── jjlVMSecurityManager.Mod │ ├── jjlVMSystem.Mod │ └── jjlVMThrowable.Mod ├── Usb ├── FTD2XX.Mod ├── Testlibusb.Mod └── libusb.Mod ├── V4L2 ├── Unix.V4L2.Mod ├── Unix.VideoExample.Mod ├── Unix.libv4l2.Mod └── V4L2.Tool ├── Work ├── Bindings │ ├── BASS │ │ ├── BASS.Text │ │ ├── Darwin.BASS.Mod │ │ ├── Unix.BASS.Mod │ │ └── Windows.BASS.Mod │ ├── Windows.Pipe.Mod │ └── Windows.UnRAR.Mod ├── Branch │ ├── PET.Mod │ ├── PETTrees.Mod │ ├── SyntaxHighlighter.XML │ └── WMTextView.Mod ├── BuildAll.Tool ├── Components │ ├── WMChart.Mod │ ├── WMChartTest.Mod │ ├── WMComboBox.Mod │ ├── WMLCD.Mod │ └── WMLEDLadder.Mod ├── Debugger │ ├── Compiler │ │ ├── FoxAMDBackend.Mod │ │ └── FoxAMDBackend.Mod.Org │ ├── DebugInfo.Mod │ ├── DebuggerBase.Mod │ ├── I386.Debugger.Mod │ ├── WMHexEditor.Mod │ └── debugger.doc ├── DelBak.bat ├── Demos │ ├── Test.Mod │ ├── VisualContainer │ │ ├── FloatAA.Mod │ │ ├── VCBase.Mod │ │ ├── VCObjects.Mod │ │ ├── VCPoly.Mod │ │ ├── VCTypes.Mod │ │ └── WMVC.Mod │ ├── WMAStar.Mod │ ├── WMAStarSet.Mod │ ├── WMBass3DTest.Mod │ ├── WMBassDSPTest.Mod │ ├── WMColorLines.Mod │ ├── WMFM.Mod │ ├── WMRaycaster.Mod │ ├── WMRaycasterMaze.Mod │ └── WMXmas.Mod ├── Dialogs │ └── WMColorPicker.Mod ├── Examples │ ├── NanoA2.zip │ ├── RegExp │ │ ├── RegExpDFA.Mod │ │ ├── RegExpMaps.Mod │ │ ├── RegExpNFA.Mod │ │ ├── RegExpParse.Mod │ │ └── RegExpSubsetConstruct.Mod │ ├── TestRAR.Mod │ └── WMAAGraphicsExample.Mod ├── Libs │ ├── AAGraphics.Mod │ ├── AAGraphics2.Mod │ ├── CanvasTools.Mod │ ├── Containers.Mod │ ├── Generics.Mod │ ├── I386.Math.Mod │ ├── I386.MathL.Mod │ ├── MathUtils.Mod │ ├── PreciseTimer.Mod │ ├── WMPrinter.Mod │ ├── WinDll │ │ ├── DLL.Mod │ │ ├── SQLite3Test.Mod │ │ ├── TestDll.Mod │ │ ├── Win32.SQLite3.Mod │ │ ├── testa2.dll │ │ └── testa2.dpr │ ├── Windows.PreciseTimer.Mod │ └── ZipLoader.Mod ├── Projects │ ├── Raytracer │ │ ├── AA2DGraphics.Mod │ │ ├── AA2DGraphicsTest.Mod │ │ ├── Lesson1.Mod │ │ ├── Lesson6.Mod │ │ ├── Lesson7.Mod │ │ ├── Lib3D.Mod │ │ ├── Lib3D_SSE.Mod │ │ ├── VectorSSE.Mod │ │ ├── WMClock.Mod │ │ ├── lesson7a.Mod │ │ ├── lesson7b.Mod │ │ └── lesson7c.Mod │ └── WinMM │ │ ├── Win32.WinMM.Mod │ │ ├── Win32.WinMMSound.Mod │ │ └── Win32.WinMMUtils.Mod ├── Resources │ ├── WMBass3DTest.xml │ ├── WMBassDSPTest.xml │ ├── WMColorLines.zip │ ├── WMColorPicker.Zip │ ├── WMRaycaster.zip │ └── WMVC.zip ├── SyntaxHighlighter.XML └── Tools │ ├── ImportCollector.Mod │ ├── ImportGraph.Mod │ ├── PascalPreprocessor.Mod │ ├── PascalProjectCombine.Mod │ ├── PascalScanner.Mod │ ├── VirtualKbd │ ├── VirtualKBD.Mod │ ├── WMKBD.Mod │ ├── wmkbd.en.xml │ ├── wmkbd.ens.xml │ └── wmkbd.num.xml │ └── Windows.WinStarter.Mod ├── peasthope ├── OLR.System.1.jpg ├── OberonCF0.Dsk └── README └── sr └── tracer ├── sr.Recticle.png ├── sr.dotz.png ├── sr.leafs.png ├── sr.lobster.png ├── sr.meeba.png ├── sr.mutatis.png ├── sr.qdog.png ├── sr.tracericon.png ├── sr.tracericonsmall.png ├── srBase.Mod ├── srE.Mod ├── srFRep.Mod ├── srGL.Mod ├── srHalfSpace.Mod ├── srHex.Mod ├── srImage.Mod ├── srLifeVox.Mod ├── srM2Space.Mod ├── srM3Space.Mod ├── srM5Space.Mod ├── srMarsh.Mod ├── srMath.Mod ├── srRastermovie.Mod ├── srRender.Mod ├── srRenderTools.Text ├── srRetina.Mod ├── srRotaVox.Mod ├── srTexVox.Mod ├── srVoxel.Mod ├── srVoxel2.Mod ├── srVoxel3.Mod └── srVoxel4.Mod /Documentation/A2Documentation.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Documentation/A2Documentation.odt -------------------------------------------------------------------------------- /Documentation/A2Documentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Documentation/A2Documentation.pdf -------------------------------------------------------------------------------- /FreeImage/FreeImage.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/FreeImage/FreeImage.h -------------------------------------------------------------------------------- /FreeImage/FreeImage3170.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/FreeImage/FreeImage3170.pdf -------------------------------------------------------------------------------- /FreeImage/Whatsnew.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/FreeImage/Whatsnew.txt -------------------------------------------------------------------------------- /FreeImage/license-gplv3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/FreeImage/license-gplv3.txt -------------------------------------------------------------------------------- /Generics/GenericsUse.Mod: -------------------------------------------------------------------------------- 1 | MODULE GenericsUse; (** AUTHOR ""; PURPOSE ""; *) 2 | 3 | IMPORT 4 | Commands, SIZE_Containers := G(SIZE, L); 5 | 6 | PROCEDURE TestQueue(context: Commands.Context); 7 | VAR 8 | queue: SIZE_Containers.Queue; 9 | i: SIZE; 10 | BEGIN 11 | NEW(queue); 12 | FOR i := 0 TO 63 DO queue.Push(i) END; 13 | context.out.String("Popping sequentally added natural numbers from Queue (LIFO stack):"); context.out.Ln; 14 | WHILE queue.Pop(i) DO 15 | context.out.Int(i, 0); context.out.Char(20X) 16 | END; 17 | context.out.Ln 18 | END TestQueue; 19 | 20 | PROCEDURE TestDEQue(context: Commands.Context); 21 | VAR 22 | deque: SIZE_Containers.DEQue; 23 | i: SIZE; 24 | BEGIN 25 | NEW(deque); 26 | FOR i := 0 TO 63 DO deque.Push(i) END; 27 | context.out.String("Popping sequentally added natural numbers from DEQue (FIFO stack):"); context.out.Ln; 28 | WHILE deque.Pop(i) DO 29 | context.out.Int(i, 0); context.out.Char(20X) 30 | END; 31 | context.out.Ln 32 | END TestDEQue; 33 | 34 | PROCEDURE TestVector(context: Commands.Context); 35 | VAR 36 | vector: SIZE_Containers.Vector; 37 | i, value: SIZE; 38 | BEGIN 39 | NEW(vector); 40 | FOR i := 0 TO 63 DO IGNORE vector.Add(i) END; 41 | context.out.String("List sequentally added natural numbers from Vector:"); context.out.Ln; 42 | FOR i := 0 TO vector.Count() - 1 DO 43 | vector.Get(i, value); 44 | context.out.Int(value, 0); context.out.Char(20X) 45 | END; 46 | context.out.Ln; 47 | context.out.String("Index of 15 in Vector: "); context.out.Int(vector.IndexOf(15), 0); context.out.Ln; 48 | context.out.String("Index of 32 in Vector: "); context.out.Int(vector.IndexOf(32), 0); context.out.Ln; 49 | END TestVector; 50 | 51 | PROCEDURE Do*(context: Commands.Context); 52 | BEGIN 53 | TestQueue(context); 54 | TestDEQue(context); 55 | TestVector(context) 56 | END Do; 57 | 58 | PROCEDURE L(l, r: SIZE): BOOLEAN; 59 | BEGIN 60 | RETURN l < r 61 | END L; 62 | 63 | BEGIN 64 | 65 | END GenericsUse. 66 | 67 | GenericsUse.Do ~ 68 | System.Free GenericsUse ~ -------------------------------------------------------------------------------- /Matrix/ErrorBase.Mod: -------------------------------------------------------------------------------- 1 | MODULE ErrorBase; 2 | (* 3 | DESCRIPTION: 4 | Errors and warnings handling 5 | 6 | AUTHOR: 7 | Alexey Morozov 8 | *) 9 | 10 | IMPORT 11 | Out:=KernelLog; 12 | 13 | TYPE 14 | ERRSTR* = ARRAY 256 OF CHAR; 15 | WARNSTR* = ARRAY 256 OF CHAR; 16 | 17 | (* 18 | Error handler procedure 19 | errLocation - location of error occurence 20 | errText - text describing an error 21 | *) 22 | ErrorHandler* = PROCEDURE{DELEGATE}(CONST errLocation, errText: ARRAY OF CHAR); 23 | 24 | (* 25 | Warning handler procedure 26 | warnLocation - location of warning occurence 27 | warnText - text describing an warning 28 | *) 29 | WarningHandler* = PROCEDURE{DELEGATE}(CONST warnLocation, warnText: ARRAY OF CHAR); 30 | 31 | VAR 32 | (* exported error handler *) 33 | Error-: ErrorHandler; 34 | Warning-: WarningHandler; 35 | 36 | (*///////////////////////////////////////////////// 37 | DESCRIPTION: 38 | Default error handler 39 | INPUT: 40 | errLocation - location of error occurence 41 | errText - text describing the error 42 | /////////////////////////////////////////////////*) 43 | PROCEDURE HandleErrorDefault(CONST errLocation, errText: ARRAY OF CHAR); 44 | BEGIN 45 | Out.Enter; 46 | Out.String('Error in '); 47 | Out.String(errLocation); Out.String('-> '); 48 | Out.String(errText); Out.Ln; 49 | Out.Exit; 50 | HALT(100); 51 | END HandleErrorDefault; 52 | 53 | (*///////////////////////////////////////////////// 54 | DESCRIPTION: 55 | Default warning handler 56 | INPUT: 57 | warnLocation - location of warning occurence 58 | warnText - text describing the warning 59 | /////////////////////////////////////////////////*) 60 | PROCEDURE HandleWarningDefault(CONST warnLocation, warnText: ARRAY OF CHAR); 61 | BEGIN 62 | Out.Enter; 63 | Out.String('Warning in '); 64 | Out.String(warnLocation); Out.String('-> '); 65 | Out.String(warnText); Out.Ln; 66 | Out.Exit; 67 | END HandleWarningDefault; 68 | 69 | (*///////////////////////////////////////////////// 70 | DESCRIPTION: 71 | Setup of a new error handler 72 | INPUT: 73 | handler - pointer to a new procedure 74 | /////////////////////////////////////////////////*) 75 | PROCEDURE SetErrorHandler*(handler: ErrorHandler); 76 | BEGIN{EXCLUSIVE} 77 | IF handler # NIL THEN 78 | Error := handler; 79 | ELSE 80 | HandleErrorDefault('ErrorBase.SetErrorHandler','specified error handler is NIL!'); 81 | END; 82 | END SetErrorHandler; 83 | 84 | (*///////////////////////////////////////////////// 85 | DESCRIPTION: 86 | Setup of a new warning handler 87 | INPUT: 88 | handler - pointer to a new procedure 89 | /////////////////////////////////////////////////*) 90 | PROCEDURE SetWarningHandler*(handler: WarningHandler); 91 | BEGIN{EXCLUSIVE} 92 | IF handler # NIL THEN 93 | Warning := handler; 94 | ELSE 95 | Error('ErrorBase.SetWarningHandler','specified warning handler is NIL!'); 96 | END; 97 | END SetWarningHandler; 98 | 99 | BEGIN 100 | Error := HandleErrorDefault; 101 | Warning := HandleWarningDefault; 102 | END ErrorBase. -------------------------------------------------------------------------------- /Matrix/GeoTools.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Matrix/GeoTools.Mod -------------------------------------------------------------------------------- /Matrix/HypercubeMoments.Mod: -------------------------------------------------------------------------------- 1 | MODULE HypercubeMoments; (** AUTHOR "Patrick Hunziker"; PURPOSE ""; , all rights, 2008 **) 2 | 3 | IMPORT MatrixBase, Filters := LinearFilters, Transform := HypercubeTransform; 4 | 5 | CONST 6 | dirT = 0; dirZ = 1; dirY = 2; dirX = 3; skip = -1; 7 | 8 | TYPE 9 | Datatype = MatrixBase.Datatype; 10 | Cube = ARRAY [ * , * , * ] OF Datatype; 11 | Hypercube = ARRAY [ * , * , * , * ] OF Datatype; 12 | 13 | (** 14 | Precondition: 15 | Postcondition: 16 | *) 17 | PROCEDURE Moment*( CONST from: Hypercube; degreeX, degreeY, degreeZ, degreeT: SIGNED32 ): Hypercube; 18 | VAR MomentFilter0, MomentFilter1, MomentFilter2, filter: Filters.Filter; 19 | BEGIN 20 | ASSERT( LEN( from, 0 ) > 0 ); 21 | IF (LEN( RESULT, 0 ) # LEN( from, 0 )) OR (LEN( RESULT, 1 ) # LEN( from, 1 )) 22 | OR (LEN( RESULT, 2 ) # LEN( from, 2 )) OR (LEN( RESULT, 3 ) # LEN( from, 3 )) THEN 23 | NEW( RESULT, LEN( from, 0 ), LEN( from, 1 ), LEN( from, 2 ), LEN(from,3) ) 24 | END; 25 | IF (degreeX = degreeY) & (degreeY = degreeZ) & (degreeZ = degreeT) THEN 26 | IF degreeX = skip THEN RETURN RESULT 27 | ELSE filter := Filters.CreateSplineFilter( Filters.MomentCubic0 + degreeX ); 28 | Transform.Filter4D( from, RESULT, filter, {0, 1, 2, 3}, Transform.mirrorW ); 29 | RETURN RESULT 30 | END; 31 | END; 32 | MomentFilter0 := Filters.CreateSplineFilter( Filters.MomentCubic0 ); 33 | MomentFilter1 := Filters.CreateSplineFilter( Filters.MomentCubic1 ); 34 | MomentFilter2 := Filters.CreateSplineFilter( Filters.MomentCubic2 ); 35 | IF degreeX = 0 THEN Transform.Filter4D( from, RESULT, MomentFilter0, {dirX}, Transform.mirrorW ) 36 | ELSIF degreeX = 1 THEN Transform.Filter4D( from, RESULT, MomentFilter1, {dirX}, Transform.antimirrorW ) 37 | ELSIF degreeX = 2 THEN Transform.Filter4D( from, RESULT, MomentFilter2, {dirX}, Transform.mirrorW ) 38 | ELSIF degreeX = skip THEN 39 | RESULT := from; (*copy unchanged to result cube*) 40 | END; 41 | IF degreeY = 0 THEN Transform.Filter4D( RESULT, RESULT, MomentFilter0, {dirY}, Transform.mirrorW ) 42 | ELSIF degreeY = 1 THEN Transform.Filter4D( RESULT, RESULT, MomentFilter1, {dirY}, Transform.antimirrorW ) 43 | ELSIF degreeY = 2 THEN Transform.Filter4D( RESULT, RESULT, MomentFilter2, {dirY}, Transform.mirrorW ) 44 | ELSIF degreeY = skip THEN (*nothing*) 45 | END; 46 | IF degreeZ = 0 THEN Transform.Filter4D( RESULT, RESULT, MomentFilter0, {dirZ}, Transform.mirrorW ) 47 | ELSIF degreeZ = 1 THEN Transform.Filter4D( RESULT, RESULT, MomentFilter1, {dirZ}, Transform.antimirrorW ) 48 | ELSIF degreeZ = 2 THEN Transform.Filter4D( RESULT, RESULT, MomentFilter2, {dirZ}, Transform.mirrorW ) 49 | ELSIF degreeZ = skip THEN (*nothing*) 50 | END; 51 | IF degreeT = 0 THEN Transform.Filter4D( RESULT, RESULT, MomentFilter0, {dirT}, Transform.mirrorW ) 52 | ELSIF degreeT = 1 THEN Transform.Filter4D( RESULT, RESULT, MomentFilter1, {dirT}, Transform.antimirrorW ) 53 | ELSIF degreeT = 2 THEN Transform.Filter4D( RESULT, RESULT, MomentFilter2, {dirT}, Transform.mirrorW ) 54 | ELSIF degreeT = skip THEN (*nothing*) 55 | END; 56 | RETURN RESULT; 57 | END Moment; 58 | 59 | END HypercubeMoments. 60 | 61 | OFormatter.Format * -------------------------------------------------------------------------------- /Matrix/JDMathL.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Matrix/JDMathL.Mod -------------------------------------------------------------------------------- /Matrix/LinearFIRConvolveLongReal.Mod: -------------------------------------------------------------------------------- 1 | MODULE LinearFIRConvolveLongReal; (** Patrick Hunziker & dk(assembler) **) 2 | (** implements basic FIR convolutions for convolve, convolve+downsample, convolve+upsample *) 3 | 4 | IMPORT LinearFilters; 5 | 6 | PROCEDURE Convolve*(CONST filter:ARRAY[*] OF FLOAT64; CONST data:ARRAY [*] OF FLOAT64; VAR result:ARRAY [*] OF FLOAT64); 7 | VAR d,filterlen,reslen:SIZE; 8 | BEGIN 9 | filterlen:=LEN(filter,0); 10 | IF LEN(data,0)=lower) & (x<=upper) 13 | END Inside; 14 | 15 | 16 | 17 | (* implementation note: matrix index order is m[y,x]*) 18 | PROCEDURE Line*(VAR m:Matrix; x0,y0,x1,y1:SIZE; value:Datatype); 19 | VAR i, x,y, dx,dy,min,max:SIZE; slope:Datatype; 20 | BEGIN 21 | IF ~(Inside(x0,0,LEN(m,1)) & Inside(y0,0,LEN(m,0)) &Inside(x1,0,LEN(m,1)) &Inside(y1,0,LEN(m,0))) THEN RETURN END; 22 | IF ABS(x1-x0) >= ABS(y1-y0) THEN 23 | IF (x1=x0) THEN IF Inside(y0,0,LEN(m,0)-1) & Inside(x0,0,LEN(m,1)-1) THEN m[y0,x0]:=value; END; RETURN END; 24 | slope:=(y1-y0) / (x1-x0); 25 | min:=MIN(x0,x1); max:=MAX(x0,x1); 26 | FOR i:=min TO max DO 27 | dx:=i-x0; 28 | dy:=ENTIER(dx * slope); 29 | x:=x0+dx; y:=y0+dy; 30 | IF Inside(y,0,LEN(m,0)-1) & Inside(x,0,LEN(m,1)-1) THEN m[y,x]:=value; END; 31 | END; 32 | ELSE 33 | IF (y1= y0) THEN IF Inside(y0,0,LEN(m,0)-1) & Inside(x0,0,LEN(m,1)-1) THEN m[x0,y0]:=value; END; RETURN END; 34 | slope:=(x1-x0) / (y1-y0); 35 | min:=MIN(y0,y1); max:=MAX(y0,y1); 36 | FOR i:=min TO max DO 37 | dy:=i-y0; 38 | dx:=ENTIER(dy * slope); 39 | x:=x0+dx; y:=y0+dy; 40 | IF Inside(y,0,LEN(m,0)-1) & Inside(x,0,LEN(m,1)-1) THEN m[y,x]:=value; END; 41 | END; 42 | END; 43 | END Line; 44 | 45 | PROCEDURE Dot*(x,y:SIGNED32); 46 | END Dot; 47 | 48 | PROCEDURE Graph*(curve:Curve1D); 49 | END Graph; 50 | 51 | PROCEDURE Curve*(curve:Curve2D); 52 | END Curve; 53 | 54 | PROCEDURE Arc*; 55 | END Arc; 56 | 57 | PROCEDURE Circle*; 58 | END Circle; 59 | 60 | PROCEDURE Ellipse*; 61 | END Ellipse; 62 | 63 | PROCEDURE Rectangle*; 64 | END Rectangle; 65 | 66 | 67 | 68 | 69 | PROCEDURE Arrow*(VAR m:Matrix; x0,y0,x1,y1:SIGNED32; value:Datatype); 70 | CONST pi=3.1516; headscale= 0.25; 71 | (*ShowZero=FALSE;*) 72 | VAR size:SIGNED32; alpha, head: FLOAT64; 73 | BEGIN 74 | alpha:=arctan2(x1-x0,y1-y0); 75 | size:=MAX(ABS(x1-x0), ABS(y1-y0)); 76 | head:=size * headscale (* + 2 *); 77 | (*IF ShowZero OR (x0#x1) OR (y0#y1) THEN*) 78 | Line(m,x0,y0,x1,y1,value); 79 | Line(m,x1,y1, x1 - ENTIER(0.5+head * Mathe.cos(alpha + pi/8)), y1 - ENTIER(0.5+head * Mathe.sin(alpha + pi/8)), value); 80 | Line(m,x1,y1, x1 - ENTIER(0.5+head * Mathe.cos(alpha - pi/8)), y1 - ENTIER(0.5+head * Mathe.sin(alpha - pi/8)), value); 81 | (*END;*) 82 | END Arrow; 83 | 84 | PROCEDURE arctan2*(x,y:Datatype):Datatype; (*arctan in range 0..2pi*) 85 | BEGIN 86 | IF (x>0) & (y>=0) THEN RETURN Mathe.arctan(y/x) 87 | ELSIF (x>0) & (y<0) THEN RETURN Mathe.arctan(y/x)+2*Mathe.pi 88 | ELSIF x<0 THEN RETURN Mathe.arctan(y/x)+Mathe.pi 89 | ELSIF (x=0) & (y>0) THEN RETURN Mathe.pi/2 90 | ELSIF (x=0) & (y<0) THEN RETURN 3*Mathe.pi/2 91 | ELSE (*( x=0) & (y=0) *) RETURN 0 (*or RETURN NaN ?*) 92 | END 93 | END arctan2; 94 | 95 | END MatrixFigures. 96 | fofPC.Compile \f * 97 | -------------------------------------------------------------------------------- /Matrix/MatrixMoments.Mod: -------------------------------------------------------------------------------- 1 | MODULE MatrixMoments; (** AUTHOR "Patrick Hunziker"; PURPOSE ""; , all rights, 2008 **) 2 | 3 | IMPORT MatrixBase, Filters := LinearFilters, Transform := PlanarTransform; 4 | 5 | CONST 6 | dirX = 1; dirY = 0; Skip* = -1; 7 | 8 | TYPE 9 | Datatype = MatrixBase.Datatype; 10 | Matrix = ARRAY [ * , * ] OF Datatype; 11 | 12 | PROCEDURE Moment*( CONST from: Matrix; degreeX, degreeY: SIGNED32 ): Matrix; 13 | VAR MomentFilter0, MomentFilter1, MomentFilter2: Filters.Filter; 14 | BEGIN 15 | ASSERT( LEN( from, 0 ) > 0 ); 16 | IF (LEN( RESULT, 0 ) # LEN( from, 0 )) OR (LEN( RESULT, 1 ) # LEN( from, 1 )) THEN NEW( RESULT, LEN( from, 0 ), LEN( from, 1 ) ) END; 17 | MomentFilter0 := Filters.CreateSplineFilter( Filters.MomentCubic0 ); 18 | MomentFilter1 := Filters.CreateSplineFilter( Filters.MomentCubic1 ); 19 | MomentFilter2 := Filters.CreateSplineFilter( Filters.MomentCubic2 ); 20 | IF degreeX = 0 THEN Transform.Filter2D( from, RESULT, MomentFilter0, {dirX}, Transform.mirrorW ) 21 | ELSIF degreeX = 1 THEN Transform.Filter2D( from, RESULT, MomentFilter1, {dirX}, Transform.antimirrorW ) 22 | ELSIF degreeX = 2 THEN Transform.Filter2D( from, RESULT, MomentFilter2, {dirX}, Transform.mirrorW ) 23 | ELSIF degreeX = Skip THEN RESULT := from; (*copy unchanged to result cube*) 24 | END; 25 | IF degreeY = 0 THEN Transform.Filter2D( RESULT, RESULT, MomentFilter0, {dirY}, Transform.mirrorW ) 26 | ELSIF degreeY = 1 THEN Transform.Filter2D( RESULT, RESULT, MomentFilter1, {dirY}, Transform.antimirrorW ) 27 | ELSIF degreeY = 2 THEN Transform.Filter2D( RESULT, RESULT, MomentFilter2, {dirY}, Transform.mirrorW ) 28 | ELSIF degreeY = Skip THEN (*nothing*) 29 | END; 30 | RETURN RESULT; 31 | END Moment; 32 | 33 | END MatrixMoments. 34 | 35 | 36 | 37 | OFormatter.Format * 38 | -------------------------------------------------------------------------------- /Matrix/MatrixOpticalFlow.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Matrix/MatrixOpticalFlow.Mod -------------------------------------------------------------------------------- /Matrix/MatrixPrincipalComponents.Mod: -------------------------------------------------------------------------------- 1 | MODULE MatrixPrincipalComponents; (** AUTHOR "Patrick Hunziker"; PURPOSE "Principal Component Analysis"; **) 2 | 3 | IMPORT MatrixBase, MatrixSVD, Util:= MatrixUtilities, MathL; 4 | 5 | TYPE 6 | Datatype = MatrixBase.Datatype; 7 | Matrix = MatrixBase.Matrix; 8 | Vector = MatrixBase.Vector; 9 | 10 | (*precondition: 11 | see Wikipedia: Principal_Component_Analysis 12 | XT: n rows, each representing one multiparameter observation 13 | m columns, each representing a parameter 14 | XT needs to have empirical mean of 0, i.e. subtration of mean from each column; 15 | YT: n rows of observations 16 | m columns (or M largest components) 17 | *) 18 | 19 | TYPE PCA*= OBJECT (MatrixBase.Solver) 20 | VAR X, U: Matrix; svd: MatrixSVD.Solver; 21 | Y, YT, SL: Matrix; 22 | initialized, ytdone:BOOLEAN; 23 | PROCEDURE &Init*(CONST XT: Matrix); 24 | BEGIN 25 | ytdone:=FALSE; 26 | IF LEN(XT,0)=0 THEN 27 | initialized:=FALSE; RETURN 28 | ELSE 29 | X:=XT`; 30 | NEW(svd,X); 31 | svd.SortDescending; 32 | initialized:=TRUE; 33 | END; 34 | END Init; 35 | 36 | (* computing PCA through SVD. as an alternative, see iterative computation, http://http://en.wikipedia.org/wiki/Principal_components_analysis *) 37 | PROCEDURE PrincipalComponents*():Matrix; (* returns YT *) 38 | BEGIN 39 | ASSERT(initialized); 40 | IF ytdone THEN RETURN YT 41 | ELSE 42 | (*YT:= svd.vt`*svd.w;*) 43 | YT:= svd.vtSorted`*svd.wSorted; 44 | ytdone:=TRUE; 45 | RETURN YT 46 | END; 47 | END PrincipalComponents; 48 | 49 | PROCEDURE LargestComponents*(M:SIGNED32): Matrix; (*returns Y with reduced size (not YT ! )*) 50 | BEGIN 51 | ASSERT(initialized & (M#0)); 52 | SL:=svd.wSorted[..M-1]; 53 | Y:=SL*svd.vtSorted; 54 | RETURN Y 55 | END LargestComponents; 56 | 57 | PROCEDURE Axes*():Matrix; (* principal axes with unit length *) 58 | VAR axislengths,unit: Vector; nullmatrix: Matrix; i:SIZE; scale: Datatype; 59 | BEGIN 60 | IF ~ytdone THEN RETURN nullmatrix END; 61 | NEW(U, LEN(YT,0), LEN(YT,1)); 62 | NEW(unit, LEN(YT,0)); unit:=1; 63 | axislengths:=unit*(YT.*YT); 64 | FOR i:=0 TO LEN(axislengths,0)-1 DO 65 | IF ABS(axislengths[i]) > 1.0E-6 THEN (*? eps handling can be improved*) 66 | scale:=1/MathL.sqrt(axislengths[i]); 67 | U[.., i]:= YT[..,i]*scale; 68 | ELSE 69 | U[.., i]:=0; 70 | END; 71 | END; 72 | RETURN U; 73 | END Axes; 74 | 75 | END PCA; 76 | 77 | PROCEDURE Test*; 78 | VAR XT: Matrix; 79 | pca:PCA; 80 | svd: MatrixSVD.Solver; 81 | C,U:Matrix; 82 | BEGIN 83 | XT:=[[3,1,0,0],[-3,0,1,0],[0,2,0,0],[0,-2,0,1],[0,-1,1,0],[0,0,-1,-1]]; 84 | NEW(pca,XT); 85 | NEW(svd, XT); svd.SortDescending; 86 | Util.OutMatrix(XT); 87 | C:=pca.PrincipalComponents(); (* this is YT *) 88 | Util.OutMatrix(C); 89 | Util.OutMatrix(pca.LargestComponents(3)`); (* this is Y, i.e. needs to be transposed compared to above*) 90 | U:=pca.Axes(); 91 | Util.OutMatrix(U); 92 | (*Util.OutMatrix(U*U`);*) (*why not orthonormal ?*) 93 | Util.OutVector( (C.*C)*[1,1,1,1,1,1]); (*check rowwise variance*) 94 | Util.OutVector( [1,1,1,1,1,1]*(C.*C)); (*check columnwise variance*) 95 | Util.OutVector( [1,1,1,1,1,1]*(U.*U)); (*check columnwise unit vector length*) 96 | 97 | END Test; 98 | 99 | END MatrixPrincipalComponents. 100 | 101 | System.Free MatrixPrincipalComponents ~ 102 | System.FreeDownTo MatrixUtilities ~ 103 | MatrixPrincipalComponents.Test ~ 104 | fofPC.Compile \s * ~ 105 | fofPC.Compile \f * ~ 106 | OFormatter.Format * 107 | 108 | -------------------------------------------------------------------------------- /Matrix/MatrixRoots.Mod: -------------------------------------------------------------------------------- 1 | MODULE MatrixRoots; (** AUTHOR "PH"; PURPOSE "compute square root etc of matrices"; *) 2 | (*computing the square root of matrices. see wikipedia: "Square root of a matrix" *) 3 | 4 | IMPORT MatrixBase, MatrixUtilities, MatrixStandardSolvers; 5 | 6 | CONST threshold=0.0001; 7 | 8 | TYPE 9 | Datatype=MatrixBase.Datatype; 10 | Matrix=MatrixBase.Matrix; 11 | 12 | 13 | (*altgorithms: searching square root of A ; i.e. A power(1/2) 14 | 15 | - by diagonalization: 16 | D = Vinv * A * V (*diagonalize using V created from n Eigenvectros as columns*) 17 | now, A = V * D * Vinv 18 | sqrt(A) = V* sqrt(D) * Vinv 19 | 20 | - by calculating the Jordan normal form, followed by a series expansion, similar to the approach used for matrix logarithm 21 | 22 | - by Denman-Beavers square root iteration 23 | *) 24 | 25 | (** input: matrix A; output: R = sqrt(A), and its inverse Rinv *) 26 | PROCEDURE SquareRoot*(CONST A: Matrix; VAR R, Rinv:Matrix); (*implemented using Denman-Beavers*) 27 | VAR tmpR: Matrix; Inv:MatrixStandardSolvers.LU; i:SIGNED32; 28 | BEGIN 29 | R:=A; 30 | IF (LEN(Rinv,0)#LEN(A,0)) OR (LEN(Rinv,1)#LEN(A,1))THEN NEW(Rinv,LEN(A,0),LEN(A,1)); END; 31 | MatrixUtilities.Identity(Rinv); 32 | NEW(Inv,Rinv); 33 | i:=0; 34 | REPEAT 35 | Inv.Init(Rinv); 36 | tmpR:=R+Inv.Inverse(); tmpR:=tmpR/2; 37 | Inv.Init(R); 38 | Rinv:=Rinv+Inv.Inverse(); Rinv:=Rinv/2; 39 | R:=tmpR; 40 | INC(i); 41 | UNTIL (sumofsquares(R*R-A) < threshold) OR (i>30) ; (*To do: better/cheaper termination criteria*) 42 | RETURN 43 | END SquareRoot; 44 | 45 | PROCEDURE sumofsquares(CONST A:Matrix):Datatype; 46 | BEGIN 47 | RETURN A +* A 48 | END sumofsquares; 49 | 50 | PROCEDURE {TEST} Test*; 51 | CONST TestThreshold=0.0001; 52 | VAR A,R,Rinv, E: Matrix; error:Datatype; 53 | BEGIN 54 | A:=[[6,2,3,1],[1,5,2,2],[1,2,7,4],[2,2,3,8]]; 55 | SquareRoot(A,R,Rinv); 56 | (*MatrixUtilities.OutMatrix(A); 57 | MatrixUtilities.OutMatrix(R); 58 | MatrixUtilities.OutMatrix(R*R);*) 59 | E:=R*R-A; 60 | error:=E+*E; 61 | ASSERT( error < TestThreshold, 201); 62 | END Test; 63 | 64 | 65 | 66 | END MatrixRoots. 67 | 68 | MatrixRoots.Test 69 | SystemTools.Free MatrixRoots ~ 70 | -------------------------------------------------------------------------------- /Matrix/MatrixStreams.Mod: -------------------------------------------------------------------------------- 1 | MODULE MatrixStreams ; (** AUTHOR "Patrick Hunziker"; PURPOSE ""; **) 2 | IMPORT Streams; 3 | 4 | TYPE Datatype = FLOAT64; 5 | 6 | TYPE Reader* = OBJECT (Streams.Reader); 7 | (* 8 | PROCEDURE Tensor*(): ARRAY [?] OF Datatype; 9 | VAR dims, Rows,Cols, Start, Row,Col: SIGNED32; m:ARRAY [?] OF Datatype; 10 | BEGIN 11 | RawLInt(dims); RawLInt(Rows); RawLInt(Cols); 12 | NEW(m,Rows,Cols); 13 | FOR Row:=0 TO Rows-1 DO 14 | FOR Col:=0 TO Cols-1 DO 15 | RawLReal(m[Row,Col]) 16 | END; 17 | END; 18 | 19 | RETURN m 20 | END Tensor; 21 | *) 22 | PROCEDURE Volume(lenX,lenY,lenZ:SIGNED32): ARRAY [*,*,*] OF SIGNED8; 23 | VAR res: ARRAY [*,*,*] OF SIGNED8; x,y,z:SIGNED32; 24 | BEGIN 25 | NEW(res,lenZ,lenY,lenX); 26 | FOR z:=0 TO lenZ-1 DO 27 | FOR y:=0 TO lenY-1 DO 28 | FOR x:=0 TO lenX-1 DO 29 | RawSInt(res[z,y,x]); 30 | END; 31 | END; 32 | END; 33 | RETURN res 34 | END Volume; 35 | 36 | 37 | PROCEDURE Matrix*(): ARRAY [*,*] OF Datatype; 38 | VAR Rows,Cols, Start, Row,Col: SIGNED32; m:ARRAY [*,*] OF Datatype; 39 | BEGIN 40 | RawLInt(Rows); RawLInt(Cols); 41 | NEW(m,Rows,Cols); 42 | FOR Row:=0 TO Rows-1 DO 43 | FOR Col:=0 TO Cols-1 DO 44 | RawLReal(m[Row,Col]) 45 | END; 46 | END; 47 | RETURN m 48 | END Matrix; 49 | 50 | PROCEDURE Vector*():ARRAY [*] OF Datatype; 51 | VAR Rows,Cols, Start, Row,Col: SIGNED32; v:ARRAY [*] OF Datatype; 52 | BEGIN 53 | RawLInt(Cols); 54 | NEW(v,Cols); 55 | FOR Col:=0 TO Cols-1 DO 56 | RawLReal(v[Col]) 57 | END; 58 | RETURN v 59 | END Vector; 60 | 61 | END Reader; 62 | 63 | Writer* = OBJECT (Streams.Writer); 64 | (* 65 | PROCEDURE Tensor*( m: ARRAY [?] OF Datatype); 66 | VAR dims, Rows,Cols, Start, Row,Col: SIGNED32; 67 | BEGIN 68 | RawLInt(dims); RawLInt(Rows); RawLInt(Cols); 69 | NEW(m,Rows,Cols); 70 | FOR Row:=0 TO Rows-1 DO 71 | FOR Col:=0 TO Cols-1 DO 72 | RawLReal(m[Row,Col]) 73 | END; 74 | END; 75 | END Tensor; 76 | *) 77 | 78 | PROCEDURE Matrix*(CONST m: ARRAY [*,*] OF Datatype); 79 | VAR Rows,Cols, Start, Row,Col: SIGNED32; 80 | BEGIN 81 | Rows:=LEN(m,0)(SIGNED32); Cols:=LEN(m,1)(SIGNED32); 82 | RawLInt(Rows); RawLInt(Cols); 83 | FOR Row:=0 TO Rows-1 DO 84 | FOR Col:=0 TO Cols-1 DO 85 | RawLReal(m[Row,Col]) 86 | END; 87 | END; 88 | END Matrix; 89 | 90 | PROCEDURE Vector*(CONST v : ARRAY [*] OF Datatype); 91 | VAR Rows,Cols, Start, Row,Col: SIGNED32; 92 | BEGIN 93 | Cols:=LEN(v,0)(SIGNED32); 94 | RawLInt(Cols); 95 | FOR Col:=0 TO Cols-1 DO 96 | RawLReal(v[Col]) 97 | END; 98 | END Vector; 99 | 100 | END Writer; 101 | 102 | (** Open a writer to the specified stream sender. Update must be called after writing to ensure the buffer is written to the stream. *) 103 | PROCEDURE OpenWriter*( VAR b: Writer; send: Streams.Sender ); 104 | BEGIN 105 | NEW( b, send, Streams.DefaultWriterSize ) 106 | END OpenWriter; 107 | 108 | 109 | (** Open a reader from the specified stream receiver. *) 110 | PROCEDURE OpenReader*( VAR b: Reader; receive: Streams.Receiver ); 111 | BEGIN 112 | NEW( b, receive, Streams.DefaultReaderSize ) 113 | END OpenReader; 114 | 115 | END MatrixStreams. 116 | 117 | 118 | fofPC.Compile * 119 | -------------------------------------------------------------------------------- /Matrix/PlanarBlobDetectors.Mod: -------------------------------------------------------------------------------- 1 | MODULE PlanarBlobDetectors; (** AUTHOR "Patrick Hunziker"; PURPOSE "Blob detection"; *) 2 | (*! alpha version - work in progress *) 3 | 4 | (*see http://en.wikipedia.org/wiki/Blob_detection *) 5 | 6 | IMPORT PlanarBase, PlanarNabla, PlanarTransform, WMMatrix,LinearFilters, StatisticsBase; 7 | 8 | TYPE 9 | Datatype=PlanarBase.Datatype; 10 | ScalarField=PlanarNabla.ScalarField; 11 | 12 | (** Laplacian of Gaussian is a classic blob detector. *) 13 | (* Laplacian of Gaussian: 14 | Support of Window Defines the Responsivity of the operator. Use sampling modes from PlanarNabla.Mod *) 15 | (*! not yet finished: support width. Best used in a scale-space setup, i.e. multiresolution or multiple Gauss Support *) 16 | PROCEDURE LaplacianOfGaussian*(CONST p:ScalarField; sampling:SIGNED32):ScalarField; 17 | BEGIN 18 | RETURN PlanarNabla.Laplacian(Smooth(p), sampling); (*smoothing approximates gaussian filtering*) 19 | END LaplacianOfGaussian; 20 | 21 | (*to do: PROCEDURE DeterminantOfHessian() *) 22 | 23 | (*to do: PROCEDURE HessianLaplace()b*) 24 | 25 | (*to do: Lindeberg's watershed *) 26 | 27 | (*to do PROCEDURE SplineBased..*) 28 | 29 | (*to do: Scale-Space approach*) 30 | 31 | PROCEDURE Smooth(CONST data:ScalarField):ScalarField; 32 | VAR fir:LinearFilters.Filter; 33 | BEGIN 34 | fir:=LinearFilters.CreateSplineFilter(LinearFilters.InverseBSpline7); (*with increasing spline degree, b-Spline filters approximate a gaussian*) 35 | IF LEN(RESULT)#LEN(data) THEN NEW(RESULT,LEN(data)) END; 36 | PlanarTransform.Filter2D(data,RESULT, fir, {0,1}, PlanarTransform.mirrorH); 37 | RETURN RESULT 38 | END Smooth; 39 | 40 | PROCEDURE LineNonMaxSuppression*(CONST in: ARRAY [*] OF Datatype; VAR out: ARRAY [*] OF Datatype); 41 | CONST KeepEquals=TRUE; 42 | VAR i:SIZE; 43 | BEGIN 44 | IF in[0]>in[1] THEN out[0]:=1 ELSE out[1]:=0 END; 45 | IF in[LEN(in,0)-1]>in[LEN(in,0)-2] THEN out[LEN(in,0)-1]:=1 ELSE out[LEN(in,0)-1]:=0 END; 46 | FOR i:=1 TO LEN(in,0)-2 DO 47 | IF KeepEquals THEN 48 | IF (in[i]=MAX(in[i-1..i+1])) THEN out[i]:=1 ELSE out[i]:=0 END; 49 | ELSE 50 | IF (in[i]>in[i-1]) & (in[i]>in[i+1]) THEN out[i]:=1 ELSE out[i]:=0 END; 51 | END; 52 | END; 53 | END LineNonMaxSuppression; 54 | 55 | PROCEDURE PlanarMaxima*(CONST in: ScalarField):ScalarField; 56 | VAR i,j: SIZE; 57 | BEGIN (*!tbd: boundaries*) 58 | IF ~(LEN(RESULT)>= LEN(in)) THEN NEW(RESULT, LEN(in)) END; 59 | FOR j:=1 TO LEN(in,0)-2 DO 60 | FOR i:=1 TO LEN(in,1)-2 DO 61 | IF (in[j,i]=MAX(in[j-1..j+1,i-1..i+1])) & (in[j,i]>MIN(in[j-1..j+1,i-1..i+1])) THEN 62 | RESULT[j,i]:=1.0 ELSE RESULT[j,i]:=0.0 63 | END; 64 | END; 65 | END; 66 | RETURN RESULT 67 | END PlanarMaxima; 68 | 69 | (** Non -maxima suppression in 2D *) 70 | PROCEDURE NonMaximaSuppression*(CONST in:ScalarField):ScalarField; 71 | VAR m:ScalarField; 72 | BEGIN 73 | m:=PlanarMaxima(Smooth(in)); 74 | RETURN m.*in; 75 | END NonMaximaSuppression; 76 | 77 | PROCEDURE Test*; 78 | VAR in,out: ScalarField; window: WMMatrix.Window; 79 | BEGIN 80 | NEW(in,100,100); 81 | in[40..60,40..60]:=1; 82 | NEW(window, LaplacianOfGaussian(in, PlanarNabla.centered), "LOG 20"); window.AddWindow; 83 | in:=0; in[48..51, 48..51]:=1; 84 | NEW(window, LaplacianOfGaussian(in, PlanarNabla.centered), "LOG 4"); window.AddWindow; 85 | in:=0; in[49..50, 49..50]:=1; 86 | NEW(window, LaplacianOfGaussian(in, PlanarNabla.centered), "LOG 2"); window.AddWindow; 87 | in:=0; in[49..50, 49..50]:=1; 88 | in:=Smooth(in); 89 | out:=NonMaximaSuppression(in); 90 | NEW(window, out, "Planar maxima"); window.AddWindow; 91 | 92 | END Test; 93 | 94 | 95 | END PlanarBlobDetectors. 96 | 97 | PlanarBlobDetectors.Test 98 | 99 | System.FreeDownTo WMMatrix PlanarBlobDetectors ~ 100 | -------------------------------------------------------------------------------- /Matrix/PlanarMath.Mod: -------------------------------------------------------------------------------- 1 | MODULE PlanarMath; 2 | 3 | (*To do: complex derivatives including complex optimization algorithms: see 4 | Kenneth Kreutz-Delgado : The Complex Gradient Operator and the CR-Calculus. 5 | ECE275A - Lecture Supplement - Fall 2006: "complex_derivatives.pdf *) 6 | 7 | IMPORT MatrixBase, LinearMath, Mathe:=MathL, PMath; 8 | 9 | TYPE 10 | Datatype=MatrixBase.Datatype; 11 | Array = ARRAY [*,*] OF Datatype; 12 | 13 | PROCEDURE Max*(CONST a,b:Array):Array; 14 | VAR i:SIZE; 15 | BEGIN 16 | ASSERT(LEN(a)=LEN(b)); 17 | IF LEN(RESULT,0)#LEN(a) THEN NEW(RESULT,LEN(a,0),LEN(a,1)) END; 18 | FOR i:=0 TO LEN(a,0)-1 DO 19 | RESULT[i]:=LinearMath.Max(a[i],b[i]) 20 | END; 21 | RETURN RESULT 22 | END Max; 23 | 24 | PROCEDURE Min*(CONST a,b:Array):Array; 25 | VAR i:SIZE; 26 | BEGIN 27 | ASSERT(LEN(a)=LEN(b)); 28 | IF LEN(RESULT,0)#LEN(a) THEN NEW(RESULT,LEN(a,0),LEN(a,1)) END; 29 | FOR i:=0 TO LEN(a,0)-1 DO 30 | RESULT[i]:=LinearMath.Min(a[i],b[i]) 31 | END; 32 | RETURN RESULT 33 | END Min; 34 | 35 | PROCEDURE Sqr*(CONST in:Array):Array; 36 | BEGIN 37 | RETURN in.*in 38 | END Sqr; 39 | 40 | PROCEDURE Sqrt*(CONST in:Array):Array; 41 | VAR i:SIGNED32; 42 | BEGIN 43 | IF LEN(RESULT)#LEN(in) THEN NEW(RESULT,LEN(in,0),LEN(in,1)) END; 44 | RESULT:=ALL(in, Mathe.sqrt); 45 | (*FOR i:=0 TO LEN(in,0)-1 DO 46 | RESULT[i]:=LinearMath.Sqrt(in[i]) 47 | END;*) 48 | RETURN RESULT 49 | END Sqrt; 50 | 51 | PROCEDURE Sin*(CONST in:Array):Array; 52 | VAR i:SIGNED32; 53 | BEGIN 54 | IF LEN(RESULT)#LEN(in) THEN NEW(RESULT,LEN(in,0),LEN(in,1)) END; 55 | RESULT:=ALL(in, Mathe.sin); 56 | (*FOR i:=0 TO LEN(in,0)-1 DO 57 | RESULT[i]:=LinearMath.Sin(in[i]) 58 | END;*) 59 | RETURN RESULT 60 | END Sin; 61 | 62 | PROCEDURE Cos*(CONST in:Array):Array; 63 | VAR i:SIGNED32; 64 | BEGIN 65 | IF LEN(RESULT)#LEN(in) THEN NEW(RESULT,LEN(in,0),LEN(in,1)) END; 66 | RESULT:=ALL(in, Mathe.cos); 67 | (*FOR i:=0 TO LEN(in,0)-1 DO 68 | RESULT[i]:=LinearMath.Cos(in[i]) 69 | END;*) 70 | RETURN RESULT 71 | END Cos; 72 | 73 | PROCEDURE Arctan*(CONST in:Array):Array; 74 | VAR i:SIGNED32; 75 | BEGIN 76 | IF LEN(RESULT)#LEN(in) THEN NEW(RESULT,LEN(in,0),LEN(in,1)) END; 77 | RESULT:=ALL(in, Mathe.arctan); 78 | (*FOR i:=0 TO LEN(in,0)-1 DO 79 | RESULT[i]:=LinearMath.Arctan(in[i]) 80 | END;*) 81 | RETURN RESULT 82 | END Arctan; 83 | 84 | PROCEDURE Tanh*(CONST in:Array):Array; 85 | BEGIN 86 | IF LEN(RESULT)#LEN(in) THEN NEW(RESULT,LEN(in)) END; 87 | RESULT:=ALL(in, PMath.tanhL); 88 | RETURN RESULT 89 | END Tanh; 90 | 91 | 92 | PROCEDURE Ln*(CONST in:Array):Array; 93 | VAR i:SIGNED32; 94 | BEGIN 95 | IF LEN(RESULT)#LEN(in) THEN NEW(RESULT,LEN(in,0),LEN(in,1)) END; 96 | RESULT:=ALL(in, Mathe.ln); 97 | (*FOR i:=0 TO LEN(in,0)-1 DO 98 | RESULT[i]:=LinearMath.Ln(in[i]) 99 | END;*) 100 | RETURN RESULT 101 | END Ln; 102 | 103 | PROCEDURE ComplexDivision*(CONST R1,I1,R2,I2: Array; VAR outR,outI:Array); 104 | VAR rsqr:Array; 105 | BEGIN 106 | rsqr:=R2.*R2; rsqr:= rsqr + I2 .*I2; 107 | outR := R1 .* R2; outR := outR + I1 .* I2; 108 | outI := I1 .* R2; outI := outI - R1 .* I2; 109 | outR:= outR ./ rsqr; 110 | outI:= outI ./ rsqr; 111 | END ComplexDivision; 112 | 113 | PROCEDURE ComplexMultiplication*(CONST R1,I1,R2,I2: Array; VAR outR,outI:Array); 114 | VAR rsqr:Array; 115 | BEGIN 116 | outR := R1 .* R2; 117 | outR := outR - I1 .* I2; 118 | outI := I1 .* R2; outI := outI + R1 .* I2; 119 | END ComplexMultiplication; 120 | 121 | PROCEDURE ComplexSqrt*( CONST R,I:Array; VAR outR,outI:Array); 122 | VAR i:SIZE; 123 | BEGIN 124 | FOR i:=0 TO LEN(R,0)-1 DO 125 | LinearMath.ComplexSqrt(R[i],I[i], outR[i],outI[i]); 126 | END; 127 | END ComplexSqrt; 128 | 129 | 130 | END PlanarMath. 131 | 132 | SystemTools.FreeDownTo PlanarMath 133 | -------------------------------------------------------------------------------- /Matrix/PlanarNorms.Mod: -------------------------------------------------------------------------------- 1 | MODULE PlanarNorms; (** AUTHOR "Patrick Hunziker"; PURPOSE "Norms in planar data"; *) 2 | (* see also MatrixNorms.Mod *) 3 | 4 | IMPORT PlanarBase, PlanarMath, PlanarNabla, PMath, MathL, Commands, KernelLog; 5 | 6 | TYPE 7 | Datatype=PlanarBase.Datatype; 8 | Complex=PlanarBase.Complex; 9 | 10 | Plane=PlanarBase.TwoD; 11 | ComplexPlane=ARRAY [*,*] OF Complex; 12 | 13 | PROCEDURE Power*(CONST p:Plane):Datatype; 14 | BEGIN 15 | RETURN p+*p 16 | END Power; 17 | 18 | PROCEDURE PowerComplex*(CONST p:ComplexPlane):Datatype; 19 | VAR tmp:Plane; 20 | BEGIN 21 | tmp:=ABS(p); 22 | RETURN tmp+*tmp 23 | END PowerComplex; 24 | 25 | PROCEDURE TotalVariation*(CONST p:Plane; sampling:SIGNED32): Datatype; (* to do: optimize *) 26 | BEGIN 27 | RETURN SUM(PlanarMath.Sqrt(PlanarMath.Sqr(PlanarNabla.dx(p,sampling)) 28 | + PlanarMath.Sqr(PlanarNabla.dy(p,sampling)))) 29 | END TotalVariation; 30 | 31 | 32 | (** SNR, PSNR, RMSE, MAE for images, see http://bigwww.epfl.ch/sage/soft/snr/ *) 33 | 34 | (** sinus to noise ratio for images = 10 log (...) *) 35 | PROCEDURE SNR*(CONST test, reference:Plane):Datatype; 36 | VAR dividend, divisor: Datatype; tmp: Plane; 37 | BEGIN 38 | (*dividend:=SUM(reference .* reference);*) 39 | dividend:=reference +* reference; 40 | (*divisor:=SUM(PlanarMath.Sqr( reference-test));*) 41 | tmp:=reference-test; 42 | divisor:= tmp+*tmp; 43 | RETURN 10*PMath.log (SHORT(dividend/divisor)) 44 | END SNR; 45 | 46 | PROCEDURE SNRComplex*(CONST test, reference:ComplexPlane):Datatype; (* see http://mathworld.wolfram.com/AveragePower.htm and http://bigwww.epfl.ch/sage/soft/snr/ *) 47 | VAR dividend, divisor: Datatype; tmp: Plane; tmpC: ComplexPlane; 48 | BEGIN 49 | tmp:=ABS(reference); 50 | dividend:=tmp+*tmp; 51 | tmpC:=reference-test; 52 | tmp:=ABS(tmpC); 53 | divisor:=tmp+*tmp; 54 | RETURN 10*PMath.log (SHORT(dividend/divisor)) 55 | END SNRComplex; 56 | 57 | 58 | (** peak sinus to noise ratio for images = 10 log (...) *) 59 | PROCEDURE PSNR*(CONST test, reference:Plane):Datatype; 60 | VAR dividend, divisor: Datatype; 61 | BEGIN 62 | dividend:=MAX(reference .* reference); 63 | divisor:=SUM(PlanarMath.Sqr( reference-test)); 64 | RETURN 10*PMath.log (SHORT(dividend*LEN(test,0)*LEN(test,1)/divisor)) 65 | END PSNR; 66 | 67 | (** root mean square error*) 68 | PROCEDURE RMSE*(CONST test, reference:Plane):Datatype; 69 | BEGIN 70 | RETURN MathL.sqrt(SUM(PlanarMath.Sqr( reference-test))/(LEN(test,0)*LEN(test,1))) 71 | END RMSE; 72 | 73 | (** mean absolute error *) 74 | PROCEDURE MAE*(CONST test, reference:Plane):Datatype; 75 | BEGIN 76 | RETURN SUM(ABS( reference-test))/(LEN(test,0)*LEN(test,1)) 77 | END MAE; 78 | 79 | PROCEDURE Test*(context:Commands.Context); 80 | VAR a,b: Plane; c:ComplexPlane; 81 | BEGIN 82 | NEW(a,10,10); a[4,4]:=10; 83 | NEW(b,10,10);b[4,4]:=10.5; 84 | context.out.Float(SNR(a,b),14); 85 | context.out.Float(PSNR(a,b),14); 86 | context.out.Float(RMSE(a,b),14); 87 | context.out.Float(MAE(a,b),14); 88 | context.out.Float(TotalVariation(a, PlanarNabla.centered),14); 89 | context.out.Ln; context.out.Update; 90 | END Test; 91 | 92 | END PlanarNorms. 93 | 94 | PlanarNorms.Test ~ 95 | SystemTools.FreeDownTo PlanarNorms ~ 96 | 97 | -------------------------------------------------------------------------------- /Matrix/PlanarPDE_ConstrainedLaplace.MtA: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Matrix/PlanarPDE_ConstrainedLaplace.MtA -------------------------------------------------------------------------------- /Matrix/SchistosomaPDE.Mod: -------------------------------------------------------------------------------- 1 | MODULE SchistosomaPDE; (** AUTHOR ""; PURPOSE ""; *) 2 | 3 | IMPORT PlanarPDE, WMMatrix, Stat:=StatisticsBase, Util:=MatrixUtilities; 4 | 5 | CONST Size=256; 6 | 7 | TYPE 8 | Grid = PlanarPDE.Grid; 9 | 10 | PROCEDURE TestConstrainedLaplace*; 11 | CONST threshold = 1; 12 | VAR 13 | con:PlanarPDE.Constraint; 14 | laplace: PlanarPDE.Laplace; 15 | BEGIN 16 | NEW(con); con.Set(c,b); 17 | NEW( laplace ); laplace.SolveMultigrid(map , threshold, 64, 1000, 10000, con.Constrain ); 18 | Util.Mirror(map,0); 19 | WMMatrix.AddWindow(map,"map"); 20 | END TestConstrainedLaplace; 21 | 22 | PROCEDURE TestConstrainedDiffusion*; 23 | VAR p: Grid; i: SIGNED32; 24 | P:WMMatrix.Window; 25 | diffusion: PlanarPDE.Diffusion; 26 | con:PlanarPDE.Constraint; 27 | 28 | BEGIN 29 | NEW( p, Size, Size ); 30 | NEW( diffusion ); 31 | NEW( P, p, "p" ); P.AddWindow; 32 | 33 | NEW(con); con.Set(c,b); 34 | FOR i := 0 TO 10000 DO 35 | diffusion.SolveMultigrid( map, p, 10, 1, 1, 0.1,16, 100, con.Constrain ); 36 | P.SetImage( p); 37 | map:=p; p:=0; 38 | END; 39 | END TestConstrainedDiffusion; 40 | 41 | VAR data, map, c: Grid; b: PlanarPDE.BooleanMap; x,y,i:SIGNED32; 42 | BEGIN 43 | (*lat, long, prevalence, elevation:*) 44 | data :=[ [1.567166677, 1.571662648, 1.536716668, 1.431950001, 1.419500001, 1.475500001, 1.409933334, 1.443366668, 1.315866667, 1.351633334, 1.377216667, 1.354500001, 1.433033334, 1.488450001, 1.396966667, 1.710716668, 1.768133335, 1.761216668, 3.367933334, 3.274416667, 3.276183334, 3.391666667, 3.540416668, 3.570833334, 2.106866667, 2.026033333, 2.02125, 2.177316667, 2.156683334, 2.11195, 1.9575, 1.957778, 1.973611, 1.989444, 2.026667, 2.176111, 2.129167, 2.13, 1.315855556, 1.314832323, 1.339933334, 1.309436754, 1.307547833, 1.386538313, 1.403345452, 1.363333404, 1.355336374, 1.5319, 1.5663889, 1.4025, 2.0422222, 1.942631, 1.5755556, 1.5563889, 1.5588889, 1.3966667, 1.4061111, 1.3533333, 1.3547222, 1.3511111], 45 | [30.26445343, 30.24121233, 30.25223333, 30.04445, 30.02263333, 30.01616667, 29.81956667, 29.7815, 29.74196667, 29.49541667, 29.44081667, 29.09091667, 30.48371667, 30.49715, 30.44486667, 30.14366667, 30.25488333, 30.2545, 30.45208333, 30.57285, 30.64221667, 30.71346667, 30.6523, 30.76171667, 30.76985, 30.89655, 30.91696667, 30.92841667, 30.95811667, 30.96561667, 31.00278, 30.99417, 31.00556, 31.02194, 31.04889, 31.2725, 31.22417, 31.23556, 29.74, 29.79, 29.80556667, 29.7134624, 29.70836592, 29.66674635, 29.68123954, 29.63491555, 29.54149667, 30.258272, 30.278889, 30.4425, 31.049167, 30.970162, 30.245, 30.25222, 30.250556, 27.601944, 27.6, 29.083611, 29.095556, 29.075278], 46 | [12.0, 41.7, 42.7, 52.3, 47.7, 45.1, 35.1, 59.7, 52.3, 41.2, 44.7, 67.2, 68.9, 78.4, 74.5, 11.5, 6.5, 9.8, 6.4, 10.2, 0.0, 2.0, 10.5, 0.0, 0.0, 24.0, 4.4, 4.0, 12.8, 6.4, 75.6, 68.8, 72.7, 64.3, 66.7, 90.2, 72.1, 78.6, 52.3, 58.1, 46.2, 44.8, 61.5, 38.9, 54.2, 66.7, 48.3, 46.1, 47.9, 68.8, 60.0, 85.7, 65.1, 63.0, 42.1, 24.1, 51.0, 94.2, 87.5, 78.6], 47 | [1350, 1250, 1290, 1070, 1090, 1030, 930, 880, 890, 855, 915, 900, 625, 625, 615, 1355, 1320, 1320, 1105, 1170, 1165, 1170, 1190, 1195, 1920, 2080, 2090, 1805, 1870, 1905, 610, 690, 840, 930, 945, 605, 625, 610, 890, 880, 885, 880, 880, 875, 870, 860, 860, 1300, 1350, 640, 950, 615, 1250, 1270, 1260, 560, 550, 900, 910, 890]]; 48 | 49 | data[0,..]:=data[0,..]-MIN(data[0,..]); 50 | data[0,..]:=data[0,..]/MAX(data[0,..]); 51 | 52 | data[1,..]:=data[1,..]-MIN(data[1,..]); 53 | data[1,..]:=data[1,..]/MAX(data[1,..]); 54 | 55 | NEW(map, Size, Size); map:=Stat.Mean(data[2,..]); (*initialize with eduated guess of solution*) 56 | NEW(b, Size, Size); 57 | NEW(c, Size, Size); 58 | (*c:=Stat.Mean(data[2,..]);*) 59 | FOR i:=0 TO LEN(data,1)-1 DO 60 | y:=ENTIER(16+(Size-32) * data[0,i]); 61 | x:=ENTIER(16+(Size-32) * data[1,i]); 62 | c[y..y+2,x..x+2]:=data[2,i]; 63 | b[y..y+2,x..x+2]:=TRUE; 64 | END; 65 | 66 | END SchistosomaPDE. 67 | 68 | SchistosomaPDE.TestConstrainedLaplace ~ 69 | SchistosomaPDE.TestConstrainedDiffusion ~ -------------------------------------------------------------------------------- /Matrix/StatisticsCombinatorics.Mod: -------------------------------------------------------------------------------- 1 | MODULE StatisticsCombinatorics; (** AUTHOR "Patrick Hunziker 2017"; PURPOSE "Library of tools for combinatorics"; *) 2 | 3 | IMPORT Random (*, Commands, MatrixUtilities*); 4 | 5 | (*Fisher Yates Algorithm: Random Permutation*) 6 | PROCEDURE Permutation*(N:SIGNED32): ARRAY[*] OF SIGNED32; 7 | VAR i, n:SIGNED32; series: ARRAY [*] OF SIGNED32; 8 | BEGIN 9 | IF LEN(RESULT,0)#N THEN NEW(RESULT,N) END; 10 | IF LEN(series,0)#N THEN NEW(series,N) END; 11 | FOR i:=0 TO N-1 DO series[i]:=i END; 12 | FOR i:=N-1 TO 1 BY -1 DO 13 | n:=sequence.Dice(i+1); 14 | RESULT[i]:=series[n]; 15 | series[n]:=series[i]; 16 | END; 17 | RESULT[0]:=series[0]; 18 | RETURN RESULT 19 | END Permutation; 20 | 21 | (*in-place random permutation*) 22 | PROCEDURE Permute*(VAR A: ARRAY[*] OF SIGNED32); 23 | VAR i: SIZE; j, n:SIGNED32; 24 | BEGIN 25 | FOR i:=LEN(A,0)-1 TO 1 BY -1 DO 26 | n:=sequence.Dice((i+1)(SIGNED32)); 27 | j:=A[i]; 28 | A[i]:=A[n]; 29 | A[n]:=j; 30 | END; 31 | END Permute; 32 | 33 | VAR sequence: Random.Sequence; 34 | (* 35 | PROCEDURE Test*(context:Commands.Context); 36 | VAR n:SIGNED32; p:ARRAY [*] OF SIGNED32; 37 | BEGIN 38 | IF context.arg.GetInteger(n,FALSE) THEN 39 | p:=Permutation(n); 40 | MatrixUtilities.Out(p); 41 | Permute(p); 42 | MatrixUtilities.Out(p); 43 | END; 44 | END Test;*) 45 | 46 | BEGIN 47 | NEW(sequence); 48 | END StatisticsCombinatorics. 49 | 50 | 51 | -------------------------------------------------------------------------------- /Matrix/StatisticsHistograms.Mod: -------------------------------------------------------------------------------- 1 | MODULE StatisticsHistograms; (** AUTHOR "Patrick Hunziker"; PURPOSE "Histograms"; *) 2 | 3 | IMPORT KernelLog, MatrixBase,MatrixUtilities; 4 | 5 | TYPE 6 | Volume= ARRAY [*,*,*] OF MatrixBase.Datatype; 7 | Data= ARRAY [?] OF MatrixBase.Datatype; 8 | 9 | PROCEDURE LinearHistogram*(CONST data: MatrixBase.Vector; bins: SIZE; VAR histogram: MatrixBase.Vector); 10 | VAR max,min:FLOAT64; i,index :SIZE; 11 | BEGIN 12 | max:=MAX(data); min:=MIN(data); 13 | IF LEN(histogram)=0 THEN NEW(histogram,bins) ELSE histogram:=0 END; 14 | FOR i:=0 TO LEN(data,0)-1 DO 15 | index:=ENTIER((data[i]-min)*(bins-1) / (max-min)); 16 | histogram[index ]:=histogram[index]+1; 17 | END; 18 | END LinearHistogram; 19 | 20 | PROCEDURE PlanarHistogram*(CONST data: MatrixBase.Matrix; bins: SIZE; VAR histogram: MatrixBase.Vector); 21 | VAR max,min:FLOAT64; i,j,index :SIZE; 22 | BEGIN 23 | max:=MAX(data); min:=MIN(data); 24 | IF LEN(histogram)=0 THEN NEW(histogram,bins) ELSE histogram:=0 END; 25 | FOR j:=0 TO LEN(data,0)-1 DO 26 | FOR i:=0 TO LEN(data,1)-1 DO 27 | index:=ENTIER((data[j,i]-min)*(bins-1) / (max-min)); 28 | histogram[index ]:=histogram[index]+1; 29 | END; 30 | END; 31 | END PlanarHistogram; 32 | 33 | PROCEDURE VolumeHistogram*(CONST data: Volume; bins: SIZE; VAR histogram: MatrixBase.Vector); 34 | VAR max,min:FLOAT64; i,j,k,index :SIZE; 35 | BEGIN 36 | max:=MAX(data); min:=MIN(data); 37 | IF LEN(histogram)=0 THEN NEW(histogram,bins) ELSE histogram:=0 END; 38 | FOR k:=0 TO LEN(data,0)-1 DO 39 | FOR j:=0 TO LEN(data,0)-1 DO 40 | FOR i:=0 TO LEN(data,1)-1 DO 41 | index:=ENTIER((data[k,j,i]-min)*(bins-1) / (max-min)); 42 | histogram[index ]:=histogram[index]+1; 43 | END; 44 | END; 45 | END; 46 | END VolumeHistogram; 47 | 48 | PROCEDURE TensorHistogram*; 49 | END TensorHistogram; 50 | 51 | 52 | PROCEDURE Histogram*(CONST data: Data ; bins: SIZE; VAR histogram: MatrixBase.Vector); 53 | (*VAR max,min:FLOAT64; index :SIZE; 54 | BEGIN 55 | max:=MAX(data); min:=MIN(data); 56 | IF LEN(histogram)=0 THEN NEW(histogram,bins) END; 57 | *) 58 | END Histogram; 59 | 60 | 61 | PROCEDURE Test*; 62 | VAR histogram,h2:MatrixBase.Vector; 63 | BEGIN 64 | LinearHistogram([0,1,2,3,4,4,5,5,5,6,7,8,9],10,histogram); 65 | MatrixUtilities.OutVector(histogram); 66 | PlanarHistogram([[1,2,3,4],[2,3,4,5],[2,4,6,8],[1,3,4,5]],10,h2); 67 | MatrixUtilities.OutVector(h2); 68 | END Test; 69 | 70 | 71 | END StatisticsHistograms. 72 | 73 | StatisticsHistograms.Test 74 | SystemTools.Free Histograms~ 75 | -------------------------------------------------------------------------------- /Matrix/StatisticsRandom.Mod: -------------------------------------------------------------------------------- 1 | MODULE StatisticsRandom; (** AUTHOR "Patrick Hunziker"; PURPOSE ""; *) 2 | 3 | IMPORT StatisticsBase, Random, Mathe:=MathL, Reals; 4 | 5 | TYPE Datatype=StatisticsBase.Datatype; 6 | 7 | (* random number with gaussian distribution with mean=zero, variance*) 8 | PROCEDURE Gaussian*(variance:Datatype):Datatype; 9 | VAR res:Datatype; 10 | BEGIN 11 | res:=Mathe.sqrt(-2*variance * Mathe.ln(1-rand.Uniform())); 12 | IF ~Reals.IsNaNL(res) THEN RETURN res 13 | ELSE RETURN 0 14 | END; 15 | END Gaussian; 16 | 17 | VAR 18 | rand:Random.Generator; 19 | BEGIN 20 | NEW(rand); 21 | END StatisticsRandom. 22 | 23 | -------------------------------------------------------------------------------- /Matrix/TensorMath.Mod: -------------------------------------------------------------------------------- 1 | MODULE TensorMath; 2 | 3 | (*To do: complex derivatives including complex optimization algorithms: see 4 | Kenneth Kreutz-Delgado : The Complex Gradient Operator and the CR-Calculus. 5 | ECE275A - Lecture Supplement - Fall 2006: "complex_derivatives.pdf *) 6 | 7 | IMPORT MatrixBase, LinearMath, Mathe:=MathL, PMath; 8 | 9 | TYPE 10 | Datatype=MatrixBase.Datatype; 11 | Array = ARRAY [?] OF Datatype; 12 | 13 | PROCEDURE Max*(CONST a,b:Array):Array; 14 | VAR i:SIZE; 15 | BEGIN 16 | ASSERT(LEN(a)=LEN(b)); 17 | IF LEN(RESULT,0)#LEN(a) THEN NEW(RESULT,LEN(a,0),LEN(a,1)) END; 18 | IF DIM(a)=1 THEN 19 | RESULT[..]:=LinearMath.Max(a[..],b[..]) 20 | ELSE 21 | FOR i:=0 TO LEN(a,0)-1 DO 22 | RESULT[i,?]:=LinearMath.Max(a[i,?],b[i,?]) 23 | END; 24 | END; 25 | RETURN RESULT 26 | END Max; 27 | 28 | PROCEDURE Min*(CONST a,b:Array):Array; 29 | VAR i:SIZE; 30 | BEGIN 31 | ASSERT(LEN(a)=LEN(b)); 32 | IF LEN(RESULT,0)#LEN(a) THEN NEW(RESULT,LEN(a,0),LEN(a,1)) END; 33 | IF DIM(a)=1 THEN 34 | RESULT[..]:=LinearMath.Max(a[..],b[..]) 35 | ELSE 36 | FOR i:=0 TO LEN(a,0)-1 DO 37 | RESULT[i,?]:=LinearMath.Min(a[i,?],b[i,?]) 38 | END; 39 | END; 40 | RETURN RESULT 41 | END Min; 42 | 43 | PROCEDURE Sqr*(CONST in:Array):Array; 44 | BEGIN 45 | RETURN in.*in 46 | END Sqr; 47 | 48 | PROCEDURE Sqrt*(CONST in:Array):Array; 49 | BEGIN 50 | IF LEN(RESULT)#LEN(in) THEN NEW(RESULT,LEN(in)) END; 51 | RESULT:=ALL(in, Mathe.sqrt); 52 | RETURN RESULT 53 | END Sqrt; 54 | 55 | PROCEDURE Sin*(CONST in:Array):Array; 56 | BEGIN 57 | IF LEN(RESULT)#LEN(in) THEN NEW(RESULT,LEN(in)) END; 58 | RESULT:=ALL(in, Mathe.sin); 59 | RETURN RESULT 60 | END Sin; 61 | 62 | PROCEDURE Cos*(CONST in:Array):Array; 63 | BEGIN 64 | IF LEN(RESULT)#LEN(in) THEN NEW(RESULT,LEN(in)) END; 65 | RESULT:=ALL(in, Mathe.cos); 66 | RETURN RESULT 67 | END Cos; 68 | 69 | PROCEDURE Arctan*(CONST in:Array):Array; 70 | BEGIN 71 | IF LEN(RESULT)#LEN(in) THEN NEW(RESULT,LEN(in)) END; 72 | RESULT:=ALL(in, Mathe.arctan); 73 | RETURN RESULT 74 | END Arctan; 75 | 76 | PROCEDURE Tanh*(CONST in:Array):Array; 77 | BEGIN 78 | IF LEN(RESULT)#LEN(in) THEN NEW(RESULT,LEN(in)) END; 79 | RESULT:=ALL(in, PMath.tanhL); 80 | RETURN RESULT 81 | END Tanh; 82 | 83 | PROCEDURE Logistic*(CONST in:Array):Array; 84 | BEGIN 85 | IF LEN(RESULT)#LEN(in) THEN NEW(RESULT,LEN(in)) END; 86 | RESULT:=ALL(in, PMath.logisticL); 87 | RETURN RESULT 88 | END Logistic; 89 | 90 | PROCEDURE Ln*(CONST in:Array):Array; 91 | BEGIN 92 | IF LEN(RESULT)#LEN(in) THEN NEW(RESULT,LEN(in)) END; 93 | RESULT:=ALL(in, Mathe.ln); 94 | RETURN RESULT 95 | END Ln; 96 | 97 | PROCEDURE ComplexDivision*(CONST R1,I1,R2,I2: Array; VAR outR,outI:Array); 98 | VAR rsqr:Array; 99 | BEGIN 100 | rsqr:=R2.*R2; rsqr:= rsqr + I2 .*I2; 101 | outR := R1 .* R2; outR := outR + I1 .* I2; 102 | outI := I1 .* R2; outI := outI - R1 .* I2; 103 | outR:= outR ./ rsqr; 104 | outI:= outI ./ rsqr; 105 | END ComplexDivision; 106 | 107 | PROCEDURE ComplexMultiplication*(CONST R1,I1,R2,I2: Array; VAR outR,outI:Array); 108 | VAR rsqr:Array; 109 | BEGIN 110 | outR := R1 .* R2; 111 | outR := outR - I1 .* I2; 112 | outI := I1 .* R2; outI := outI + R1 .* I2; 113 | END ComplexMultiplication; 114 | 115 | PROCEDURE ComplexSqrt*( CONST R,I:Array; VAR outR,outI:Array); 116 | VAR i:SIZE; 117 | BEGIN 118 | IF DIM(R)=1 THEN 119 | LinearMath.ComplexSqrt(R,I, outR[..], outI[..]); 120 | ELSE 121 | FOR i:=0 TO LEN(R,0)-1 DO 122 | ComplexSqrt(R[i,?],I[i,?], outR[i,?],outI[i,?]); 123 | END; 124 | END; 125 | END ComplexSqrt; 126 | 127 | 128 | END TensorMath. 129 | 130 | SystemTools.FreeDownTo TensorMath 131 | -------------------------------------------------------------------------------- /Matrix/TestComplexMathL.Mod: -------------------------------------------------------------------------------- 1 | MODULE TestComplexMathL; (** AUTHOR ""; PURPOSE ""; *) 2 | 3 | IMPORT CMath:=ComplexMathL, Log:=KernelLog; 4 | 5 | PROCEDURE Demo*; 6 | CONST size= 16; 7 | VAR a,b,c: CMath.COMPLEXTYPE; x:FLOAT32; y,z:CMath.Datatype; i:SIGNED16; j:SIGNED32; 8 | A,B,C: CMath.COMPLEXARRAY; P: CMath.POLARARRAY; R,I,Y: CMath.FLOATARRAY; 9 | BEGIN 10 | c:=CMath.Complex(1.3,0.9); 11 | b:=CMath.Complex(2.5,2.2); 12 | x:=3.3; 13 | y:=3.3; 14 | j:= 7; 15 | CMath.Out(c,12,6,0); CMath.Out(b,12,6,0); CMath.Out(b,12,6,0); 16 | a:=b*c; Log.String("b*c"); CMath.Out(a,12,6,0); 17 | a:=b+c; Log.String("b+c"); CMath.Out(a,12,6,0); 18 | a:=b-c; Log.String("b-c"); CMath.Out(a,12,6,0); 19 | a:=b+j; Log.String("b+j"); CMath.Out(a,12,6,0); 20 | a:=j+b; Log.String("j+b"); CMath.Out(a,12,6,0); 21 | a:=b*x; Log.String("b*x"); CMath.Out(a,12,6,0); 22 | a:=b*y; Log.String("b*y"); CMath.Out(a,12,6,0); 23 | a:=j*b; Log.String("j*b"); CMath.Out(a,12,6,0); 24 | a:=b*j; Log.String("b*j"); CMath.Out(a,12,6,0); 25 | a:=b/c; Log.String("b/c"); CMath.Out(a,12,6,0); 26 | a:=b/x; Log.String("b/x"); CMath.Out(a,12,6,0); 27 | a:=b/y; Log.String("b/y"); CMath.Out(a,12,6,0); 28 | a:=b/j; Log.String("b/j"); CMath.Out(a,12,6,0); 29 | a:=j/b; Log.String("j/b"); CMath.Out(a,12,6,0); 30 | a:=y/b; Log.String("y/b"); CMath.Out(a,12,6,0); 31 | a:=x/b; Log.String("x/b"); CMath.Out(a,12,6,0); 32 | a:=CMath.sqrt( b); Log.String("sqrt(b)"); CMath.Out(a,12,6,0); 33 | a:=b; Log.String("a:=b"); CMath.Out(a,12,6,0); 34 | a:=x; Log.String("a:=x"); CMath.Out(a,12,6,0); 35 | a:=y; Log.String("a:=y"); CMath.Out(a,12,6,0); 36 | a:=j; Log.String("a:=j"); CMath.Out(a,12,6,0); 37 | IF a=b THEN END; 38 | IF a#b THEN END; 39 | NEW(A,size); NEW(B,size); NEW(C,size); NEW(P,size); NEW(R,size); NEW(I,size); 40 | CMath.SetComplexArray(A,[0,1,2,3,4,5,6,7,8,7,6,5,4,3,2,1],[4,3,2,2,4,5,6,7,8,7,6,5,4,3,4,4]); 41 | 42 | B:=A+1; 43 | 44 | (* 45 | CMath.GetComplexArray(A, R,I); 46 | CMath.Out(A, 2,10, 0); Log.Ln; 47 | CMath.Out(B, 2, 10, 0); 48 | 49 | Util.CMath.OutVector(R); 50 | Util.CMath.OutVector(I); 51 | *) 52 | 53 | c:=CMath.Complex(1.5,1.5); 54 | CMath.Out(c,12,6,0); 55 | 56 | A:=B; 57 | A:=P; 58 | P:=A; 59 | 60 | A:=B+C; 61 | A:=B-C; 62 | A:=B.*C; 63 | A:=B./C; 64 | 65 | A:= B*y; 66 | A:= y*C; 67 | A:= B/y; 68 | A:= y/C; 69 | 70 | END Demo; 71 | 72 | END TestComplexMathL. 73 | 74 | TestComplexMathL.Demo 75 | 76 | SystemTools.Free TestComplexMathL ComplexMathL MatrixUtilities~ 77 | -------------------------------------------------------------------------------- /Matrix/TestLinearCrossCorrelation.Mod: -------------------------------------------------------------------------------- 1 | MODULE TestLinearCrossCorrelation; (** AUTHOR "Patrick Hunziker"; PURPOSE ""; *) 2 | 3 | IMPORT LinearFFT, LinearWindowFunction, MathL, WMSimpleGraphs, Random; 4 | 5 | TYPE Datatype=FLOAT64; 6 | 7 | PROCEDURE Do*; 8 | VAR d:ARRAY [*,*] OF Datatype; 9 | w: ARRAY [*] OF Datatype; 10 | i:SIGNED32; 11 | graphs:WMSimpleGraphs.Graphs; r:Datatype; 12 | BEGIN 13 | NEW(d,7, 256); 14 | FOR i:=0 TO LEN(d,1)-1 DO 15 | r:=rand.Uniform(); 16 | d[0,i]:= MathL.sin(i/50-0.3)+r; 17 | d[1,(i-5) MOD LEN(d,1)]:= MathL.sin(i/50 -0.3)+r; 18 | END; 19 | NEW(w, LEN(d,1)); 20 | w:=LinearWindowFunction.SplineWindow(d[0,*],3 ); 21 | d[4,*]:=w; 22 | d[5,*]:=d[0,*]; 23 | d[6,*]:=d[1,*]; 24 | d[0,*]:=d[0,*] .* w; 25 | d[1,*]:=d[1,*] .* w; 26 | 27 | LinearFFT.CrossCorrelation(d[0,*], d[1,*], d[2,*], d[3,*]); 28 | d[2..3]:=5*d[2..3]/LEN(d,1); (* scaling is abitrary, for nicer display *) 29 | NEW(graphs, d, ""); 30 | END Do; 31 | VAR rand:Random.Generator; 32 | BEGIN 33 | NEW(rand); 34 | END TestLinearCrossCorrelation. 35 | 36 | TestLinearCrossCorrelation.Do ~ 37 | System.Free TestLinearCrossCorrelation 38 | System.FreeDownTo WMSimpleGraphs ~ 39 | -------------------------------------------------------------------------------- /Matrix/TestMatrixOpticalFlow.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Matrix/TestMatrixOpticalFlow.Mod -------------------------------------------------------------------------------- /Matrix/TestPlanarPDESchistosoma.Mod: -------------------------------------------------------------------------------- 1 | MODULE SchistosomaPDE; (** AUTHOR ""; PURPOSE ""; *) 2 | 3 | IMPORT PlanarPDE, WMMatrix; 4 | 5 | TYPE 6 | Datatype = PlanarPDE.Datatype; 7 | Grid = PlanarPDE.Grid; 8 | 9 | PROCEDURE TestConstrainedLaplace*; 10 | CONST size = 200; threshold = 1; 11 | VAR 12 | con:PlanarPDE.Constraint; 13 | laplace: PlanarPDE.Laplace; 14 | BEGIN 15 | NEW(con); con.Set(c,b); 16 | NEW( laplace ); laplace.SolveMultigrid(map , threshold, 64, 2000, 20000, con.Constrain ); 17 | WMMatrix.AddWindow(map,"map"); 18 | END TestConstrainedLaplace; 19 | 20 | VAR data, map, c: Grid; b: PlanarPDE.BooleanMap; x,y,i:SIGNED32; 21 | BEGIN 22 | data :=[ [1.567166677, 1.571662648, 1.536716668, 1.431950001, 1.419500001, 1.475500001, 1.409933334, 1.443366668, 1.315866667, 1.351633334, 1.377216667, 1.354500001, 1.433033334, 1.488450001, 1.396966667, 1.710716668, 1.768133335, 1.761216668, 3.367933334, 3.274416667, 3.276183334, 3.391666667, 3.540416668, 3.570833334, 2.106866667, 2.026033333, 2.02125, 2.177316667, 2.156683334, 2.11195, 1.9575, 1.957778, 1.973611, 1.989444, 2.026667, 2.176111, 2.129167, 2.13, 1.315855556, 1.314832323, 1.339933334, 1.309436754, 1.307547833, 1.386538313, 1.403345452, 1.363333404, 1.355336374, 1.5319, 1.5663889, 1.4025, 2.0422222, 1.942631, 1.5755556, 1.5563889, 1.5588889, 1.3966667, 1.4061111, 1.3533333, 1.3547222, 1.3511111], 23 | [30.26445343, 30.24121233, 30.25223333, 30.04445, 30.02263333, 30.01616667, 29.81956667, 29.7815, 29.74196667, 29.49541667, 29.44081667, 29.09091667, 30.48371667, 30.49715, 30.44486667, 30.14366667, 30.25488333, 30.2545, 30.45208333, 30.57285, 30.64221667, 30.71346667, 30.6523, 30.76171667, 30.76985, 30.89655, 30.91696667, 30.92841667, 30.95811667, 30.96561667, 31.00278, 30.99417, 31.00556, 31.02194, 31.04889, 31.2725, 31.22417, 31.23556, 29.74, 29.79, 29.80556667, 29.7134624, 29.70836592, 29.66674635, 29.68123954, 29.63491555, 29.54149667, 30.258272, 30.278889, 30.4425, 31.049167, 30.970162, 30.245, 30.25222, 30.250556, 27.601944, 27.6, 29.083611, 29.095556, 29.075278], 24 | [12.0, 41.7, 42.7, 52.3, 47.7, 45.1, 35.1, 59.7, 52.3, 41.2, 44.7, 67.2, 68.9, 78.4, 74.5, 11.5, 6.5, 9.8, 6.4, 10.2, 0.0, 2.0, 10.5, 0.0, 0.0, 24.0, 4.4, 4.0, 12.8, 6.4, 75.6, 68.8, 72.7, 64.3, 66.7, 90.2, 72.1, 78.6, 52.3, 58.1, 46.2, 44.8, 61.5, 38.9, 54.2, 66.7, 48.3, 46.1, 47.9, 68.8, 60.0, 85.7, 65.1, 63.0, 42.1, 24.1, 51.0, 94.2, 87.5, 78.6]]; 25 | 26 | data[0,..]:=data[0,..]-MIN(data[0,..]); 27 | data[0,..]:=data[0,..]/MAX(data[0,..]); 28 | 29 | data[1,..]:=data[1,..]-MIN(data[1,..]); 30 | data[1,..]:=data[1,..]/MAX(data[1,..]); 31 | 32 | NEW(map, 256, 256); 33 | NEW(b, 256, 256); 34 | NEW(c, 256, 256); 35 | 36 | FOR i:=0 TO LEN(data,1)-1 DO 37 | x:=ENTIER(255 * data[0,i]); 38 | y:=ENTIER(255 * data[1,i]); 39 | c[x,y]:=data[2,i]; 40 | b[x,y]:=TRUE; 41 | END; 42 | 43 | END SchistosomaPDE. 44 | 45 | SchistosomaPDE.TestConstrainedLaplace ~ 46 | -------------------------------------------------------------------------------- /Matrix/TestYUV.Mod: -------------------------------------------------------------------------------- 1 | MODULE TestYUV; (** AUTHOR ""; PURPOSE ""; *) 2 | 3 | IMPORT WMGraphics, RF:=RasterPixelFormats, MatrixRaster, WMArrayPanel, WMStandardComponents, Raster, Strings, WMWindowManager, WMComponents; 4 | 5 | PROCEDURE {TEST}Do*; 6 | VAR rgb, yuv422: WMGraphics.Image; mode:Raster.Mode; img: WMStandardComponents.Image;win:WMComponents.FormWindow; 7 | BEGIN 8 | rgb:=WMGraphics.LoadImage("Yellow_Duck.jpg",FALSE); 9 | NEW(img); img.SetImage(NIL,rgb); 10 | NEW(win, rgb.width, rgb.height, FALSE); 11 | win.SetTitle(Strings.NewString("Yellow_Duck.jpg in BGRA format")); 12 | win.SetContent(img); 13 | WMWindowManager.DefaultAddWindow(win); 14 | 15 | NEW(yuv422); 16 | Raster.Create(yuv422, rgb.width, rgb.height, RF.YUV422); 17 | 18 | Raster.InitMode(mode, WMGraphics.ModeSrcOverDst); 19 | Raster.Copy(rgb,yuv422, 0,0,rgb.width, rgb.height,0,0, mode); (*implicit format change from source to destination, using Raster.Mod intrinsic functionality*) 20 | 21 | NEW(img); img.SetImage(NIL,yuv422); 22 | NEW(win, yuv422.width, yuv422.height, FALSE); 23 | win.SetTitle(Strings.NewString("yellow duck in YUV422 format")); 24 | win.SetContent(img); 25 | WMWindowManager.DefaultAddWindow(win); 26 | 27 | WMArrayPanel.AddWindow(MatrixRaster.ImagePlaneToArray(yuv422,0),"Y"); 28 | WMArrayPanel.AddWindow(MatrixRaster.ImagePlaneToArray(yuv422,1),"U"); 29 | WMArrayPanel.AddWindow(MatrixRaster.ImagePlaneToArray(yuv422,2),"V"); 30 | END Do; 31 | 32 | 33 | END TestYUV. 34 | 35 | Yellow_Duck.jpg 36 | -------------------------------------------------------------------------------- /Matrix/Thermal.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Matrix/Thermal.lut -------------------------------------------------------------------------------- /Matrix/VolumeMoments.Mod: -------------------------------------------------------------------------------- 1 | MODULE VolumeMoments; (** AUTHOR "Patrick Hunziker"; PURPOSE ""; , all rights, 2008 **) 2 | 3 | IMPORT MatrixBase, Filters := LinearFilters, Transform := VolumeTransform; 4 | 5 | CONST 6 | dirZ = 0; dirY = 1; dirX = 2; skip = -1; 7 | 8 | TYPE 9 | Datatype = MatrixBase.Datatype; Cube = ARRAY [ * , * , * ] OF Datatype; 10 | 11 | (** 12 | Precondition: 13 | Postcondition: 14 | *) 15 | PROCEDURE Moment*( CONST from: Cube; degreeX, degreeY, degreeZ: SIGNED32 ): Cube; 16 | VAR MomentFilter0, MomentFilter1, MomentFilter2, filter: Filters.Filter; 17 | BEGIN 18 | ASSERT( LEN( from, 0 ) > 0 ); 19 | IF (LEN( RESULT, 0 ) # LEN( from, 0 )) OR (LEN( RESULT, 1 ) # LEN( from, 1 )) OR (LEN( RESULT, 2 ) # LEN( from, 2 )) THEN 20 | NEW( RESULT, LEN( from, 0 ), LEN( from, 1 ), LEN( from, 2 ) ) 21 | END; 22 | IF (degreeX = degreeY) & (degreeY = degreeZ) THEN 23 | IF degreeX = skip THEN RETURN RESULT 24 | ELSE filter := Filters.CreateSplineFilter( Filters.MomentCubic0 + degreeX ); Transform.Filter3D( from, RESULT, filter, {0, 1, 2}, Transform.mirrorW ); RETURN RESULT 25 | END; 26 | END; 27 | MomentFilter0 := Filters.CreateSplineFilter( Filters.MomentCubic0 ); MomentFilter1 := Filters.CreateSplineFilter( Filters.MomentCubic1 ); 28 | MomentFilter2 := Filters.CreateSplineFilter( Filters.MomentCubic2 ); 29 | IF degreeX = 0 THEN Transform.Filter3D( from, RESULT, MomentFilter0, {dirX}, Transform.mirrorW ) 30 | ELSIF degreeX = 1 THEN Transform.Filter3D( from, RESULT, MomentFilter1, {dirX}, Transform.antimirrorW ) 31 | ELSIF degreeX = 2 THEN Transform.Filter3D( from, RESULT, MomentFilter2, {dirX}, Transform.mirrorW ) 32 | ELSIF degreeX = skip THEN 33 | RESULT := from; (*copy unchanged to result cube*) 34 | END; 35 | IF degreeY = 0 THEN Transform.Filter3D( RESULT, RESULT, MomentFilter0, {dirY}, Transform.mirrorW ) 36 | ELSIF degreeY = 1 THEN Transform.Filter3D( RESULT, RESULT, MomentFilter1, {dirY}, Transform.antimirrorW ) 37 | ELSIF degreeY = 2 THEN Transform.Filter3D( RESULT, RESULT, MomentFilter2, {dirY}, Transform.mirrorW ) 38 | ELSIF degreeY = skip THEN (*nothing*) 39 | END; 40 | IF degreeZ = 0 THEN Transform.Filter3D( RESULT, RESULT, MomentFilter0, {dirZ}, Transform.mirrorW ) 41 | ELSIF degreeZ = 1 THEN Transform.Filter3D( RESULT, RESULT, MomentFilter1, {dirZ}, Transform.antimirrorW ) 42 | ELSIF degreeZ = 2 THEN Transform.Filter3D( RESULT, RESULT, MomentFilter2, {dirZ}, Transform.mirrorW ) 43 | ELSIF degreeZ = skip THEN (*nothing*) 44 | END; 45 | RETURN RESULT; 46 | END Moment; 47 | 48 | END VolumeMoments. 49 | 50 | OFormatter.Format * -------------------------------------------------------------------------------- /Matrix/VolumePDE_ConstrainedLaplace.MtA: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Matrix/VolumePDE_ConstrainedLaplace.MtA -------------------------------------------------------------------------------- /Matrix/WMMatrixComponents.rep: -------------------------------------------------------------------------------- 1 | index.xml000000003450003263 2 |
3 | 1 4 | TRUE 5 |
6 | 7 | 8 | 9 | 10 | 11 |
-------------------------------------------------------------------------------- /Matrix/WMRaster.Mod: -------------------------------------------------------------------------------- 1 | MODULE WMRaster; (** AUTHOR "Patrick Hunziker"; PURPOSE "Simple Display of Images on Screen"; *) 2 | IMPORT WM:=WMWindowManager, Strings, Raster, WMGraphics, WMRectangles; 3 | 4 | TYPE Window*= OBJECT (WM.BufferWindow) 5 | 6 | PROCEDURE &Initialize*(img:Raster.Image; CONST title: ARRAY OF CHAR); 7 | BEGIN 8 | Init(img.width, img.height,FALSE); 9 | manager:=WM.GetDefaultManager(); 10 | SetImage(img); 11 | SetTitle(Strings.NewString(title)); 12 | END Initialize; 13 | 14 | PROCEDURE SetImage*(img:Raster.Image); 15 | BEGIN 16 | SELF.img:=img(WMGraphics.Image); 17 | Draw(canvas,img.width,img.height,0); 18 | Invalidate(WMRectangles.MakeRect(0, 0, img.width, img.height)); 19 | END SetImage; 20 | 21 | PROCEDURE Integrate*; (** deprecated *) 22 | BEGIN 23 | AddWindow; 24 | END Integrate; 25 | 26 | PROCEDURE AddWindow*; 27 | BEGIN 28 | WM.ExtAddWindow(SELF, InsertPosX, InsertPosY, {WM.FlagFrame,WM.FlagClose,WM.FlagMinimize}); 29 | InsertPosX:= (InsertPosX +16)MOD 512; InsertPosY:=(InsertPosY + 16) MOD 512; 30 | END AddWindow; 31 | 32 | END Window; 33 | 34 | VAR InsertPosX,InsertPosY: SIGNED32; 35 | 36 | PROCEDURE Integrate*(img:Raster.Image; CONST title: ARRAY OF CHAR); (** deprecated *) 37 | BEGIN 38 | AddWindow(img, title); 39 | END Integrate; 40 | 41 | PROCEDURE AddWindow*(img:Raster.Image; CONST title: ARRAY OF CHAR); 42 | VAR pw: Window; 43 | BEGIN 44 | NEW(pw, img, title); 45 | pw.AddWindow; 46 | END AddWindow; 47 | 48 | BEGIN 49 | InsertPosX:=20; InsertPosY:=20; 50 | END WMRaster. 51 | -------------------------------------------------------------------------------- /Matrix/linp32SSE2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Matrix/linp32SSE2.exe -------------------------------------------------------------------------------- /Matrix/matrix.txt: -------------------------------------------------------------------------------- 1 | DisplayNull.Install ~ 2 | WindowManager.Install ~ 3 | FoxTest.Compile Matrix.Test Matrix.Test.Diff ~ 4 | -------------------------------------------------------------------------------- /Matrix/test: -------------------------------------------------------------------------------- 1 | include makefile 2 | 3 | Matrix\ Library: Matrix.Test.Diff 4 | 5 | Matrix.Test.Diff: oberon Matrix.Test Matrix/matrix.txt $(addsuffix $(object), DisplayNull WindowManager) 6 | @./oberon execute Matrix/matrix.txt 7 | 8 | Matrix.Test: oberon $(addsuffix $(object), Random BIT NbrCplx MathCplx Out WMWindowManager RasterPixelFormats Inputs WMComponents WMStandardComponents) \ 9 | $(addprefix Matrix/, MatrixBase.Mod ComplexMathL.Mod MatrixUtilities.Mod MatrixStreams.Mod PMath.Mod GeoTools.Mod MatrixRaster.Mod WMArrayPanel.Mod LinearMath.Mod LinearFilters.Mod LinearFIRConvolveLongReal.Mod LinearIIRConvolveLongReal.Mod LinearConvolve.Mod Wavelets.Mod LinearFFT.Mod MatrixInterpolation.Mod MatrixBSplineInterpolation.Mod PlanarBase.Mod PlanarMath.Mod PlanarFFT.Mod PlanarNabla.Mod PlanarNorms.Mod PlanarTransform.Mod PlanarPDE.Mod PlanarWavelets.Mod MatrixMoments.Mod LinearTransform.Mod TensorMath.Mod VolumeBase.Mod VolumeFFT.Mod VolumeNabla.Mod VolumeTransform.Mod VolumePDE.Mod VolumeMoments.Mod HypercubeBase.Mod HypercubeNabla.Mod HypercubeTransform.Mod HypercubeMoments.Mod MatrixStandardSolvers.Mod MatrixTransforms.Mod MatrixIterativeSolvers.Mod MatrixAlgebraicMultigrid.Mod MatrixNorms.Mod MatrixPolynomEq.Mod MatrixSVD.Mod MatrixEigen.Mod MatrixFastMatrixMultiply.Mod MatrixLeastSquares.Mod MatrixPrincipalComponents.Mod MatrixRoots.Mod MatrixKrylovCGS.Mod MatrixKrylovGMRES.Mod MatrixKrylovMINRES.Mod MatrixOptim.Mod TestMatrixOptim.Mod MatrixActive.Mod MatrixComputeObjects.Mod MatrixBlockSolvers.Mod MatrixFigures.Mod MatrixAVI.Mod WMMatrix.Mod WMMatrixGraph.Mod WMStack.Mod WMTensor.Mod WMMatrixLoader.Mod PlanarMorphology.Mod VolumeMorphology.Mod MLBase.Mod ErrorBase.Mod ExtraSort.Mod MLClassifier.Mod MLKernels.Mod MLKernelMeans.Mod MLRegression.Mod MLRidgeRegression.Mod StatisticsBase.Mod StatisticsHistograms.Mod StatisticsFunctions.Mod StatisticsLinearRegression.Mod StatisticsCombinatorics.Mod PlanarEdgeDetectors.Mod PlanarBlobDetectors.Mod TestComplexMathL.Mod TestMatrixStandardSolvers.Mod TestPlanarPDE.Mod TestVolumePDE.Mod TestPlanarWavelets.Mod LinpackBenchmark.Mod MatrixWarp.Mod) 10 | @./oberon Compiler.Compile -p=$(pltfrm) --objectFileExtension=$(object) --symbolFileExtension=$(symbol) --test=Test --testFile=Matrix.Test $(filter %.Mod, $^) 11 | -------------------------------------------------------------------------------- /OCTK/Bird.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/Bird.Mod -------------------------------------------------------------------------------- /OCTK/FreehandUS.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/FreehandUS.Mod -------------------------------------------------------------------------------- /OCTK/I386.octkComplexOptimized.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/I386.octkComplexOptimized.Mod -------------------------------------------------------------------------------- /OCTK/I386.octkFIRConvolveOptimized.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/I386.octkFIRConvolveOptimized.Mod -------------------------------------------------------------------------------- /OCTK/I386.octkLDSPFFTOptimized.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/I386.octkLDSPFFTOptimized.Mod -------------------------------------------------------------------------------- /OCTK/I386.octkNUSIOptimized.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/I386.octkNUSIOptimized.Mod -------------------------------------------------------------------------------- /OCTK/OCTK.Tool: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/OCTK.Tool -------------------------------------------------------------------------------- /OCTK/SNTP.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/SNTP.Mod -------------------------------------------------------------------------------- /OCTK/loadnd.m: -------------------------------------------------------------------------------- 1 | % 2 | % Loads n-dimensional data in format compatible with ArrayIO from OCTK library 3 | % 4 | % INPUT: 5 | % FileName - string of file name to load 6 | % OUTPUT: 7 | % loaded array 8 | % 9 | function x = loadnd(fileName) 10 | 11 | file = fopen(fileName); 12 | if file < 0 13 | error('could not open specified file!'); 14 | end; 15 | 16 | % first read file ID 17 | %ch = fread(file,11,'char=>char'); 18 | strID = fgetl(file); 19 | if ~strcmp(strID,'octkArray') 20 | error('invalid data ID in the file header!'); 21 | end; 22 | 23 | % read data type code 24 | n = fread(file,1,'int32'); 25 | 26 | switch n 27 | case 1 28 | dType = 'int8'; frmt = 'int8=>int8'; 29 | case 2 30 | dType = 'int16'; frmt = 'int16=>int16'; 31 | case 3 32 | dType = 'int32'; frmt = 'int32=>int32'; 33 | case 4 34 | dType = 'int64'; frmt = 'int64=>int64'; 35 | case 5 36 | dType = 'single'; frmt = 'single=>single'; 37 | case 6 38 | dType = 'double'; frmt = 'double=>double'; 39 | case 7 40 | dType = 'single'; frmt = 'single=>single'; 41 | case 8 42 | dType = 'double'; frmt = 'double=>double'; 43 | case 9 44 | dType = 'uint8'; frmt = 'uint8=>uint8'; 45 | end; 46 | 47 | % data dimensionality 48 | 49 | ndim = fread(file,1,'int32'); 50 | 51 | % data size 52 | sz = fread(file,ndim,'int32')'; 53 | if (n ~= 7) && (n ~= 8) 54 | x = fread(file,prod(sz),frmt); 55 | else 56 | x = fread(file,[2 prod(sz)],frmt); 57 | x = complex(x(1,:),x(2,:)); 58 | end; 59 | fclose(file); 60 | 61 | % if more than 1D permute 62 | if ndim > 1 63 | x = reshape(x,sz(end:-1:1)); 64 | ord = 1:length(sz); 65 | x = permute(x,ord(end:-1:1)); 66 | end; 67 | -------------------------------------------------------------------------------- /OCTK/octkAMDCAL.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkAMDCAL.Mod -------------------------------------------------------------------------------- /OCTK/octkAMDCALArrays.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkAMDCALArrays.Mod -------------------------------------------------------------------------------- /OCTK/octkAMDCALComputeObjects.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkAMDCALComputeObjects.Mod -------------------------------------------------------------------------------- /OCTK/octkAMDCALKernelTools.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkAMDCALKernelTools.Mod -------------------------------------------------------------------------------- /OCTK/octkAMDCALObjects.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkAMDCALObjects.Mod -------------------------------------------------------------------------------- /OCTK/octkAMDCALTest.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkAMDCALTest.Mod -------------------------------------------------------------------------------- /OCTK/octkArrayBool.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkArrayBool.Mod -------------------------------------------------------------------------------- /OCTK/octkArrayDataTypes.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkArrayDataTypes.Mod -------------------------------------------------------------------------------- /OCTK/octkArrayIO.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkArrayIO.Mod -------------------------------------------------------------------------------- /OCTK/octkArrayMultiway.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkArrayMultiway.Mod -------------------------------------------------------------------------------- /OCTK/octkArrayNumeric.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkArrayNumeric.Mod -------------------------------------------------------------------------------- /OCTK/octkArrayObjects.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkArrayObjects.Mod -------------------------------------------------------------------------------- /OCTK/octkArrayPermute.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkArrayPermute.Mod -------------------------------------------------------------------------------- /OCTK/octkArraySepHandling.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkArraySepHandling.Mod -------------------------------------------------------------------------------- /OCTK/octkBSplKernels.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkBSplKernels.Mod -------------------------------------------------------------------------------- /OCTK/octkBSplKernelsDiff.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkBSplKernelsDiff.Mod -------------------------------------------------------------------------------- /OCTK/octkBSplMultires.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkBSplMultires.Mod -------------------------------------------------------------------------------- /OCTK/octkBSplTransforms.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkBSplTransforms.Mod -------------------------------------------------------------------------------- /OCTK/octkBase.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkBase.Mod -------------------------------------------------------------------------------- /OCTK/octkClusterBase.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkClusterBase.Mod -------------------------------------------------------------------------------- /OCTK/octkClusterTest.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkClusterTest.Mod -------------------------------------------------------------------------------- /OCTK/octkClusterTools.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkClusterTools.Mod -------------------------------------------------------------------------------- /OCTK/octkComplex.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkComplex.Mod -------------------------------------------------------------------------------- /OCTK/octkComputeClusterNodes.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkComputeClusterNodes.Mod -------------------------------------------------------------------------------- /OCTK/octkComputeHostObjects.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkComputeHostObjects.Mod -------------------------------------------------------------------------------- /OCTK/octkComputeManager.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkComputeManager.Mod -------------------------------------------------------------------------------- /OCTK/octkComputeObjects.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkComputeObjects.Mod -------------------------------------------------------------------------------- /OCTK/octkComputeRemoteObjects.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkComputeRemoteObjects.Mod -------------------------------------------------------------------------------- /OCTK/octkComputeServices.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkComputeServices.Mod -------------------------------------------------------------------------------- /OCTK/octkComputeTCPServices.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkComputeTCPServices.Mod -------------------------------------------------------------------------------- /OCTK/octkComputeTest.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkComputeTest.Mod -------------------------------------------------------------------------------- /OCTK/octkErrorBase.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkErrorBase.Mod -------------------------------------------------------------------------------- /OCTK/octkFFT.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkFFT.Mod -------------------------------------------------------------------------------- /OCTK/octkFIRConvolve.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkFIRConvolve.Mod -------------------------------------------------------------------------------- /OCTK/octkIIRConvolve.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkIIRConvolve.Mod -------------------------------------------------------------------------------- /OCTK/octkLDSPFFT.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkLDSPFFT.Mod -------------------------------------------------------------------------------- /OCTK/octkLDSPFFTReal.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkLDSPFFTReal.Mod -------------------------------------------------------------------------------- /OCTK/octkLDSPFFTRealTest.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkLDSPFFTRealTest.Mod -------------------------------------------------------------------------------- /OCTK/octkLDSPFFTTest.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkLDSPFFTTest.Mod -------------------------------------------------------------------------------- /OCTK/octkMatrixSparse.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkMatrixSparse.Mod -------------------------------------------------------------------------------- /OCTK/octkMatrixSparseTest.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkMatrixSparseTest.Mod -------------------------------------------------------------------------------- /OCTK/octkMultiThreadBase.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkMultiThreadBase.Mod -------------------------------------------------------------------------------- /OCTK/octkNUSI.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkNUSI.Mod -------------------------------------------------------------------------------- /OCTK/octkNUSICluster.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkNUSICluster.Mod -------------------------------------------------------------------------------- /OCTK/octkNUSIMultigrid.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkNUSIMultigrid.Mod -------------------------------------------------------------------------------- /OCTK/octkNUSIMultires.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkNUSIMultires.Mod -------------------------------------------------------------------------------- /OCTK/octkNUSIRegularize.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkNUSIRegularize.Mod -------------------------------------------------------------------------------- /OCTK/octkNUSITest.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkNUSITest.Mod -------------------------------------------------------------------------------- /OCTK/octkNUSIVector.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkNUSIVector.Mod -------------------------------------------------------------------------------- /OCTK/octkPDE.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkPDE.Mod -------------------------------------------------------------------------------- /OCTK/octkQuickSort.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkQuickSort.Mod -------------------------------------------------------------------------------- /OCTK/octkRAPIClient.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkRAPIClient.Mod -------------------------------------------------------------------------------- /OCTK/octkRAPIServer.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkRAPIServer.Mod -------------------------------------------------------------------------------- /OCTK/octkRandomBase.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkRandomBase.Mod -------------------------------------------------------------------------------- /OCTK/octkRandomUniform.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkRandomUniform.Mod -------------------------------------------------------------------------------- /OCTK/octkResample.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkResample.Mod -------------------------------------------------------------------------------- /OCTK/octkServices.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkServices.Mod -------------------------------------------------------------------------------- /OCTK/octkSimpleNUSI.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkSimpleNUSI.Mod -------------------------------------------------------------------------------- /OCTK/octkSolverBICGSTAB.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkSolverBICGSTAB.Mod -------------------------------------------------------------------------------- /OCTK/octkSolverBase.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkSolverBase.Mod -------------------------------------------------------------------------------- /OCTK/octkSolverCG.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkSolverCG.Mod -------------------------------------------------------------------------------- /OCTK/octkSolverJacobi.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkSolverJacobi.Mod -------------------------------------------------------------------------------- /OCTK/octkSolverMultigrid.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkSolverMultigrid.Mod -------------------------------------------------------------------------------- /OCTK/octkSolverTest.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkSolverTest.Mod -------------------------------------------------------------------------------- /OCTK/octkSortBase.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkSortBase.Mod -------------------------------------------------------------------------------- /OCTK/octkStopwatch.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkStopwatch.Mod -------------------------------------------------------------------------------- /OCTK/octkTensor.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkTensor.Mod -------------------------------------------------------------------------------- /OCTK/octkTensorTest.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkTensorTest.Mod -------------------------------------------------------------------------------- /OCTK/octkTime.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkTime.Mod -------------------------------------------------------------------------------- /OCTK/octkTrace.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OCTK/octkTrace.Mod -------------------------------------------------------------------------------- /OCTK/savend.m: -------------------------------------------------------------------------------- 1 | % 2 | % Loads n-dimensional data in format compatible with ArrayIO from OCTK library 3 | % 4 | % INPUT: 5 | % x - array to store 6 | % FileName - string of file name to store 7 | % 8 | function savend(x,fileName) 9 | 10 | file = fopen(fileName,'w'); 11 | 12 | % file ID 13 | fwrite(file,'octkArray','uint8'); 14 | fwrite(file,[13 10],'uint8'); 15 | 16 | % data type 17 | 18 | if isa(x,'int8') 19 | fwrite(file,1,'int32'); sformat = 'int8'; 20 | elseif isa(x,'int16') 21 | fwrite(file,2,'int32'); sformat = 'int16'; 22 | elseif isa(x,'int32') 23 | fwrite(file,3,'int32'); sformat = 'int32'; 24 | elseif isa(x,'int64') 25 | fwrite(file,4,'int32'); sformat = 'int64'; 26 | elseif isa(x,'single') 27 | fwrite(file,5,'int32'); sformat = 'single'; 28 | elseif isa(x,'double') 29 | fwrite(file,6,'int32'); sformat = 'double'; 30 | end; 31 | 32 | % data dimensionality 33 | ndim = ndims(x); 34 | if (ndim==2) && ((size(x,1) == 1) || (size(x,2) == 1)) 35 | ndim = 1; 36 | end; 37 | fwrite(file,ndim,'int32'); 38 | 39 | % data size 40 | if ndim > 1 41 | fwrite(file,size(x),'int32'); 42 | else 43 | fwrite(file,length(x),'int32'); 44 | end; 45 | 46 | % if more than 1D permute 47 | if ndim > 1 48 | ord = 1:ndim; 49 | x = permute(x,ord(end:-1:1)); 50 | end; 51 | 52 | fwrite(file,x,sformat); 53 | 54 | fclose(file); -------------------------------------------------------------------------------- /OpenDocument/OpenDocumentHowto.Text: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/OpenDocument/OpenDocumentHowto.Text -------------------------------------------------------------------------------- /OpenDocument/OpenDocumentTransforms.Mod: -------------------------------------------------------------------------------- 1 | MODULE OpenDocumentTransforms; (** AUTHOR "Patrick Hunziker"; PURPOSE "XSL Transformations for OpenOffice documents"; *) 2 | 3 | IMPORT 4 | 5 | 6 | 7 | END OpenDocumentTransforms. 8 | 9 | example how to transform an OpenOffice Presentation into a a list of slide titles with text: 10 | 11 | 16 | 17 | 18 | Speaker Notes 19 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |

slide : 34 |

35 | 36 |
37 | 38 | 39 |

40 |
41 | 42 | 43 | 44 | 45 | 46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /PH/Contents.txt: -------------------------------------------------------------------------------- 1 | PHRegistries.Mod Generic, but simple base class of a registry, for storage and retrieval 2 | PHUserRegistry.Mod User database including userid, password, domain, and hash. The password is only stored as a hash, not in plain text. 3 | 4 | PHWebSyndication RSS feed reader/aggregator/handler. should handle RSS and Atom formats; the latter is still buggy. -------------------------------------------------------------------------------- /Reanimator/JAOS/Documentation/JAOSReportDE.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Reanimator/JAOS/Documentation/JAOSReportDE.pdf -------------------------------------------------------------------------------- /Reanimator/JAOS/Documentation/SSW04_9_JVM_1x.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Reanimator/JAOS/Documentation/SSW04_9_JVM_1x.pdf -------------------------------------------------------------------------------- /Reanimator/JAOS/Documentation/eth-26497-02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Reanimator/JAOS/Documentation/eth-26497-02.pdf -------------------------------------------------------------------------------- /Reanimator/JAOS/README: -------------------------------------------------------------------------------- 1 | JVM CVS 2 | 3 | JVM/source 4 | the oberon sources for the JVM 5 | JVM/classpath 6 | the java sources for building the java API 7 | 8 | 9 | Using JVM/classpath 10 | 11 | The Java APIs have been modified for the Oberon JVM. To allow synchronization 12 | with the GNU Classpath project we rely on CVS source management. 13 | 14 | We only use the java/* directory of the classpath release (the one containing the java sources). oberon/* is added for our own java classes. 15 | 16 | * Updating the API when a new classpath version is released: 17 | 18 | 1) download the newest version from www.classpath.org 19 | 2) unpack it: tar -xzf 20 | 3) keep only the java directory, remove non *.java files 21 | 4) add it to cvs: 22 | cvs import -m "classpath X.XX" JVM/classpath classpath classpath-X-XX 23 | 5) merge 24 | cvs checkout -jclasspath:yesterday -jclasspath JVM/classpath 25 | 6) controll changed classes 26 | 7) rebuild 27 | -------------------------------------------------------------------------------- /Reanimator/JAOS/bin/glibj-0.6.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Reanimator/JAOS/bin/glibj-0.6.zip -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/Makefile.am: -------------------------------------------------------------------------------- 1 | # used by automake to generate Makefile.in 2 | 3 | 4 | SUBDIRS = reference 5 | -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/kaffe/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = java kaffe native 2 | -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/kaffe/java/Makefile.am: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Reanimator/JAOS/classpath/vm/kaffe/java/Makefile.am -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/kaffe/kaffe/Makefile.am: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Reanimator/JAOS/classpath/vm/kaffe/kaffe/Makefile.am -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/kaffe/native/Makefile.am: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Reanimator/JAOS/classpath/vm/kaffe/native/Makefile.am -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/reference/Makefile.am: -------------------------------------------------------------------------------- 1 | # used by automake to generate Makefile.in 2 | 3 | SUBDIRS = gnu java 4 | -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/reference/gnu/Makefile.am: -------------------------------------------------------------------------------- 1 | # used by automake to generate Makefile.in 2 | 3 | SUBDIRS = vm 4 | 5 | -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/reference/gnu/vm/Makefile.am: -------------------------------------------------------------------------------- 1 | # used by automake to generate Makefile.in 2 | 3 | SUBDIRS = stack 4 | 5 | -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/reference/gnu/vm/stack/Makefile.am: -------------------------------------------------------------------------------- 1 | # used by automake to generate Makefile.in 2 | 3 | EXTRA_DIST = \ 4 | StackFrame.java \ 5 | StackTrace.java 6 | 7 | -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/reference/gnu/vm/stack/StackFrame.java: -------------------------------------------------------------------------------- 1 | /* StackFrame.java 2 | Copyright (C) 1998 Free Software Foundation 3 | 4 | This file is part of GNU Classpath. 5 | 6 | GNU Classpath is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2, or (at your option) 9 | any later version. 10 | 11 | GNU Classpath is distributed in the hope that it will be useful, but 12 | WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GNU Classpath; see the file COPYING. If not, write to the 18 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 | 02111-1307 USA. 20 | 21 | As a special exception, if you link this library with other files to 22 | produce an executable, this library does not by itself cause the 23 | resulting executable to be covered by the GNU General Public License. 24 | This exception does not however invalidate any other reasons why the 25 | executable file might be covered by the GNU General Public License. */ 26 | 27 | package gnu.vm.stack; 28 | 29 | import java.lang.reflect.*; 30 | 31 | /** 32 | ** StackFrame represents a single frame of the Java 33 | ** execution stack, frozen in time. 34 | ** 35 | ** @author John Keiser 36 | ** @version 1.1.0, Aug 11 1998 37 | **/ 38 | public final class StackFrame { 39 | StackFrame caller; 40 | Object obj; 41 | Method method; 42 | int lineNum; 43 | String filename; 44 | 45 | /** 46 | * Constructs a new stack frame. This is only called by the virtual 47 | * machine. 48 | * @param obj the this reference of that frame, null for static classes. 49 | * @param method the called method. 50 | * @param lineNum the line number or -1 if unknown. 51 | * @param filename the filename of the source of the method, null if unknown. 52 | */ 53 | private StackFrame(Object obj, Method method, int lineNum, String filename) { 54 | this.caller = caller; 55 | this.obj = obj; 56 | this.method = method; 57 | this.lineNum = lineNum; 58 | this.filename = filename; 59 | } 60 | 61 | public String getSourceFilename() { 62 | return filename; 63 | } 64 | 65 | public Object getCalledObject() { 66 | return obj; 67 | } 68 | 69 | public Class getCalledClass() { 70 | return method.getDeclaringClass(); 71 | } 72 | 73 | public Method getCalledMethod() { 74 | return method; 75 | } 76 | 77 | public int getSourceLineNumber() { 78 | return lineNum; 79 | } 80 | 81 | public String toString() { 82 | return getCalledClass().getName() + "." 83 | + getCalledMethod().getName() 84 | + (getSourceFilename() != null ? 85 | " at " + getSourceFilename() 86 | + ":" + getSourceLineNumber() 87 | : " (compiled code)"); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/reference/gnu/vm/stack/StackTrace.java: -------------------------------------------------------------------------------- 1 | /* StackTrace.java 2 | Copyright (C) 1998 Free Software Foundation 3 | 4 | This file is part of GNU Classpath. 5 | 6 | GNU Classpath is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2, or (at your option) 9 | any later version. 10 | 11 | GNU Classpath is distributed in the hope that it will be useful, but 12 | WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GNU Classpath; see the file COPYING. If not, write to the 18 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 | 02111-1307 USA. 20 | 21 | As a special exception, if you link this library with other files to 22 | produce an executable, this library does not by itself cause the 23 | resulting executable to be covered by the GNU General Public License. 24 | This exception does not however invalidate any other reasons why the 25 | executable file might be covered by the GNU General Public License. */ 26 | 27 | package gnu.vm.stack; 28 | 29 | import java.lang.reflect.*; 30 | 31 | /** 32 | ** StackTrace represents a Java system execution 33 | ** stack and allows you to get information off of it. 34 | ** 35 | ** @author John Keiser 36 | ** @version 1.1.0, Aug 11 1998 37 | **/ 38 | public class StackTrace { 39 | StackFrame[] frames; 40 | int len; 41 | 42 | public static StackTrace copyCurrentStackTrace() { 43 | return new StackTrace(new StackFrame[0]); 44 | } 45 | 46 | public static StackTrace copyStackTrace(Thread t) { 47 | return new StackTrace(new StackFrame[0]); 48 | } 49 | 50 | StackTrace(StackFrame[] frames) { 51 | this.frames = frames; 52 | len = frames.length; 53 | } 54 | 55 | public synchronized StackFrame pop() { 56 | if(len <= 0) 57 | return null; 58 | //Note: cannot throw exception here, since this method 59 | //is used in exception throwing itself and could cause 60 | //an infinite loop. 61 | //throw new ArrayIndexOutOfBoundsException("stack trace empty."); 62 | len--; 63 | return frames[len]; 64 | } 65 | 66 | public synchronized StackFrame frameAt(int i) { 67 | if(i > len) 68 | throw new ArrayIndexOutOfBoundsException(i + " > " + len); 69 | return frames[i]; 70 | } 71 | 72 | public synchronized int numFrames() { 73 | return len; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/reference/java/Makefile.am: -------------------------------------------------------------------------------- 1 | # used by automake to generate Makefile.in 2 | 3 | SUBDIRS = lang 4 | -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/reference/java/lang/Makefile.am: -------------------------------------------------------------------------------- 1 | # used by automake to generate Makefile.in 2 | 3 | SUBDIRS = reflect 4 | 5 | EXTRA_DIST = \ 6 | Class.java \ 7 | Runtime.java \ 8 | Thread.java \ 9 | Throwable.java \ 10 | VMClassLoader.java \ 11 | VMObject.java \ 12 | VMSecurityManager.java \ 13 | VMSystem.java 14 | -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/reference/java/lang/VMSecurityManager.java: -------------------------------------------------------------------------------- 1 | /* VMSecurityManager.java 2 | Copyright (C) 1998 Free Software Foundation 3 | 4 | This file is part of GNU Classpath. 5 | 6 | GNU Classpath is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2, or (at your option) 9 | any later version. 10 | 11 | GNU Classpath is distributed in the hope that it will be useful, but 12 | WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with GNU Classpath; see the file COPYING. If not, write to the 18 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 | 02111-1307 USA. 20 | 21 | As a special exception, if you link this library with other files to 22 | produce an executable, this library does not by itself cause the 23 | resulting executable to be covered by the GNU General Public License. 24 | This exception does not however invalidate any other reasons why the 25 | executable file might be covered by the GNU General Public License. */ 26 | 27 | package java.lang; 28 | 29 | import java.net.*; 30 | import java.util.*; 31 | import java.io.*; 32 | 33 | /** 34 | ** VMSecurityManager is a helper class for SecurityManager the VM must 35 | ** implement. 36 | ** 37 | ** @author John Keiser 38 | ** @version 1.1.0, 31 May 1998 39 | **/ 40 | class VMSecurityManager { 41 | /** Get a list of all the classes currently executing 42 | ** methods on the Java stack. getClassContext()[0] is 43 | ** the currently executing method 44 | ** Spec Note: does not say whether 45 | ** the stack will include the getClassContext() call or 46 | ** the one just before it. 47 | ** 48 | ** @return an array containing all the methods on classes 49 | ** on the Java execution stack. 50 | **/ 51 | static native Class[] getClassContext(); 52 | 53 | /** Get the current ClassLoader--the one nearest to the 54 | ** top of the stack. 55 | ** @return the current ClassLoader. 56 | **/ 57 | static native ClassLoader currentClassLoader(); 58 | } 59 | -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/reference/java/lang/reflect/Makefile.am: -------------------------------------------------------------------------------- 1 | # used by automake to generate Makefile.in 2 | 3 | EXTRA_DIST = \ 4 | Constructor.java \ 5 | Field.java \ 6 | Method.java 7 | -------------------------------------------------------------------------------- /Reanimator/JAOS/classpath/vm/reference/oberon/OberonEnv.java: -------------------------------------------------------------------------------- 1 | /* Oberon.OberonEnv 2 | 3 | Oberon Java Plattform 4 | ********************* 5 | */ 6 | package oberon; 7 | 8 | /** 9 | ** OberonEnv represents hooks to the Oberon Environment; 10 | ** Everything is native and static; 11 | ** 12 | ** @author Rolf Laich 13 | ** @version 0.0, Dez 2000 14 | ** @since JDK1.0 15 | **/ 16 | public final class OberonEnv{ 17 | 18 | private OberonEnv(){} 19 | 20 | public static final int NOT_IMPL = 0xBAFF; 21 | public static final int FILE = 0x0001; 22 | 23 | /** 24 | ** in some situations it is very good to produce a trap 25 | ** 26 | **/ 27 | public native static void Trap( int nr ); 28 | 29 | 30 | public native static String[] Directory( java.io.FileDescriptor fd, java.io.FilenameFilter ff ); 31 | 32 | /** 33 | ** create a FileDesriptor 34 | **/ 35 | public native static java.io.FileDescriptor CreateFileDescriptor( String name, int typ ); 36 | 37 | /** 38 | ** create a FileDesriptor 39 | **/ 40 | public native static java.io.FileDescriptor NewFile( String name ); 41 | 42 | /** 43 | ** create a FileDesriptor 44 | **/ 45 | public native static java.io.FileDescriptor OldFile( String name ); 46 | 47 | /** 48 | ** delete File assosiated with Filedescriptor 49 | **/ 50 | public native static boolean DeleteFile( java.io.FileDescriptor fd ); 51 | 52 | /** 53 | ** rename File assosiated with Filedescriptor 54 | **/ 55 | public native static boolean RenameFile( java.io.FileDescriptor fd, String newName ); 56 | 57 | /** 58 | ** get length of a file 59 | **/ 60 | public native static long FileLength( java.io.FileDescriptor fd ); 61 | 62 | 63 | /** 64 | ** get modification date 65 | **/ 66 | public native static long GetFileDate( java.io.FileDescriptor fd ); 67 | 68 | /** 69 | ** set modification date 70 | **/ 71 | public native static boolean SetFileDate( java.io.FileDescriptor fd, long time ); 72 | 73 | /** 74 | ** support for floating point and math 75 | ** 76 | **/ 77 | 78 | /** 79 | ** parses a float or a double; return is always double 80 | ** for parseFloat in java/lang/Float use narrowing 81 | ** accepted syntax [+|-]number{number}["."{number}[(e|E)[+|-] number{number}] 82 | **/ 83 | public native static double ParseFloatingPointNumber(String s) 84 | throws NumberFormatException, NullPointerException; 85 | 86 | /** 87 | ** converts a Floating Point Number to a java.lang.String 88 | **/ 89 | public native static String Float2String( double val ); 90 | } 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /Reanimator/JAOS/source/JVM.OpCodeInfo: -------------------------------------------------------------------------------- 1 | WIDE=196;V1 IFNULL=198;BB2 IFNONNULL=199;BB2 GOTOW=200;BB4 JSRW=201;BB4 RETW=209;V2 BIPUSH=16;B1 SIPUSH=17;B2 LDC1=18;I1 LDC2=19;I2 LDC2W=20;I2 ACONSTnull=1;NONE ICONSTm1=2;NONE ICONST0=3;NONE ICONST1=4;NONE ICONST2=5;NONE ICONST3=6;NONE ICONST4=7;NONE ICONST5=8;NONE LCONST0=9;NONE LCONST1=10;NONE FCONST0=11;NONE FCONST1=12;NONE FCONST2=13;NONE DCONST0=14;NONE DCONST1=15;NONE ILOAD=21;V1 ILOAD0=26;NONE ILOAD1=27;NONE ILOAD2=28;NONE ILOAD3=29;NONE LLOAD=22;V1 LLOAD0=30;NONE LLOAD1=31;NONE LLOAD2=32;NONE LLOAD3=33;NONE FLOAD=23;V1 FLOAD0=34;NONE FLOAD1=35;NONE FLOAD2=36;NONE FLOAD3=37;NONE DLOAD=24;V1 DLOAD0=38;NONE DLOAD1=39;NONE DLOAD2=40;NONE DLOAD3=41;NONE ALOAD=25;V1 ALOAD0=42;NONE ALOAD1=43;NONE ALOAD2=44;NONE ALOAD3=45;NONE ISTORE=54;V1 ISTORE0=59;NONE ISTORE1=60;NONE ISTORE2=61;NONE ISTORE3=62;NONE LSTORE=55;V1 LSTORE0=63;NONE LSTORE1=64;NONE LSTORE2=65;NONE LSTORE3=66;NONE FSTORE=56;V1 FSTORE0=67;NONE FSTORE1=68;NONE FSTORE2=69;NONE FSTORE3=70;NONE DSTORE=57;V1 DSTORE0=71;NONE DSTORE1=72;NONE DSTORE2=73;NONE DSTORE3=74;NONE ASTORE=58;V1 ASTORE0=75;NONE ASTORE1=76;NONE ASTORE2=77;NONE ASTORE3=78;NONE IINC=132;V1B1 NEWARRAY=188;A1 ANEWARRAY=189;I2 MULTIANEWARRAY=197;I2B1 ARRAYLENGTH=190;NONE IALOAD=46;NONE LALOAD=47;NONE FALOAD=48;NONE DALOAD=49;NONE AALOAD=50;NONE BALOAD=51;NONE CALOAD=52;NONE SALOAD=53;NONE IASTORE=79;NONE LASTORE=80;NONE FASTORE=81;NONE DASTORE=82;NONE AASTORE=83;NONE BASTORE=84;NONE CASTORE=85;NONE SASTORE=86;NONE NOP=0;NONE POP=87;NONE POP2=88;NONE DUP=89;NONE DUP2=92;NONE DUPx1=90;NONE DUP2x1=93;NONE DUPx2=91;NONE DUP2x2=94;NONE SWAP=95;NONE IADD=96;NONE LADD=97;NONE FADD=98;NONE DADD=99;NONE ISUB=100;NONE LSUB=101;NONE FSUB=102;NONE DSUB=103;NONE IMUL=104;NONE LMUL=105;NONE FMUL=106;NONE DMUL=107;NONE IDIV=108;NONE LDIV=109;NONE FDIV=110;NONE DDIV=111;NONE IREM=112;NONE LREM=113;NONE FREM=114;NONE DREM=115;NONE INEG=116;NONE LNEG=117;NONE FNEG=118;NONE DNEG=119;NONE ISHL=120;NONE ISHR=122;NONE IUSHR=124;NONE LSHL=121;NONE LSHR=123;NONE LUSHR=125;NONE IAND=126;NONE LAND=127;NONE IOR=128;NONE LOR=129;NONE IXOR=130;NONE LXOR=131;NONE I2L=133;NONE I2F=134;NONE I2D=135;NONE L2I=136;NONE L2F=137;NONE L2D=138;NONE F2I=139;NONE F2L=140;NONE F2D=141;NONE D2I=142;NONE D2L=143;NONE D2F=144;NONE I2B=145;NONE I2CR=146;NONE I2S=147;NONE IFEQ=153;BB2 IFLT=155;BB2 IFLE=158;BB2 IFNE=154;BB2 IFGT=157;BB2 IFGE=156;BB2 IFICMPEQ=159;BB2 IFICMPNE=160;BB2 IFICMPLT=161;BB2 IFICMPGT=163;BB2 IFICMPLE=164;BB2 IFICMPGE=162;BB2 LCMP=148;NONE FCMPL=149;NONE FCMPG=150;NONE DCMPL=151;NONE DCMPG=152;NONE IFACMPEQ=165;BB2 IFACMPNE=166;BB2 GOTO=167;BB2 JSR=168;BB2 RET=169;V1 IRETURN=172;NONE LRETURN=173;NONE FRETURN=174;NONE DRETURN=175;NONE ARETURN=176;NONE RETURN=177;NONE TABLESWITCH=170;TABLES LOOKUPSWITCH=171;TABLEL PUTFIELD=181;I2 GETFIELD=180;I2 PUTSTATIC=179;I2 GETSTATIC=178;I2 INVOKEVIRTUAL=182;I2 INVOKESPECIAL=183;I2 INVOKESTATIC=184;I2 INVOKEINTERFACE=185;INTERFACE ATHROW= 191;NONE NEW=187;I2 CHECKCAST=192;I2 INSTANCEOF=193;I2 MONITOREENTER=194;NONE MONITOREEXIT=195;NONE BREAKPOINT=202;NONE -------------------------------------------------------------------------------- /Reanimator/JAOS/source/JVMEmpty.Mod: -------------------------------------------------------------------------------- 1 | (* Jaos, Copyright 2003, Patrik Reali, ETH Zurich *) MODULE JVMEmpty; END JVMEmpty. -------------------------------------------------------------------------------- /Reanimator/JAOS/source/JVMParser.Mod: -------------------------------------------------------------------------------- 1 | (* Jaos, Copyright 2003, Patrik Reali, ETH Zurich *) 2 | 3 | MODULE JVMParser; 4 | 5 | IMPORT 6 | JT := JVMTypes, Reals; 7 | 8 | (* i want to read from texts, files, inputstreams, bytearrays, char arrays, intarrays ; 9 | and i want to use always the same parser *) 10 | TYPE Reader* = OBJECT 11 | PROCEDURE next*( VAR char : INTEGER):BOOLEAN; 12 | BEGIN END next; 13 | END Reader; 14 | 15 | StringReader *= OBJECT(Reader) 16 | VAR 17 | buffer : JT.String; pos, len : LONGINT; 18 | 19 | PROCEDURE next*( VAR char : INTEGER):BOOLEAN; 20 | BEGIN 21 | IF pos < len THEN char := buffer[pos]; INC(pos); RETURN TRUE 22 | ELSE char := 0; RETURN FALSE END 23 | END next; 24 | 25 | PROCEDURE init*( string :JT.String; start, len : LONGINT ); 26 | BEGIN 27 | buffer := string; pos := start; SELF.len := len; 28 | ASSERT( LEN(buffer)>= len ) 29 | END init; 30 | END StringReader; 31 | 32 | PROCEDURE ParseFloat*( r : Reader; VAR val : LONGREAL ):BOOLEAN; 33 | CONST error = -1; 34 | start = 0; sign = 1; intpart = 2; fract = 3; fractpart = 4; 35 | expo = 5; expsign = 6; exppart = 7; ok = 8; 36 | 37 | VAR exp, y : LONGINT; 38 | state, char : INTEGER; 39 | neg, negexp, more : BOOLEAN; 40 | BEGIN 41 | state := start; val := 0; exp := 0; 42 | more := r.next( char ); 43 | WHILE more & (state#error) DO 44 | CASE CHR(char) OF 45 | "+": IF state = start THEN state := sign; neg := FALSE 46 | ELSIF state = exp THEN state := expsign; negexp := FALSE 47 | ELSE state := error END 48 | |"-": IF state = start THEN state := intpart; neg := TRUE 49 | ELSIF state = expo THEN state := expsign; negexp := TRUE 50 | ELSE state := error END 51 | |"0".."9": IF (state = intpart) OR (state = sign) OR (state = start) THEN 52 | state := intpart; val := val*10 + char - ORD("0"); 53 | ELSIF (state = fract) OR (state=fractpart ) THEN state := fractpart; 54 | val := val + (char - ORD("0"))/y; y := y*10; 55 | ELSIF (state = expo) OR (state=expsign) OR (state=exppart) THEN 56 | state := exppart; exp := exp*10 + char - ORD("0") 57 | ELSE state := error 58 | END; 59 | |".": IF state = intpart THEN state := fract; y:=10; 60 | ELSE state := error END 61 | |"e","E": IF (state = fract) OR (state=fractpart) THEN state := expo 62 | ELSE state := error END 63 | |" ": IF state = start THEN 64 | ELSE state := error END 65 | ELSE state := error 66 | END; 67 | more := r.next( char ) 68 | END; 69 | IF state#error THEN 70 | IF negexp THEN exp := -exp END; 71 | IF neg THEN val := -val END; 72 | val := val*Reals.Ten(exp); 73 | RETURN TRUE; 74 | ELSE 75 | val := Reals.NaNL( 0, 0 ); 76 | RETURN FALSE 77 | END 78 | END ParseFloat; 79 | 80 | END JVMParser. 81 | 82 | System.Free JVMParser~ 83 | 84 | JVMParser.Test "-23.14" -------------------------------------------------------------------------------- /Reanimator/JAOS/source/Jaos.Tool: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Reanimator/JAOS/source/Jaos.Tool -------------------------------------------------------------------------------- /Reanimator/JAOS/source/JaosLicense.Text: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Reanimator/JAOS/source/JaosLicense.Text -------------------------------------------------------------------------------- /Reanimator/JAOS/source/jjiFileInputStream.Mod: -------------------------------------------------------------------------------- 1 | MODULE jjiFileInputStream; (*automatically generated stub for java/io/FileInputStream *) (*WARNING: DON'T CHANGE THE PROCEDURE NAMES*) IMPORT SYSTEM, JT := JVMTypes, jjlObject, jjlString, jjiInputStream, jjiFileDescriptor, jjiFile (*, java/nio/channels/FileChannel *); TYPE FileInputStream* = OBJECT (jjiInputStream.InputStream) VAR fd-: jjiFileDescriptor.FileDescriptor; ch-: PTR (*java/nio/channels/FileChannel.Class*); PROCEDURE init8336*(p0: jjiFile.File); (* (Ljava/io/File;)V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init8336; PROCEDURE init646*(p0: jjiFileDescriptor.FileDescriptor); (* (Ljava/io/FileDescriptor;)V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init646; PROCEDURE init1930*(p0: jjlString.String); (* (Ljava/lang/String;)V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init1930; PROCEDURE available*(): JT.Int; (* available()I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END available; PROCEDURE close*(); (* close()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END close; PROCEDURE finalize(); (* finalize()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END finalize; PROCEDURE getChannel*(): PTR (*jjncFileChannel.Class*); (* getChannel()Ljava/nio/channels/FileChannel; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END getChannel; PROCEDURE getFD*(): jjiFileDescriptor.FileDescriptor; (* getFD()Ljava/io/FileDescriptor; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END getFD; PROCEDURE read187*(): JT.Int; (* read()I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END read187; PROCEDURE read331*(p0: jjlObject.ByteArray): JT.Int; (* read([B)I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END read331; PROCEDURE read1591*(p0: jjlObject.ByteArray; p1: JT.Int; p2: JT.Int): JT.Int; (* read([BII)I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END read1591; (** skip - native implementation for bootstrap purposed *) PROCEDURE skip(len: HUGEINT): HUGEINT; VAR new, pos: HUGEINT; BEGIN IF (len = 0) THEN RETURN 0 END; pos := fd.nativeGetFilePointer(fd.nativeFd); new := fd.nativeSeek(fd.nativeFd, len, jjiFileDescriptor.CUR, TRUE); RETURN new-pos; END skip; (** readByteArray - native implementation for bootstrap purposed *) PROCEDURE readByteArray*(VAR buf: ARRAY OF CHAR; ofs, len: LONGINT): LONGINT; BEGIN RETURN fd.nativeReadBuf0(fd.nativeFd, buf, ofs, len) END readByteArray; END FileInputStream; END jjiFileInputStream. (* 11.01.04 prk update to classpath 0.06 *) -------------------------------------------------------------------------------- /Reanimator/JAOS/source/jjiInputStream.Mod: -------------------------------------------------------------------------------- 1 | (* Jaos, Copyright 2003, Patrik Reali, ETH Zurich *) MODULE jjiInputStream; (*automatically generated stub for java/io/InputStream *) (*WARNING: DON'T CHANGE THE PROCEDURE NAMES*) IMPORT SYSTEM, JT := JVMTypes, jjlObject; TYPE Object = jjlObject.Object; ByteArray = jjlObject.ByteArray; TYPE InputStream* = OBJECT (Object) PROCEDURE init*(); (* ()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init; PROCEDURE available*(): JT.Int; (* available()I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END available; PROCEDURE close*(); (* close()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END close; PROCEDURE mark*(p0: JT.Int); (* mark(I)V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END mark; PROCEDURE markSupported*(): BOOLEAN; (* markSupported()Z *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END markSupported; PROCEDURE read187*(): JT.Int; (* read()I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END read187; PROCEDURE read331*(p0: ByteArray): JT.Int; (* read([B)I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END read331; PROCEDURE read1591*(p0: ByteArray; p1: JT.Int; p2: JT.Int): JT.Int; (* read([BII)I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END read1591; PROCEDURE reset*(); (* reset()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END reset; PROCEDURE skip*(p0: JT.Long): JT.Long; (* skip(J)J *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END skip; (** readByteArray - native implementation for bootstrap purposes *) PROCEDURE readByteArray*(VAR buf: ARRAY OF CHAR; ofs, len: LONGINT): LONGINT; BEGIN END readByteArray; END InputStream; END jjiInputStream. (* 11.01.04 prk update to classpath 0.06 16.10.01 prk classpath update and file redesign 11.04.01 prk update to classpath 0.02 *) -------------------------------------------------------------------------------- /Reanimator/JAOS/source/jjiOutputStream.Mod: -------------------------------------------------------------------------------- 1 | (* Jaos, Copyright 2003, Patrik Reali, ETH Zurich *) MODULE jjiOutputStream; (*automatically generated stub for java/io/OutputStream *) (*WARNING: DON'T CHANGE THE PROCEDURE NAMES*) IMPORT JT := JVMTypes, jjlObject; TYPE Object = jjlObject.Object; ByteArray = jjlObject.ByteArray; TYPE OutputStream* = OBJECT (Object) PROCEDURE init*(); (* ()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init; PROCEDURE close*(); (* close()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END close; PROCEDURE flush*(); (* flush()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END flush; PROCEDURE write96*(p0: JT.Int); (* write(I)V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END write96; PROCEDURE write340*(p0: ByteArray); (* write([B)V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END write340; PROCEDURE write1576*(p0: ByteArray; p1: JT.Int; p2: JT.Int); (* write([BII)V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END write1576; END OutputStream; END jjiOutputStream. (* 16.10.01 prk classpath update and file redesign 11.04.01 prk update to classpath 0.02 *) -------------------------------------------------------------------------------- /Reanimator/JAOS/source/jjlFloat.Mod: -------------------------------------------------------------------------------- 1 | (* Jaos, Copyright 2003, Patrik Reali, ETH Zurich *) MODULE jjlFloat; (*automatically generated stub for java/lang/Float *) (*WARNING: DON'T CHANGE THE PROCEDURE NAMES*) IMPORT SYSTEM, JVMConverter, JT := JVMTypes, jjlNumber, jjlString, jjlObject, JVMBase, JP := JVMParser; TYPE Number = jjlNumber.Number; String = jjlString.String; Object = jjlObject.Object; Class = JVMBase.Class; CONST (* final static fields *) MAXVALUE* = MAX(REAL); MINVALUE* = MIN(REAL); NEGATIVEINFINITY* = SYSTEM.VAL(REAL, 0FF800000H); (*also -MAX*2 *) NaN* = SYSTEM.VAL(REAL, 7FC00000H); POSITIVEINFINITY* = SYSTEM.VAL(REAL, 7F800000H); (*also MAX*2 *) serialVersionUID* = 0DB3CF0ECDB3CF0ECH; TYPE Float* = OBJECT (Number) VAR value-: JT.Float; PROCEDURE init84*(p0: JT.Double); (* (D)V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init84; PROCEDURE init92*(p0: JT.Float); (* (F)V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init92; PROCEDURE init1930*(p0: String); (* (Ljava/lang/String;)V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init1930; PROCEDURE byteValue*(): JT.Byte; (* byteValue()B *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END byteValue; PROCEDURE compareTo7799*(p0: Float): JT.Int; (* compareTo(Ljava/lang/Float;)I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END compareTo7799; PROCEDURE compareTo6908*(p0: Object): JT.Int; (* compareTo(Ljava/lang/Object;)I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END compareTo6908; PROCEDURE doubleValue*(): JT.Double; (* doubleValue()D *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END doubleValue; PROCEDURE equals*(p0: Object): BOOLEAN; (* equals(Ljava/lang/Object;)Z *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END equals; PROCEDURE floatValue*(): JT.Float; (* floatValue()F *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END floatValue; PROCEDURE hashCode*(): JT.Int; (* hashCode()I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END hashCode; PROCEDURE intValue*(): JT.Int; (* intValue()I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END intValue; PROCEDURE isInfinite*(): BOOLEAN; (* isInfinite()Z *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END isInfinite; PROCEDURE isNaN*(): BOOLEAN; (* isNaN()Z *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END isNaN; PROCEDURE longValue*(): JT.Long; (* longValue()J *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END longValue; PROCEDURE shortValue*(): JT.Short; (* shortValue()S *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END shortValue; PROCEDURE toString*(): Object; (* toString()Ljava/lang/String; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END toString; END Float; VAR Type-: Class; PROCEDURE clinit(); (* ()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END clinit; PROCEDURE compare*(p0: JT.Float; p1: JT.Float): JT.Int; (* compare(FF)I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END compare; PROCEDURE floatToIntBits*(x: JT.Float): JT.Int; (* floatToIntBits(F)I *) BEGIN RETURN SYSTEM.VAL( LONGINT, x ) END floatToIntBits; PROCEDURE floatToRawIntBits*(x: JT.Float): JT.Int; (* floatToRawIntBits(F)I *) BEGIN RETURN SYSTEM.VAL( LONGINT, x ) END floatToRawIntBits; PROCEDURE intBitsToFloat*(i: JT.Int): JT.Float; (* intBitsToFloat(I)F *) BEGIN RETURN SYSTEM.VAL( REAL, i ) END intBitsToFloat; PROCEDURE isInfinite*(p0: JT.Float): BOOLEAN; (* isInfinite(F)Z *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END isInfinite; PROCEDURE isNaN*(p0: JT.Float): BOOLEAN; (* isNaN(F)Z *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END isNaN; PROCEDURE parseFloat*(p0: String): JT.Float; (* parseFloat(Ljava/lang/String;)F *) VAR sr : JP.StringReader; val : LONGREAL; success : BOOLEAN; buffer : ARRAY 32 OF CHAR; BEGIN NEW( sr ); sr.init( p0.value.p, 0, p0.count ); success := JP.ParseFloat( sr, val ); IF ~success THEN jjlString.ToOberon( p0, buffer ); jjlObject.Assert( FALSE, "java/lang/NumberFormatException", buffer ) END; RETURN SHORT(val) END parseFloat; PROCEDURE toString*(x: JT.Float): String; (* toString(F)Ljava/lang/String; *) VAR str: ARRAY 64 OF CHAR; BEGIN JVMConverter.RealToStr(x, str); RETURN jjlString.MakeLiteral1(str) END toString; PROCEDURE valueOf*(p0: String): Float; (* valueOf(Ljava/lang/String;)Ljava/lang/Float; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END valueOf; END jjlFloat. -------------------------------------------------------------------------------- /Reanimator/JAOS/source/jjlNumber.Mod: -------------------------------------------------------------------------------- 1 | (* Jaos, Copyright 2003, Patrik Reali, ETH Zurich *) MODULE jjlNumber; (*automatically generated stub for java/lang/Number *) (*WARNING: DON'T CHANGE THE PROCEDURE NAMES*) IMPORT JT := JVMTypes, jjlObject; CONST serialVersionUID* = -8742448824652078965; TYPE Object = jjlObject.Object; TYPE Number* = OBJECT (Object) PROCEDURE init*(); (* ()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init; PROCEDURE byteValue*(): JT.Byte; (* byteValue()B *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END byteValue; PROCEDURE doubleValue*(): JT.Double; (* doubleValue()D *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END doubleValue; PROCEDURE floatValue*(): JT.Float; (* floatValue()F *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END floatValue; PROCEDURE intValue*(): JT.Int; (* intValue()I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END intValue; PROCEDURE longValue*(): JT.Long; (* longValue()J *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END longValue; PROCEDURE shortValue*(): JT.Short; (* shortValue()S *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END shortValue; END Number; VAR digits-: Object; PROCEDURE clinit(); (* ()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END clinit; END jjlNumber. -------------------------------------------------------------------------------- /Reanimator/JAOS/source/jjlStackTraceElement.Mod: -------------------------------------------------------------------------------- 1 | MODULE jjlStackTraceElement; (*automatically generated stub for java/lang/StackTraceElement *) (*WARNING: DON'T CHANGE THE PROCEDURE NAMES*) IMPORT JT := JVMTypes, jjlObject, jjlString; TYPE Object = jjlObject.Object; String = jjlString.String; CONST serialVersionUID* = 6992337162326171013; TYPE Class* = OBJECT (Object) VAR fileName-: String; lineNumber-: LONGINT; className*: String; methodName-: String; isNative-: BOOLEAN; PROCEDURE init3683(p0: String; p1: JT.Int; p2: String; p3: String; p4: BOOLEAN); (* (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Z)V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init3683; PROCEDURE equals*(p0: Object): BOOLEAN; (* equals(Ljava/lang/Object;)Z *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END equals; PROCEDURE getClassName*(): String; (* getClassName()Ljava/lang/String; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END getClassName; PROCEDURE getFileName*(): String; (* getFileName()Ljava/lang/String; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END getFileName; PROCEDURE getLineNumber*(): JT.Int; (* getLineNumber()I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END getLineNumber; PROCEDURE getMethodName*(): String; (* getMethodName()Ljava/lang/String; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END getMethodName; PROCEDURE hashCode*(): JT.Int; (* hashCode()I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END hashCode; PROCEDURE isNativeMethod*(): BOOLEAN; (* isNativeMethod()Z *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END isNativeMethod; PROCEDURE toString*(): Object; (* toString()Ljava/lang/String; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END toString; END Class; PROCEDURE equals(p0: Object; p1: Object): BOOLEAN; (* equals(Ljava/lang/Object;Ljava/lang/Object;)Z *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END equals; PROCEDURE hashCode(p0: Object): JT.Int; (* hashCode(Ljava/lang/Object;)I *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END hashCode; END jjlStackTraceElement. (* 09.03.03 prk create exception trace *) -------------------------------------------------------------------------------- /Reanimator/JAOS/source/jjlVMClassLoader.Mod: -------------------------------------------------------------------------------- 1 | (* Jaos, Copyright 2003, Patrik Reali, ETH Zurich *) MODULE jjlVMClassLoader; (*automatically generated stub for java/lang/VMClassLoader *) (*WARNING: DON'T CHANGE THE PROCEDURE NAMES*) IMPORT SYSTEM, JC := JVMConsole, JT := JVMTypes, jjlObject, jjlString, JVMBase; TYPE Object = jjlObject.Object; String = jjlString.String; ByteArray = jjlObject.ByteArray; RefArray = jjlObject.RefArray; Class = JVMBase.Class; ClassLoader = Object; Map = Object; ProtectionDomain = Object; Enumeration = Object; URL = Object; Package = Object; TYPE VMClassLoader* = OBJECT (Object) PROCEDURE init(); (* ()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init; END VMClassLoader; VAR errorInfo: JC.LoggingInfo; classjavalangClassLoader-: Class; PROCEDURE class(p0: String; p1: BOOLEAN): Class; (* class$(Ljava/lang/String;Z)Ljava/lang/Class; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END class; PROCEDURE classAssertionStatus(): Map; (* classAssertionStatus()Ljava/util/Map; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END classAssertionStatus; PROCEDURE defaultAssertionStatus(): BOOLEAN; (* defaultAssertionStatus()Z *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END defaultAssertionStatus; PROCEDURE defineClass6185(p0: ClassLoader; p1: String; p2: ByteArray; p3: JT.Int; p4: JT.Int): Class; (* defineClass(Ljava/lang/ClassLoader;Ljava/lang/String;[BII)Ljava/lang/Class; *) BEGIN (* put your implementation here *) JC.String(errorInfo, "VMClassLoader.defineClass6185 not implemented"); JC.Ln(errorInfo); RETURN NIL END defineClass6185; PROCEDURE defineClass3294(p0: ClassLoader; p1: String; p2: ByteArray; p3: JT.Int; p4: JT.Int; p5: ProtectionDomain): Class; (* defineClass(Ljava/lang/ClassLoader;Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END defineClass3294; PROCEDURE getPackage(p0: String): Package; (* getPackage(Ljava/lang/String;)Ljava/lang/Package; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END getPackage; PROCEDURE getPackages(): RefArray; (* getPackages()[Ljava/lang/Package; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END getPackages; PROCEDURE getPrimitiveClass6952(p0: JT.Unicode): Class; (* getPrimitiveClass(C)Ljava/lang/Class; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END getPrimitiveClass6952; PROCEDURE getPrimitiveClass1025(p0: String): Class; (* getPrimitiveClass(Ljava/lang/String;)Ljava/lang/Class; *) VAR str : JT.String; BEGIN (* put your implementation here *) str := SYSTEM.VAL( JT.String, p0.value.p ); RETURN JVMBase.ThisClass( str, TRUE ) END getPrimitiveClass1025; PROCEDURE getResource(p0: String): URL; (* getResource(Ljava/lang/String;)Ljava/net/URL; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END getResource; PROCEDURE getResources(p0: String): Enumeration; (* getResources(Ljava/lang/String;)Ljava/util/Enumeration; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END getResources; PROCEDURE loadClass(p0: String; p1: BOOLEAN): Class; (* loadClass(Ljava/lang/String;Z)Ljava/lang/Class; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END loadClass; PROCEDURE getSystemClassLoader(): ClassLoader; BEGIN (* DON'T IMPLEMENT THIS METHOD *) END getSystemClassLoader; PROCEDURE packageAssertionStatus(): Map; (* packageAssertionStatus()Ljava/util/Map; *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END packageAssertionStatus; PROCEDURE resolveClass(p0: Class); (* resolveClass(Ljava/lang/Class;)V *) BEGIN (* put your implementation here *) JC.String(errorInfo, "VMClassLoader.resolveClass not implemented"); JC.Ln(errorInfo); END resolveClass; BEGIN errorInfo.kind := JC.Error; errorInfo.source := JC.VM; END jjlVMClassLoader. (* 30.07.03 prk Logging functions, add kind and source; filtering support 12.02.03 prk Logging functions, use same interface as AosOut 29.12.02 prk update to classpath snapshot 28.12.02 17.01.02 prk merge with classpath-17-01-02, another getPrimitiveClass added 04.04.01 prk merge with classpath-0.00 release, prepare for update with 0.01, minimize differencies 04.04.01 prk First implementation *) -------------------------------------------------------------------------------- /Reanimator/JAOS/source/jjlVMSecurityManager.Mod: -------------------------------------------------------------------------------- 1 | (* Jaos, Copyright 2003, Patrik Reali, ETH Zurich *) MODULE jjlVMSecurityManager; (*automatically generated stub for java/lang/VMSecurityManager *) (*WARNING: DON'T CHANGE THE PROCEDURE NAMES*) IMPORT SYSTEM, AosModules, PCT, JT := JVMTypes, jjlObject, JC := JVMConsole, JB := JVMBase; CONST Trace = FALSE; TYPE Object = jjlObject.Object; ClassLoader = jjlObject.Object(*jjlClassLoader.ClassLoader*); RefArray = jjlObject.RefArray; VAR debugInfo: JC.LoggingInfo; TYPE VMSecurityManager* = OBJECT (Object) PROCEDURE init(); (* ()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init; END VMSecurityManager; VAR searchedPc: LONGINT; searchedClass: JB.RefClass; PROCEDURE currentClassLoader(): ClassLoader; (* currentClassLoader()Ljava/lang/ClassLoader; *) BEGIN (* put your implementation here *) HALT(99) END currentClassLoader; PROCEDURE SearchForPC(m: PCT.Module); VAR c: JB.Class; base: LONGINT; BEGIN IF m.info # NIL THEN c := m.info(JB.Class); IF c IS JB.RefClass THEN WITH c: JB.RefClass DO base := SYSTEM.ADR(c.ownModule.code[0]); IF (searchedPc >= base) & (searchedPc < base + LEN(c.ownModule.code)) THEN searchedClass := c ELSIF c.stub # NIL THEN base := SYSTEM.ADR(c.stub.code[0]); IF (searchedPc >= base) & (searchedPc < base + LEN(c.stub.code)) THEN searchedClass := c END END END END END END SearchForPC; PROCEDURE getClassContext(): RefArray; (* getClassContext()[Ljava/lang/Class; *) VAR fp, pc, pos, i: LONGINT; stack: ARRAY 128 OF JB.Class; r: RefArray; m: AosModules.Module; BEGIN IF Trace THEN JC.String(debugInfo, "getClassContext:"); JC.Ln(debugInfo) END; SYSTEM.GETREG(SYSTEM.EBP, fp); SYSTEM.GET(fp+4, pc); SYSTEM.GET(fp, fp); WHILE (fp # 0) DO SYSTEM.GET(fp+4, pc); searchedPc := pc; searchedClass := NIL; PCT.Enumerate(JT.DB, SearchForPC); IF searchedClass # NIL THEN IF Trace THEN JC.Char(debugInfo, 9X); JC.String(debugInfo, searchedClass.obmod); JC.Ln(debugInfo) END; stack[pos] := searchedClass; INC(pos) ELSIF Trace THEN m := AosModules.ThisModuleByAdr(pc); IF m # NIL THEN JC.Char(debugInfo, 9X); JC.String(debugInfo, "!"); JC.String(debugInfo, m.name); JC.Ln(debugInfo); ELSE JC.Char(debugInfo, 9X); JC.String(debugInfo, "failed"); JC.Ln(debugInfo); END END; SYSTEM.GET(fp, fp); END; NEW(r); NEW(r.p, pos); FOR i := 0 TO pos-1 DO r.p[i] := stack[i] END; RETURN r END getClassContext; BEGIN debugInfo.kind := JC.Debug; debugInfo.source := JC.VM; END jjlVMSecurityManager. (* 30.07.03 prk Logging functions, add kind and source; filtering support 12.02.03 prk Logging functions, use same interface as AosOut 11.03.02 prk first implementation *) -------------------------------------------------------------------------------- /Reanimator/JAOS/source/jjlVMSystem.Mod: -------------------------------------------------------------------------------- 1 | (* Jaos, Copyright 2003, Patrik Reali, ETH Zurich *) MODULE jjlVMSystem; (*automatically generated stub for java/lang/VMSystem *) (*WARNING: DON'T CHANGE THE PROCEDURE NAMES*) IMPORT JT := JVMTypes, JC := JVMConsole, jjlObject(*, jjuProperties*), AosKernel; TYPE Object = jjlObject.Object; Properties = Object(*jjuProperties.Properties*); InputStream = Object (*InputStream*); PrintStream = Object (*PrintStream*); VAR infoInfo: JC.LoggingInfo; TYPE VMSystem* = OBJECT (Object) VAR PROCEDURE init(); (* ()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init; END VMSystem; PROCEDURE arraycopy(p0: Object; p1: JT.Int; p2: Object; p3: JT.Int; p4: JT.Int); (* arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V *) BEGIN (* put your implementation here *) HALT(99) END arraycopy; PROCEDURE identityHashCode(p0: Object): JT.Int; (* identityHashCode(Ljava/lang/Object;)I *) BEGIN (* put your implementation here *) HALT(99) END identityHashCode; PROCEDURE insertSystemProperties(p0: Properties); (* insertSystemProperties(Ljava/util/Properties;)V *) BEGIN (* put your implementation here *) (* no properties yet*) (* HALT(99) *) END insertSystemProperties; PROCEDURE setIn(p0: InputStream); BEGIN JC.String(infoInfo, "VMSystem.setIn called"); JC.Ln(infoInfo) END setIn; PROCEDURE setOut(p0: PrintStream); BEGIN JC.String(infoInfo, "VMSystem.setOut called"); JC.Ln(infoInfo) END setOut; PROCEDURE setErr(p0: PrintStream); BEGIN JC.String(infoInfo, "VMSystem.setOut called"); JC.Ln(infoInfo) END setErr; PROCEDURE currentTimeMillis*(): JT.Long; (* currentTimeMillis()J *) BEGIN RETURN AosKernel.GetTimer( ); END currentTimeMillis; PROCEDURE isWordsBigEndian(): BOOLEAN; (* isWordsBigEndian()Z *) BEGIN (* put your implementation here *) RETURN FALSE END isWordsBigEndian; PROCEDURE makeStandardInputStream; BEGIN END makeStandardInputStream; PROCEDURE makeStandardOutputStream; BEGIN END makeStandardOutputStream; PROCEDURE makeStandardErrorStream; BEGIN END makeStandardErrorStream; BEGIN infoInfo.kind := JC.Info; infoInfo.source := JC.VM; END jjlVMSystem. (* 30.07.03 prk Logging functions, add kind and source; filtering support 12.02.03 prk Logging functions, use same interface as AosOut 29.12.02 prk update to classpath snapshot 28.12.02 05.06.01 prk System, use classpath 0.02 implementation *) -------------------------------------------------------------------------------- /Reanimator/JAOS/source/jjlVMThrowable.Mod: -------------------------------------------------------------------------------- 1 | MODULE jjlVMThrowable; (*automatically generated stub for java/lang/VMThrowable *) (*WARNING: DON'T CHANGE THE PROCEDURE NAMES*) IMPORT AosOut, SYSTEM, PCDebug, jjlStackTraceElement, jjlString, JT := JVMTypes, jjlObject, jjlThrowable; TYPE Object = jjlObject.Object; Throwable = jjlThrowable.Throwable; RefArray = jjlObject.RefArray; StackTraceElement = jjlStackTraceElement.Class; TYPE Class* = OBJECT (Object) VAR stackTrace: RefArray; PROCEDURE init(); (* ()V *) BEGIN (* DON'T IMPLEMENT THIS METHOD *) END init; PROCEDURE getStackTrace(p0: Throwable): RefArray; (* getStackTrace(Ljava/lang/Throwable;)[Ljava/lang/StackTraceElement; *) CONST mask = {17..31}; VAR ra: RefArray; ste: StackTraceElement; name: ARRAY 64 OF CHAR; pc: ARRAY 32 OF LONGINT; i, count, eip, ebp: LONGINT; base: SET; BEGIN (* DON'T IMPLEMENT THIS METHOD *) (* AosOut.Memory(p0.stackstart, 1024); *) AosOut.String("getStackTrace "); AosOut.Int(count, 5); AosOut.Hex(p0.stackstart, 10); AosOut.Hex(p0.pc, 10); AosOut.Ln; ebp := p0.stackstart; base := SYSTEM.VAL(SET, ebp) * mask; (* stack base *) pc[0] := p0.pc; count := 1; REPEAT AosOut.String("getStackTrace "); AosOut.Int(count, 5); AosOut.Hex(ebp, 10); SYSTEM.GET(ebp+4, eip); (* pop stack frame *) SYSTEM.GET(ebp, ebp); pc[count] := eip; AosOut.Hex(eip, 10); AosOut.Ln; INC(count); UNTIL (count = LEN(pc)) OR (base # SYSTEM.VAL(SET, ebp) * mask); AosOut.String("getStackTrace "); AosOut.Int(count, 5); AosOut.Hex(ebp, 10); AosOut.Ln; NEW(ra); NEW(ra.p, count); FOR i := 0 TO count-1 DO NEW(ste); PCDebug.GetProcedure(pc[i], name); ste.className := jjlString.MakeLiteral1(name); ra.p[i] := ste END; RETURN ra END getStackTrace; END Class; PROCEDURE fillInStackTrace(p0: Throwable): Class; (* fillInStackTrace(Ljava/lang/Throwable;)Ljava/lang/VMThrowable; *) VAR c: Class; BEGIN (* DON'T IMPLEMENT THIS METHOD *) NEW(c); RETURN c END fillInStackTrace; END jjlVMThrowable. (* 09.03.03 prk create exception trace *) -------------------------------------------------------------------------------- /V4L2/V4L2.Tool: -------------------------------------------------------------------------------- 1 | # ======================================== 2 | # V4L2 (Video For Linux 2) interface for UnixAos 3 | # 4 | # 13-04-2013 5 | # 6 | # Official V4L2 API spec is available at: 7 | # http://linuxtv.org/downloads/v4l-dvb-apis/ 8 | # ======================================== 9 | 10 | # Compile modules: 11 | 12 | Compiler.Compile 13 | V4L2/Unix.V4L2.Mod 14 | V4L2/Unix.libv4l2.Mod 15 | V4L2/Unix.VideoExample.Mod 16 | ~ 17 | 18 | # run demo example: 19 | 20 | VideoExample.Start ~ #start capturing on /dev/video0 21 | VideoExample.OpenPreview ~ # open preview window 22 | VideoExample.OpenControlWin ~ # open camera control gui 23 | VideoExample.ResetAllControls ~ 24 | VideoExample.Stop ~ # stop capturing 25 | 26 | # free modules: 27 | 28 | System.Free VideoExample libv4l2 V4L2 ~ 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Work/Bindings/BASS/BASS.Text: -------------------------------------------------------------------------------- 1 | BASS 2.4.12 A2 OS (WinAos, UnixAos) Wrapper 2 | 3 | Windows 4 | 5 | x86: 6 | Compiler.Compile -b=AMD I386.BASScpu.Mod Win32.BASS.Mod ~ 7 | x64: 8 | Compiler.Compile -b=AMD --bits=64 AMD64.BASScpu.Mod Win32.BASS.Mod ~ 9 | 10 | Linux 11 | 12 | x86: 13 | Compiler.Compile -b=AMD I386.BASScpu.Mod Linux.BASS.Mod ~ 14 | x64: 15 | Compiler.Compile -b=AMD --bits=64 AMD64.BASScpu.Mod Linux.BASS.Mod ~ 16 | 17 | Darwin 18 | 19 | x86: 20 | Compiler.Compile -b=AMD I386.BASScpu.Mod Darwin.BASS.Mod ~ 21 | x64: 22 | Compiler.Compile -b=AMD --bits=64 AMD64.BASScpu.Mod Darwin.BASS.Mod ~ 23 | 24 | Demos 25 | 26 | x86: 27 | Compiler.Compile -b=AMD 28 | MathUtils.Mod Containers.Mod AAGraphics.Mod 29 | WMDropDownLists.Mod WMBass3DTest.Mod ~ 30 | x64: 31 | Compiler.Compile -b=AMD --bits=64 32 | MathUtils.Mod Containers.Mod AAGraphics.Mod 33 | WMDropDownLists.Mod WMBass3DTest.Mod ~ 34 | 35 | WMBass3DTest.Open ~ 36 | 37 | SystemTools.Free WMBass3DTest WMDropDownLists MathUtils 38 | Containers AAGraphics BASS BASScpu ~ 39 | 40 | Installation in Darwin: 41 | 42 | 1. Copy BASS folder, for example, to desktop 43 | 2. Start shell, get admin rights 44 | sudo -s 45 | 3. Copy libbass.dylib into /usr/lib 46 | cp Desktop/BASS/libbass.dylib /usr/lib/libbass.dylib 47 | 4. Check rights 48 | cd /usr/lib 49 | ls -l libbass.dylib 50 | change if needed 51 | chmod 777 libbass.dylib 52 | 4. Go to working directory and run Aos 53 | cd /Users/User/Desktop/BASS 54 | aos 55 | -------------------------------------------------------------------------------- /Work/BuildAll.Tool: -------------------------------------------------------------------------------- 1 | Before compilation add root "Work" and "Work/Resources" 2 | folders to Paths.Search parameter (in listed sequence) in aosg.ini (or better 3 | do a copy named "myaos.ini" and make changes in it) 4 | 5 | To enable a dark color scheme in PET add "Branch" folder to Paths.Search parameter 6 | and add this to Configuration.XML: 7 | 8 |
9 |
10 |
11 | 12 | 13 | *** A2 sources improvements and small modifications ("Branch") *** 14 | 15 | Compiler.Compile -p=Win32 16 | 17 | Branch/WMTextView.Mod 18 | Branch/PETTrees.Mod 19 | Branch/PET.Mod ~ 20 | 21 | *** Bindings *** 22 | 23 | Compiler.Compile -p=Win32 24 | 25 | Bindings/BASS/Windows.BASS.Mod 26 | Bindings/Windows.Pipe.Mod 27 | Bindings/Windows.UnRAR.Mod ~ 28 | 29 | Compiler.Compile -p=Unix32 30 | Bindings/BASS/Unix.BASS.Mod ~ 31 | 32 | *** Libraries *** 33 | 34 | Compiler.Compile -p=Win32 35 | 36 | Libs/AAGraphics.Mod 37 | Libs/CanvasTools.Mod 38 | 39 | Libs/MathUtils.Mod 40 | Libs/Windows.PreciseTimer.Mod 41 | 42 | (* deprecated *) 43 | Libs/Containers.Mod 44 | 45 | Libs/Generics.Mod ~ 46 | 47 | *** Components *** 48 | 49 | Compiler.Compile -p=Win32 50 | 51 | Components/WMChart.Mod 52 | Components/WMComboBox.Mod 53 | Components/WMLCD.Mod 54 | Components/WMLEDLadder.Mod ~ 55 | 56 | *** Dialogs *** 57 | 58 | Compiler.Compile -p=Win32 59 | 60 | Dialogs/WMColorPicker.Mod ~ 61 | 62 | *** Examples *** 63 | 64 | Compiler.Compile -p=Win32 65 | 66 | Examples/RegExp/RegExpNFA.Mod 67 | Examples/RegExp/RegExpMaps.Mod 68 | Examples/RegExp/RegExpDFA.Mod 69 | Examples/RegExp/RegExpSubsetConstruct.Mod 70 | Examples/RegExp/RegExpParse.Mod 71 | 72 | Examples/WMAAGraphicsExample.Mod ~ 73 | 74 | *** Tools *** 75 | 76 | Compiler.Compile -p=Win32 77 | 78 | Tools/ImportCollector.Mod 79 | Tools/ImportGraph.Mod 80 | Tools/PascalScanner.Mod 81 | Tools/PascalProjectCombine.Mod 82 | Tools/Windows.WinStarter.Mod ~ 83 | 84 | *** Demos *** 85 | 86 | Compiler.Compile -p=Win32 87 | 88 | Demos/WMAStar.Mod 89 | Demos/WMAStarSet.Mod 90 | 91 | Demos/VisualContainer/VCTypes.Mod 92 | Demos/VisualContainer/VCPoly.Mod 93 | Demos/VisualContainer/VCBase.Mod 94 | Demos/VisualContainer/VCObjects.Mod 95 | Demos/VisualContainer/WMVC.Mod 96 | 97 | Demos/WMFM.Mod 98 | Demos/WMRaycaster.Mod 99 | Demos/WMRaycasterMaze.Mod 100 | Demos/WMColorLines.Mod 101 | Demos/WMXmas.Mod 102 | Demos/WMBass3DTest.Mod 103 | Demos/WMBassDSPTest.Mod 104 | ~ 105 | 106 | Run demos 107 | 108 | WMAStar.Open ~ 109 | WMAStarSet.Open ~ 110 | WMBass3DTest.Open ~ 111 | WMBassDSPTest.Open ~ 112 | WMColorLines.Open ~ 113 | WMRaycaster.Open ~ 114 | WMRaycasterMaze.Open ~ 115 | WMXmas.Open ~ 116 | 117 | 118 | -------------------------------------------------------------------------------- /Work/Debugger/DebuggerBase.Mod: -------------------------------------------------------------------------------- 1 | (** AUTHOR "BohdanT"; PURPOSE "Debugger base"; **) 2 | MODULE DebuggerBase; 3 | IMPORT (*SYSTEM, Kernel32, Objects, Modules,*) KernelLog; 4 | CONST 5 | Trace = FALSE; 6 | TYPE 7 | BrkPnt* = POINTER TO RECORD 8 | c*:CHAR; (*save char here*) 9 | adr*:LONGINT; 10 | pos*:LONGINT; 11 | active*:BOOLEAN; 12 | next*:BrkPnt; 13 | END; 14 | 15 | 16 | TYPE 17 | 18 | BPList* = OBJECT 19 | VAR 20 | list*, 21 | tmp*:BrkPnt; 22 | active*:BOOLEAN; 23 | PROCEDURE &Init*; 24 | BEGIN 25 | active:=TRUE; 26 | END Init; 27 | 28 | PROCEDURE AddBP*(adr:ADDRESS); 29 | VAR 30 | p,next,last:BrkPnt; 31 | BEGIN 32 | next:=list; 33 | 34 | NEW(p); 35 | p.adr:=adr; 36 | IF next#NIL THEN 37 | WHILE (next#NIL)&(next.adr0) & (refs[0]=0FFX); 56 | END NewObjectFile; 57 | 58 | 59 | (* Debbuger exception handler. *) 60 | PROCEDURE Exception( VAR int: Kernel32.Context; VAR exc: Kernel32.ExceptionRecord; VAR handled: BOOLEAN ); 61 | BEGIN (* interrupts off *) 62 | handled := FALSE; 63 | IF Trace THEN KernelLog.String("Debug exception handler! "); KernelLog.Ln; END; 64 | IF debughandler#NIL THEN 65 | debughandler(int,exc,handled); 66 | IF Trace THEN KernelLog.String("user complit! "); KernelLog.Ln; END; 67 | END; 68 | IF (~handled)&(exceptionhandler#NIL) THEN 69 | IF Trace THEN KernelLog.String("do system! "); KernelLog.Ln; END; 70 | exceptionhandler(int,exc,handled); 71 | END; 72 | FINALLY 73 | (* if trap occurs in this procedure, then go on working right here *) 74 | (* KernelLog.String("Houston, we have a problem!"); KernelLog.Ln; *) 75 | END Exception; 76 | 77 | PROCEDURE Install*; 78 | VAR 79 | adr:ADDRESS; 80 | BEGIN 81 | HALT(18); 82 | (*! TODO GetProcedure('Traps', 'Exception',adr);*) 83 | exceptionhandler:=SYSTEM.VAL(Objects.ExceptionHandler,adr); 84 | Objects.InstallExceptionHandler( Exception ); 85 | END Install; 86 | 87 | (** *) 88 | PROCEDURE InstallDbgHandler*(hndlr:DebugHandler); 89 | BEGIN 90 | debughandler:=hndlr; 91 | Install(); 92 | END InstallDbgHandler; 93 | 94 | PROCEDURE RemoveDbgHandler*(); 95 | BEGIN 96 | debughandler:=NIL; 97 | END RemoveDbgHandler; 98 | 99 | (** Termination handler. Removes the window from the display space when the module is unloaded. *) 100 | PROCEDURE Cleanup; (* K *) 101 | BEGIN 102 | IF exceptionhandler#NIL THEN 103 | Objects.InstallExceptionHandler( exceptionhandler ); 104 | KernelLog.String( "Traps: TrapHandler Restored!" ); KernelLog.Ln; 105 | ELSE 106 | KernelLog.String( "Not need to restore traps handler !" ); KernelLog.Ln; 107 | END; 108 | END Cleanup; 109 | 110 | BEGIN 111 | Modules.InstallTermHandler(Cleanup); 112 | NEW(brkPnt); 113 | END Debugger. 114 | 115 | 116 | DebuggerBase.Install~ 117 | SystemTools.Free DebuggerBase ~ -------------------------------------------------------------------------------- /Work/Debugger/debugger.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Work/Debugger/debugger.doc -------------------------------------------------------------------------------- /Work/DelBak.bat: -------------------------------------------------------------------------------- 1 | @del /S *.Bak -------------------------------------------------------------------------------- /Work/Demos/Test.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Work/Demos/Test.Mod -------------------------------------------------------------------------------- /Work/Demos/VisualContainer/VCTypes.Mod: -------------------------------------------------------------------------------- 1 | MODULE VCTypes; (** AUTHOR ""; PURPOSE ""; *) 2 | 3 | IMPORT 4 | WMGraphics; 5 | 6 | TYPE 7 | Point2i* = WMGraphics.Point2d; 8 | PPoints2i* = POINTER TO ARRAY OF Point2i; 9 | 10 | Point2f* = RECORD 11 | x*, y*: REAL 12 | END; 13 | PPoints2f* = POINTER TO ARRAY OF Point2f; 14 | 15 | Triangle2f* = ARRAY 3 OF Point2f; 16 | PTriangles2f* = POINTER TO ARRAY OF Triangle2f; 17 | 18 | END VCTypes. 19 | -------------------------------------------------------------------------------- /Work/Demos/WMFM.Mod: -------------------------------------------------------------------------------- 1 | MODULE WMFM; 2 | 3 | IMPORT 4 | Commands, WMWindowManager, WMFileManager; 5 | 6 | PROCEDURE WindowGenerator*(ctx: Commands.Context): WMWindowManager.Window; 7 | VAR 8 | fm: WMFileManager.Window; 9 | BEGIN 10 | NEW(fm, NIL); 11 | RETURN fm; 12 | END WindowGenerator; 13 | 14 | END WMFM. 15 | -------------------------------------------------------------------------------- /Work/Examples/NanoA2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Work/Examples/NanoA2.zip -------------------------------------------------------------------------------- /Work/Examples/RegExp/RegExpDFA.Mod: -------------------------------------------------------------------------------- 1 | MODULE RegExpDFA; (** AUTHOR "Yaroslav Romanchenko (SAGE)"; PURPOSE "Deterministic Finite Automaton (DFA) class"; *) 2 | 3 | (* 4 | // This code is in the public domain - feel free to do anything you 5 | // wish with it. 6 | // 7 | // Eli Bendersky (spur4444@yahoo.com) 8 | // 9 | *) 10 | 11 | IMPORT 12 | Commands, 13 | 14 | Generics, 15 | 16 | RegExpMaps; 17 | 18 | TYPE 19 | 20 | DFA* = OBJECT 21 | VAR 22 | (** transition map, list of final states and the start state *) 23 | mapTransition-: RegExpMaps.TransitionMap; 24 | iInitial*, nStates*: LONGINT; 25 | lstFinal-: Generics.LongintVector; 26 | 27 | PROCEDURE &New*; 28 | BEGIN 29 | NEW(mapTransition); 30 | NEW(lstFinal, {}) 31 | END New; 32 | 33 | PROCEDURE Show*(context: Commands.Context); 34 | VAR 35 | i: LONGINT; 36 | itemTransitionMap: RegExpMaps.TransitionMapItem; 37 | BEGIN 38 | context.out.Ln; 39 | context.out.String("DFA start state: "); 40 | context.out.Int(iInitial, 0); 41 | context.out.Ln; 42 | context.out.String("DFA states: "); 43 | context.out.Int(nStates, 0); 44 | context.out.Ln; 45 | context.out.String("DFA final state(s): "); 46 | FOR i := 0 TO lstFinal.Count() - 1 DO 47 | context.out.Int(lstFinal.Get(i), 0); 48 | context.out.Char(' ') 49 | END; 50 | context.out.Ln; 51 | mapTransition.Iterator().Reset; 52 | WHILE mapTransition.Iterator().GetNext(itemTransitionMap) DO 53 | context.out.String("Trans["); 54 | context.out.Int(itemTransitionMap.trans.iState, 0); 55 | context.out.String(", '"); 56 | context.out.Char(CHR(itemTransitionMap.trans.iData)); 57 | context.out.String("'] = "); 58 | context.out.Int(itemTransitionMap.iState, 0); 59 | context.out.Ln 60 | END 61 | END Show; 62 | 63 | PROCEDURE Simulate*(aInput: ARRAY OF CHAR; iInput: LONGINT; VAR iNext: LONGINT): BOOLEAN; 64 | VAR 65 | iCurState: LONGINT; 66 | bLoop: BOOLEAN; 67 | trans: RegExpMaps.Transition; 68 | BEGIN 69 | iCurState := iInitial; 70 | bLoop := TRUE; 71 | WHILE (iInput < LEN(aInput)) & (aInput[iInput] # 0X) & bLoop DO 72 | trans := RegExpMaps.NewTransition(iCurState, ORD(aInput[iInput])); 73 | IF mapTransition.Contains(trans) THEN 74 | iCurState := mapTransition.Get(trans).iState; 75 | bLoop := lstFinal.IndexOf(iCurState) = -1; 76 | INC(iInput) 77 | ELSE 78 | bLoop := FALSE 79 | END 80 | END; 81 | iNext := iInput; 82 | RETURN lstFinal.IndexOf(iCurState) # -1 83 | END Simulate; 84 | 85 | END DFA; 86 | 87 | END RegExpDFA. 88 | -------------------------------------------------------------------------------- /Work/Examples/WMAAGraphicsExample.Mod: -------------------------------------------------------------------------------- 1 | MODULE WMAAGraphicsExample; 2 | 3 | IMPORT 4 | Commands, Kernel, Raster, Random, Objects, WMRectangles, WMGraphics, Modules, Strings, 5 | WM := WMWindowManager, WMMessages, AAGraphics; 6 | 7 | TYPE 8 | 9 | KillerMsg = OBJECT 10 | END KillerMsg; 11 | 12 | WND* = OBJECT(WM.BufferWindow) 13 | VAR 14 | timer: Kernel.Timer; 15 | random : Random.Generator; 16 | alive, dead, alpha : BOOLEAN; 17 | 18 | PROCEDURE &New*(alpha : BOOLEAN); 19 | BEGIN 20 | Init(800, 600, alpha); 21 | SELF.alpha := alpha; 22 | manager := WM.GetDefaultManager(); 23 | manager.Add(100, 100, SELF, {WM.FlagFrame, WM.FlagClose, WM.FlagMinimize, WM.FlagNoResizing}); 24 | 25 | SetTitle(Strings.NewString("AAGraphics example")); 26 | 27 | NEW(timer); 28 | NEW(random); 29 | 30 | IncCount; 31 | END New; 32 | 33 | PROCEDURE Handle(VAR m: WMMessages.Message); 34 | BEGIN 35 | IF (m.msgType = WMMessages.MsgExt) & (m.ext # NIL) & (m.ext IS KillerMsg) THEN 36 | Close; 37 | ELSE Handle^(m) 38 | END 39 | END Handle; 40 | 41 | PROCEDURE Draw*(canvas : WMGraphics.Canvas; w, h, q : LONGINT); 42 | BEGIN 43 | Draw^(canvas, w, h, 0) 44 | END Draw; 45 | 46 | PROCEDURE Close; 47 | BEGIN 48 | alive := FALSE; 49 | timer.Wakeup; 50 | BEGIN {EXCLUSIVE} AWAIT(dead); END; 51 | Close^; 52 | DecCount; 53 | END Close; 54 | 55 | PROCEDURE DrawIt; 56 | VAR i, x, y, r, cl1, cl2: LONGINT; 57 | pix : Raster.Pixel; 58 | mode : Raster.Mode; 59 | 60 | BEGIN 61 | 62 | Raster.InitMode(mode, Raster.srcOverDst); 63 | 64 | Raster.SetRGB(pix, 0AAH, 0AAH, 0AAH); 65 | 66 | Raster.Fill(img, 0, 0, GetWidth(), GetHeight(), pix, mode); 67 | FOR i := 0 TO 499 DO 68 | cl1 := WMGraphics.RGBAToColor(random.Dice(256), random.Dice(256), random.Dice(256), 255); 69 | cl2 := WMGraphics.RGBAToColor(random.Dice(256), random.Dice(256), random.Dice(256), 255); 70 | x := 40 + random.Dice(GetWidth() - 80); 71 | y := 40 + random.Dice(GetHeight() - 80); 72 | r := 5 + random.Dice(25); 73 | 74 | AAGraphics.DiskGrad(img, x, y, r + 3, cl1, cl1); 75 | AAGraphics.DiskGrad(img, x, y, r, cl2, cl2); 76 | 77 | (* 78 | AAGraphics.AADisk(img, x, y, r + 3, cl1); 79 | AAGraphics.AADisk(img, x, y, r, cl2); 80 | *) 81 | 82 | END; 83 | Invalidate(WMRectangles.MakeRect(0, 0, GetWidth(), GetHeight())); 84 | 85 | END DrawIt; 86 | 87 | BEGIN {ACTIVE} 88 | alive := TRUE; 89 | Objects.SetPriority(Objects.Low); 90 | WHILE alive DO 91 | DrawIt; 92 | timer.Sleep(25); 93 | END; 94 | BEGIN {EXCLUSIVE} dead := TRUE END; 95 | END WND; 96 | 97 | VAR 98 | nofWindows: LONGINT; 99 | 100 | PROCEDURE WindowGenerator*(ctx: Commands.Context): WM.Window; 101 | VAR 102 | window: WND; 103 | BEGIN 104 | NEW(window, FALSE); 105 | RETURN window 106 | END WindowGenerator; 107 | 108 | PROCEDURE Open*(ctx: Commands.Context); 109 | VAR 110 | wDummy: WM.Window; 111 | BEGIN 112 | wDummy := WindowGenerator(ctx) 113 | END Open; 114 | 115 | PROCEDURE IncCount; 116 | BEGIN {EXCLUSIVE} 117 | INC(nofWindows); 118 | END IncCount; 119 | 120 | PROCEDURE DecCount; 121 | BEGIN {EXCLUSIVE} 122 | DEC(nofWindows); 123 | END DecCount; 124 | 125 | PROCEDURE Cleanup; 126 | VAR die : KillerMsg; 127 | msg : WMMessages.Message; 128 | m : WM.WindowManager; 129 | BEGIN {EXCLUSIVE} 130 | NEW(die); msg.ext := die; msg.msgType := WMMessages.MsgExt; 131 | m := WM.GetDefaultManager(); 132 | m.Broadcast(msg); 133 | AWAIT(nofWindows = 0); 134 | END Cleanup; 135 | 136 | BEGIN 137 | Modules.InstallTermHandler(Cleanup); 138 | END WMAAGraphicsExample. 139 | 140 | System.Free WMAAGraphicsExample ~ 141 | WMAAGraphicsExample.Open ~ 142 | -------------------------------------------------------------------------------- /Work/Libs/CanvasTools.Mod: -------------------------------------------------------------------------------- 1 | MODULE CanvasTools; (** AUTHOR "BohdanT"; PURPOSE "Canvas extension tools"; *) IMPORT WMGraphics, WMRectangles, Raster,BIT; CONST sc = (*sincos table for draw circle*) [[1.00000000,0.00000000], [0.99518473,0.09801714], [0.98078528,0.19509033], [0.95694034,0.29028468], [0.92387953,0.38268344], [0.88192125,0.47139676], [0.83146961,0.55557023], [0.77301043,0.63439332]]; PROCEDURE CreatePen*(size,color:LONGINT;VAR image: Raster.Image); VAR i : LONGINT; p : ARRAY 64 OF WMGraphics.Point2d; r,x,y:REAL; c:WMGraphics.BufferCanvas; BEGIN NEW(image); Raster.Create(image, size, size, Raster.BGRA8888); NEW(c,image); c.Fill(WMRectangles.MakeRect(0, 0, size, size),0,WMGraphics.ModeCopy); r:=size / 2; FOR i := 0 TO 8-1 DO x := r *sc[i,0]; y := r * sc[i,1]; p[i].x := ENTIER(r + x+0.5); p[i].y := ENTIER(r + y+0.5); p[15-i].x := ENTIER(r +y+0.5 ); p[15-i].y := ENTIER(r +x+0.5 ); p[16+i].x := ENTIER(r -y+0.5 ); p[16+i].y := ENTIER(r +x+0.5 ); p[31-i].x := ENTIER(r - x+0.5); p[31-i].y := ENTIER(r +y +0.5); (**************) p[32+i].x := ENTIER(r - x+0.5); p[32+i].y := ENTIER(r - y+0.5); p[47-i].x := ENTIER(r -y+0.5) ; p[47-i].y := ENTIER(r - x+0.5); p[i+48].x := ENTIER(r +y+0.5) ; p[i+48].y := ENTIER(r -x+0.5) ; p[63-i].x := ENTIER(r +x+0.5) ; p[63-i].y := ENTIER(r -y+0.5 ); END; c.FillPolygonFlat(p, 64, color, WMGraphics.ModeCopy); END CreatePen; (** draw a line within the current clipping rectangle *) (** Override for improved speed *) PROCEDURE Line*(CONST c: WMGraphics.Canvas;x0, y0, x1, y1 : LONGINT; image: Raster.Image;VAR style:LONGINT;mode : LONGINT); VAR t, xi, mi, xf, mf, dt2 : LONGINT; dw:LONGINT; BEGIN IF image=NIL THEN RETURN; END; dw:=image.width DIV 2; IF y0 = y1 THEN (* horizontal case *) IF x0 > x1 THEN t := x0; x0 := x1; x1 := t END; FOR xi:=x0 TO x1 DO style:=BIT.LROT(style,1); IF BIT.LAND(style,1) =1 THEN c.DrawImage(xi-dw, y0-dw, image, mode); END; END; ELSIF x0 = x1 THEN (* vertical case *) IF y0 > y1 THEN t := y0; y0 := y1; y1 := t END; FOR xi:=y0 TO y1 DO style:=BIT.LROT(style,1); IF BIT.LAND(style,1) =1 THEN c.DrawImage(x0-dw, xi-dw, image, mode); END; END; ELSE (* general case *) IF ABS(y1 - y0) > ABS(x1 - x0) THEN IF y0 > y1 THEN t := y0; y0 := y1; y1 := t; t := x0; x0 := x1; x1 := t END; xi := x0; xf := y0 - y1; mi := (x1 - x0) DIV (y1 - y0); mf := 2 * ( (x1 - x0) MOD (y1 - y0)); dt2 := 2 * (y1 - y0); FOR t := y0 TO y1 DO style:=BIT.LROT(style,1); IF BIT.LAND(style,1) =1 THEN c.DrawImage(xi-dw, t-dw, image, mode); END; INC(xi, mi); INC(xf, mf); IF xf > 0 THEN INC(xi); DEC(xf, dt2) END END ELSE IF x0 > x1 THEN t := y0; y0 := y1; y1 := t; t := x0; x0 := x1; x1 := t END; xi := y0; xf := x0 - x1; mi := (y1 - y0) DIV (x1 - x0); mf := 2 * ( (y1 - y0) MOD (x1 - x0)); dt2 := 2 * (x1 - x0); FOR t := x0 TO x1 DO style:=BIT.LROT(style,1); IF BIT.LAND(style,1) =1 THEN c.DrawImage(t-dw, xi-dw, image, mode); END; INC(xi, mi); INC(xf, mf); IF xf > 0 THEN INC(xi); DEC(xf, dt2) END END END END END Line; END CanvasTools. (*Example of use: canvas.SetFont(WMGraphics.GetFont("Oberon", 20, {WMGraphics.FontBold})); canvas.DrawString(bild.width DIV 2 - 40, bild.height DIV 2 + 5 , "The End"); CreatePen(880,WMGraphics.Red,image); Line(canvas,440,440,441,441,image,SHORT(0CCCCCCCCH),WMGraphics.ModeSrcOverDst); CreatePen(20,WMGraphics.Red,image); Line(canvas,10,10,301,301,image,SHORT(0CCCCCCCCH),WMGraphics.ModeSrcOverDst); CreatePen(1,WMGraphics.Green,image); Line(canvas,30,310,301,31,image,SHORT(0CCCCCCCCH),WMGraphics.ModeSrcOverDst); *) -------------------------------------------------------------------------------- /Work/Libs/MathUtils.Mod: -------------------------------------------------------------------------------- 1 | MODULE MathUtils; (** AUTHOR "SAGE"; PURPOSE "Some usefull math functions"; *) 2 | 3 | IMPORT 4 | Math; 5 | 6 | PROCEDURE floor*(x: REAL): LONGINT; 7 | BEGIN 8 | RETURN ENTIER(x) 9 | END floor; 10 | 11 | PROCEDURE ceil*(x: REAL): LONGINT; 12 | BEGIN 13 | RETURN -ENTIER(-x) 14 | END ceil; 15 | 16 | PROCEDURE round*(x: REAL): LONGINT; 17 | BEGIN 18 | RETURN ENTIER(x + 0.5) 19 | END round; 20 | 21 | PROCEDURE trunc*(x: REAL): LONGINT; 22 | BEGIN 23 | IF x >= 0.0 THEN 24 | RETURN ENTIER(x) 25 | ELSE 26 | RETURN -ENTIER(-x) 27 | END 28 | END trunc; 29 | 30 | PROCEDURE frac*(x: REAL): REAL; 31 | BEGIN 32 | IF x > 0.0 THEN 33 | RETURN x - ENTIER(x) 34 | ELSE 35 | RETURN x + ENTIER(-x) 36 | END 37 | END frac; 38 | 39 | PROCEDURE power*(base, exponent: REAL): REAL; 40 | BEGIN 41 | IF exponent = 0.0 THEN 42 | RETURN 1.0 43 | ELSIF (base = 0.0) & (exponent > 0.0) THEN 44 | RETURN 0.0 45 | ELSE 46 | RETURN Math.exp(exponent * Math.ln(base)) 47 | END 48 | END power; 49 | 50 | END MathUtils. 51 | 52 | -------------------------------------------------------------------------------- /Work/Libs/PreciseTimer.Mod: -------------------------------------------------------------------------------- 1 | MODULE PreciseTimer; (** AUTHOR "Yaroslav Romanchenko (SAGE)"; PURPOSE "Precise timer"; *) 2 | 3 | IMPORT 4 | Kernel, Machine, Heaps; 5 | 6 | VAR 7 | nFrequency : HUGEINT; 8 | Ready : BOOLEAN; 9 | 10 | PROCEDURE EstimateCpuClockrate(VAR clockrate : HUGEINT) : BOOLEAN; 11 | VAR 12 | timer : Kernel.Timer; milliTimer : Kernel.MilliTimer; 13 | startTime, endTime : HUGEINT; 14 | nbrOfGcRuns : LONGINT; 15 | BEGIN 16 | NEW(timer); nbrOfGcRuns := Heaps.Ngc; 17 | Kernel.SetTimer(milliTimer, 1000); 18 | startTime := Machine.GetTimer(); 19 | WHILE ~Kernel.Expired(milliTimer) DO 20 | timer.Sleep(1); 21 | IF nbrOfGcRuns # Heaps.Ngc THEN RETURN FALSE; END; 22 | END; 23 | endTime := Machine.GetTimer(); 24 | IF nbrOfGcRuns # Heaps.Ngc THEN RETURN FALSE; END; 25 | clockrate := endTime - startTime; 26 | RETURN TRUE; 27 | END EstimateCpuClockrate; 28 | 29 | PROCEDURE EsimateFrequency; 30 | CONST 31 | tries = 10; 32 | VAR 33 | clockrate : HUGEINT; 34 | try : LONGINT; 35 | BEGIN 36 | try := 1; Ready := FALSE; nFrequency := -1; 37 | WHILE ~Ready & (try <= tries) DO 38 | Ready := EstimateCpuClockrate(clockrate); 39 | INC(try) 40 | END; 41 | nFrequency := clockrate 42 | END EsimateFrequency; 43 | 44 | PROCEDURE GetTicks*(): HUGEINT; 45 | BEGIN 46 | IF Ready THEN 47 | RETURN Machine.GetTimer() 48 | ELSE 49 | RETURN Kernel.GetTicks() 50 | END 51 | END GetTicks; 52 | 53 | PROCEDURE GetTime*(nTicks: HUGEINT): REAL; 54 | BEGIN 55 | IF Ready THEN 56 | RETURN nTicks / nFrequency 57 | ELSE 58 | RETURN nTicks / Kernel.Second 59 | END 60 | END GetTime; 61 | 62 | BEGIN 63 | EsimateFrequency 64 | END PreciseTimer. 65 | 66 | SystemTools.Free PreciseTimer ~ 67 | PreciseTimer.Test ~ -------------------------------------------------------------------------------- /Work/Libs/WinDll/SQLite3Test.Mod: -------------------------------------------------------------------------------- 1 | MODULE SQLite3Test; 2 | 3 | IMPORT 4 | Kernel32, SQLite3, KernelLog; 5 | 6 | PROCEDURE Test*; 7 | VAR 8 | database: SQLite3.Database; 9 | lpString: Kernel32.LPSTR; 10 | str: ARRAY 1024 OF CHAR; 11 | BEGIN 12 | IF SQLite3.LibraryLoaded THEN 13 | SQLite3.open("base.db3", database); 14 | SQLite3.exec(database, "CREATE TABLE TABLE1 (ID INTEGER PRIMARY KEY, F1 INTEGER, F2 INTEGER, F3 INTEGER, F4 INTEGER);", NIL, Kernel32.NULL, lpString); 15 | Kernel32.CopyString(lpString, str); 16 | KernelLog.String(str); KernelLog.Ln; 17 | SQLite3.close(database) 18 | END 19 | END Test; 20 | 21 | END SQLite3Test. 22 | 23 | S.Free SQLite3Test SQLite3~ 24 | SQLite3Test.Test~ -------------------------------------------------------------------------------- /Work/Libs/WinDll/TestDll.Mod: -------------------------------------------------------------------------------- 1 | MODULE TestDll; (** AUTHOR ""; PURPOSE ""; *) 2 | IMPORT SYSTEM,DLL,KernelLog,Strings; 3 | VAR 4 | lib:DLL.TLibInfo; 5 | proc1: PROCEDURE{WINAPI}(a,b:LONGINT); 6 | proc2 : PROCEDURE{WINAPI}(); 7 | PROCEDURE {WINAPI}Int*(a,b:LONGINT); 8 | BEGIN 9 | KernelLog.String("LogInt=");KernelLog.Int(a,b);KernelLog.Ln(); 10 | END Int; 11 | PROCEDURE {WINAPI}String(CONST s:ARRAY OF CHAR); 12 | VAR 13 | i:LONGINT; 14 | BEGIN 15 | (* KernelLog.Memory(SYSTEM.ADR(s),32);*) 16 | i:=0; 17 | WHILE s[i]#0X DO 18 | KernelLog.Char(s[i]);INC(i) 19 | END; 20 | END String; 21 | PROCEDURE TestLoad*; 22 | BEGIN 23 | lib:=DLL.LoadLibrary("Testa2.dll"); 24 | IF lib#NIL THEN 25 | DLL.GetProcAddress(lib,"helloword1", SYSTEM.VAL(LONGINT,proc1)); 26 | DLL.GetProcAddress(lib,"helloword2", SYSTEM.VAL(LONGINT,proc2)); 27 | IF proc1#NIL THEN 28 | proc1(5,6); 29 | ELSE 30 | KernelLog.String("=helloword1=NIL= ");KernelLog.Ln; 31 | END; 32 | IF proc2#NIL THEN 33 | proc2(); 34 | ELSE 35 | KernelLog.String("=helloword2=NIL= ");KernelLog.Ln; 36 | END; 37 | END; 38 | END TestLoad; 39 | END TestDll.TestLoad~ 40 | -------------------------------------------------------------------------------- /Work/Libs/WinDll/testa2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Work/Libs/WinDll/testa2.dll -------------------------------------------------------------------------------- /Work/Libs/WinDll/testa2.dpr: -------------------------------------------------------------------------------- 1 | library testa2; 2 | 3 | 4 | procedure KernelLogInt(a,b:LONGINT); stdcall; external 'TestDll' name 'Int'; 5 | procedure KernelLogStr(s:PChar); stdcall;external 'TestDll' name 'String'; 6 | 7 | procedure helloword1(a,b:LONGINT);stdcall; 8 | BEGIN 9 | KernelLogInt(a,b); 10 | end; 11 | procedure helloword2;stdcall; 12 | var 13 | s:ARRAY[0..100] OF CHAR; 14 | BEGIN 15 | s:='Hi from delphi!'; 16 | KernelLogStr(@s); 17 | end; 18 | 19 | exports 20 | helloword1 name 'helloword1', 21 | helloword2 name 'helloword2'; 22 | 23 | 24 | end. 25 | -------------------------------------------------------------------------------- /Work/Libs/Windows.PreciseTimer.Mod: -------------------------------------------------------------------------------- 1 | MODULE PreciseTimer; (** AUTHOR "Yaroslav Romanchenko (SAGE)"; PURPOSE "Precise timer"; *) 2 | 3 | IMPORT 4 | SYSTEM, Kernel32, Kernel; 5 | 6 | VAR 7 | nFrequency : HUGEINT; 8 | Ready : BOOLEAN; 9 | 10 | PROCEDURE EsimateFrequency; 11 | VAR 12 | res : Kernel32.BOOL; 13 | BEGIN 14 | res := Kernel32.QueryPerformanceFrequency(SYSTEM.VAL(Kernel32.LargeInteger, nFrequency)); 15 | Ready := res > 0 16 | END EsimateFrequency; 17 | 18 | PROCEDURE GetTicks*(): HUGEINT; 19 | VAR 20 | nTicks : HUGEINT; 21 | res : Kernel32.BOOL; 22 | BEGIN 23 | IF Ready THEN 24 | res := Kernel32.QueryPerformanceCounter(SYSTEM.VAL(Kernel32.LargeInteger, nTicks)); 25 | RETURN nTicks 26 | ELSE 27 | RETURN Kernel.GetTicks() 28 | END 29 | END GetTicks; 30 | 31 | PROCEDURE GetTime*(nTicks: HUGEINT): REAL; 32 | BEGIN 33 | IF Ready THEN 34 | RETURN nTicks / nFrequency 35 | ELSE 36 | RETURN nTicks / Kernel.Second 37 | END 38 | END GetTime; 39 | 40 | BEGIN 41 | EsimateFrequency 42 | END PreciseTimer. 43 | 44 | SystemTools.Free PreciseTimer ~ 45 | PreciseTimer.Test ~ -------------------------------------------------------------------------------- /Work/Projects/Raytracer/AA2DGraphicsTest.Mod: -------------------------------------------------------------------------------- 1 | MODULE AA2DGraphicsTest; (** AUTHOR "SAGE"; PURPOSE "Anti-Aliased 2D Graphics test module"; *) 2 | 3 | (** History: 4 | 5 | 2009-02-01: First release (SAGE) 6 | 7 | *) 8 | 9 | IMPORT 10 | AA2DGraphics, WMGraphics, Commands; 11 | 12 | VAR 13 | context: Commands.Context; 14 | 15 | PROCEDURE Test*(con: Commands.Context); 16 | VAR 17 | image: WMGraphics.Image; 18 | aaImage: AA2DGraphics.AA2DImage; 19 | iObject, iMaterial, iVertex1, iVertex2, iVertex3, iVertex4, nRes: LONGINT; 20 | 21 | BEGIN 22 | 23 | IF context # NIL THEN RETURN END; 24 | 25 | context := con; 26 | 27 | image := WMGraphics.LoadImage("mars.png", TRUE); 28 | NEW(aaImage, image); 29 | 30 | iVertex1 := aaImage.AddVertex(AA2DGraphics.NewVertex(image.width / 5 - 0.5, image.height / 5 - 0.5)); 31 | iVertex2 := aaImage.AddVertex(AA2DGraphics.NewVertex(image.width - 1.5, 1.5)); 32 | iVertex3 := aaImage.AddVertex(AA2DGraphics.NewVertex(1.5, image.height - 1.5)); 33 | iVertex4 := aaImage.AddVertex(AA2DGraphics.NewVertex(image.width - image.width / 5 - 0.5, image.height - image.height / 5 - 0.5)); 34 | iMaterial := aaImage.AddMaterial(AA2DGraphics.NewColor(1.0, 0.0, 1.0, 0.75)); 35 | iObject := aaImage.AddObject(); 36 | aaImage.AddFacet(AA2DGraphics.NewFace(iVertex1, iVertex2, iVertex3), iMaterial, iObject); 37 | aaImage.AddFacet(AA2DGraphics.NewFace(iVertex3, iVertex2, iVertex4), iMaterial, iObject); 38 | 39 | iVertex1 := aaImage.AddVertex(AA2DGraphics.NewVertex(1.5, 1.5)); 40 | iVertex2 := aaImage.AddVertex(AA2DGraphics.NewVertex(image.width - image.width / 5 - 0.5, image.height / 5 - 0.5)); 41 | iVertex3 := aaImage.AddVertex(AA2DGraphics.NewVertex(image.width - 1.5, image.height - 1.5)); 42 | iVertex4 := aaImage.AddVertex(AA2DGraphics.NewVertex(image.width / 5 - 0.5, image.height - image.height / 5 - 0.5)); 43 | iMaterial := aaImage.AddMaterial(AA2DGraphics.NewColor(0.0, 1.0, 0.0, 0.3)); 44 | iObject := aaImage.AddObject(); 45 | aaImage.AddFacet(AA2DGraphics.NewFace(iVertex1, iVertex2, iVertex4), iMaterial, iObject); 46 | aaImage.AddFacet(AA2DGraphics.NewFace(iVertex4, iVertex2, iVertex3), iMaterial, iObject); 47 | 48 | WMGraphics.StoreImage(aaImage.Render(3), "aa.bmp", nRes); 49 | 50 | context.out.Ln; 51 | context.out.String("Done!"); 52 | context.out.Ln; 53 | 54 | END Test; 55 | 56 | BEGIN 57 | 58 | context := NIL; 59 | 60 | END AA2DGraphicsTest.Test ~ 61 | 62 | SystemTools.Free AA2DGraphicsTest AA2DGraphics ~ -------------------------------------------------------------------------------- /Work/Projects/Raytracer/WMClock.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Work/Projects/Raytracer/WMClock.Mod -------------------------------------------------------------------------------- /Work/Projects/WinMM/Win32.WinMMUtils.Mod: -------------------------------------------------------------------------------- 1 | MODULE WinMMUtils; (** AUTHOR "Yaroslav Romanchenko (sage)"; PURPOSE "WinMM.dll API utilities"; *) 2 | 3 | IMPORT 4 | SYSTEM, WinMM, Texts, UTF8Strings, Commands; 5 | 6 | PROCEDURE mixerGetDevCaps*(CONST uMxId: WinMM.UINT; CONST MxCaps: WinMM.MIXERCAPS; context: Commands.Context): BOOLEAN; 7 | VAR 8 | nResult: WinMM.MMRESULT; 9 | BEGIN 10 | nResult := WinMM.mixerGetDevCaps(uMxId, SYSTEM.ADR(MxCaps), SYSTEM.SIZEOF(WinMM.MIXERCAPS)); 11 | IF (nResult # WinMM.MMSYSERR_NOERROR) & (context # NIL) THEN 12 | context.out.String("mixerGetDevCaps error: "); context.out.Int(nResult, 1); context.out.Ln 13 | END; 14 | RETURN nResult = WinMM.MMSYSERR_NOERROR 15 | END mixerGetDevCaps; 16 | 17 | PROCEDURE mixerOpen*(VAR hMx: WinMM.HMIXER; CONST uMxId: WinMM.UINT; CONST dwCallback, dwInstance: WinMM.DWORD; CONST fOpen: SET; context: Commands.Context): BOOLEAN; 18 | VAR 19 | nResult: WinMM.MMRESULT; 20 | BEGIN 21 | nResult := WinMM.mixerOpen(SYSTEM.ADR(hMx), uMxId, dwCallback, dwInstance, SYSTEM.VAL(LONGINT, fOpen)); 22 | IF (nResult # WinMM.MMSYSERR_NOERROR) & (context # NIL) THEN 23 | context.out.String("mixerOpen error: "); context.out.Int(nResult, 1); context.out.Ln 24 | END; 25 | RETURN nResult = WinMM.MMSYSERR_NOERROR 26 | END mixerOpen; 27 | 28 | PROCEDURE mixerGetLineInfo*(CONST hMx: WinMM.HMIXEROBJ; VAR mxL: WinMM.MIXERLINE; fInfo: SET; context: Commands.Context): BOOLEAN; 29 | VAR 30 | nResult: WinMM.MMRESULT; 31 | BEGIN 32 | mxL.cbStruct := SYSTEM.SIZEOF(WinMM.MIXERLINE); 33 | nResult := WinMM.mixerGetLineInfo(hMx, SYSTEM.ADR(mxL), SYSTEM.VAL(LONGINT, fInfo)); 34 | IF (nResult # WinMM.MMSYSERR_NOERROR) & (context # NIL) THEN 35 | context.out.String("mixerGetLineInfo error: "); context.out.Int(nResult, 1); context.out.Ln 36 | END; 37 | RETURN nResult = WinMM.MMSYSERR_NOERROR 38 | END mixerGetLineInfo; 39 | 40 | PROCEDURE mixerGetLineControls*(CONST hMx: WinMM.HMIXEROBJ; VAR mxLC: WinMM.MIXERLINECONTROLS; fControls: SET; context: Commands.Context): BOOLEAN; 41 | VAR 42 | nResult: WinMM.MMRESULT; 43 | BEGIN 44 | mxLC.cbStruct := SYSTEM.SIZEOF(WinMM.MIXERLINECONTROLS); 45 | mxLC.cbmxctrl := SYSTEM.SIZEOF(WinMM.MIXERCONTROL); 46 | nResult := WinMM.mixerGetLineControls(hMx, SYSTEM.ADR(mxLC), SYSTEM.VAL(LONGINT, fControls)); 47 | IF (nResult # WinMM.MMSYSERR_NOERROR) & (context # NIL) THEN 48 | context.out.String("mixerGetLineControls error: "); context.out.Int(nResult, 1); context.out.Ln 49 | END; 50 | RETURN nResult = WinMM.MMSYSERR_NOERROR 51 | END mixerGetLineControls; 52 | 53 | PROCEDURE mixerGetControlDetails*(CONST hMx: WinMM.HMIXEROBJ; VAR MxCD: WinMM.MIXERCONTROLDETAILS_MULTIPLE; fDetails: SET; context: Commands.Context): BOOLEAN; 54 | VAR 55 | nResult: WinMM.MMRESULT; 56 | BEGIN 57 | MxCD.cbStruct := SYSTEM.SIZEOF(WinMM.MIXERCONTROLDETAILS_MULTIPLE); 58 | nResult := WinMM.mixerGetControlDetails(hMx, SYSTEM.ADR(MxCD), SYSTEM.VAL(LONGINT, fDetails)); 59 | IF (nResult # WinMM.MMSYSERR_NOERROR) & (context # NIL) THEN 60 | context.out.String("mixerGetControlDetails error: "); context.out.Int(nResult, 1); context.out.Ln 61 | END; 62 | RETURN nResult = WinMM.MMSYSERR_NOERROR 63 | END mixerGetControlDetails; 64 | 65 | (*PROCEDURE GetWord*(w: WORD): LONGINT; 66 | VAR 67 | val: LONGINT; 68 | BEGIN 69 | val := 0; 70 | SYSTEM.PUT16(SYSTEM.ADR(val), SYSTEM.VAL(INTEGER, w)); 71 | RETURN (*SYSTEM.VAL(INTEGER, w)*) val 72 | END GetWord; 73 | 74 | PROCEDURE GetDWord*(dw: DWORD): HUGEINT; 75 | VAR 76 | val: HUGEINT; 77 | BEGIN 78 | val := 0; 79 | SYSTEM.PUT32(SYSTEM.ADR(val), SYSTEM.VAL(LONGINT, dw)); 80 | RETURN (*SYSTEM.VAL(INTEGER, w)*) val 81 | END GetDWord;*) 82 | 83 | (* Copy the wide string *) 84 | PROCEDURE WCharToUTF8*(CONST wchar: ARRAY OF WinMM.WCHAR; VAR utf8: ARRAY OF CHAR); 85 | VAR 86 | i: LONGINT; 87 | pUCS: POINTER TO ARRAY OF Texts.Char32; 88 | BEGIN 89 | NEW(pUCS, LEN(wchar)); 90 | i := 0; 91 | WHILE (i < LEN(wchar) - 1) & (wchar[i] # 0) DO 92 | pUCS[i] := 0; 93 | SYSTEM.PUT16(SYSTEM.ADR(pUCS^[i]), SYSTEM.VAL(INTEGER, wchar[i])); 94 | INC(i) 95 | END; 96 | pUCS[i] := 0; 97 | UTF8Strings.UnicodetoUTF8(pUCS^, utf8) 98 | END WCharToUTF8; 99 | 100 | END WinMMUtils. 101 | -------------------------------------------------------------------------------- /Work/Resources/WMBassDSPTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 5 | 0 6 | 352 7 | 156 8 | 9 | CCCCCCFF 10 | 5 11 | false 12 | false 13 | 14 | 15 | 28 | 29 | 30 | 31 | chbRotate 32 | 33 | 32 34 | 104 35 | 20 36 | 20 37 | 38 | false 39 | rotate 40 | 0 41 | 42 | 43 | 44 | 45 | 46 | chbEcho 47 | 48 | 144 49 | 104 50 | 20 51 | 20 52 | 53 | false 54 | 55 | 56 | 57 | 58 | 59 | chbFlanger 60 | 61 | 256 62 | 104 63 | 20 64 | 20 65 | 66 | false 67 | 68 | 69 | 70 | 82 | 83 | 95 | 96 | 108 | -------------------------------------------------------------------------------- /Work/Resources/WMColorLines.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Work/Resources/WMColorLines.zip -------------------------------------------------------------------------------- /Work/Resources/WMColorPicker.Zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Work/Resources/WMColorPicker.Zip -------------------------------------------------------------------------------- /Work/Resources/WMRaycaster.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Work/Resources/WMRaycaster.zip -------------------------------------------------------------------------------- /Work/Resources/WMVC.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/Work/Resources/WMVC.zip -------------------------------------------------------------------------------- /Work/Tools/VirtualKbd/wmkbd.en.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /Work/Tools/VirtualKbd/wmkbd.ens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /Work/Tools/VirtualKbd/wmkbd.num.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /peasthope/OLR.System.1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/peasthope/OLR.System.1.jpg -------------------------------------------------------------------------------- /peasthope/OberonCF0.Dsk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/peasthope/OberonCF0.Dsk -------------------------------------------------------------------------------- /peasthope/README: -------------------------------------------------------------------------------- 1 | OberonCF0.Dsk is a diskette image of a Native Oberon installer which includes support for compact flash. 2 | 3 | -------------------------------------------------------------------------------- /sr/tracer/sr.Recticle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/sr.Recticle.png -------------------------------------------------------------------------------- /sr/tracer/sr.dotz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/sr.dotz.png -------------------------------------------------------------------------------- /sr/tracer/sr.leafs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/sr.leafs.png -------------------------------------------------------------------------------- /sr/tracer/sr.lobster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/sr.lobster.png -------------------------------------------------------------------------------- /sr/tracer/sr.meeba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/sr.meeba.png -------------------------------------------------------------------------------- /sr/tracer/sr.mutatis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/sr.mutatis.png -------------------------------------------------------------------------------- /sr/tracer/sr.qdog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/sr.qdog.png -------------------------------------------------------------------------------- /sr/tracer/sr.tracericon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/sr.tracericon.png -------------------------------------------------------------------------------- /sr/tracer/sr.tracericonsmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/sr.tracericonsmall.png -------------------------------------------------------------------------------- /sr/tracer/srBase.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srBase.Mod -------------------------------------------------------------------------------- /sr/tracer/srE.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srE.Mod -------------------------------------------------------------------------------- /sr/tracer/srFRep.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srFRep.Mod -------------------------------------------------------------------------------- /sr/tracer/srGL.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srGL.Mod -------------------------------------------------------------------------------- /sr/tracer/srHalfSpace.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srHalfSpace.Mod -------------------------------------------------------------------------------- /sr/tracer/srHex.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srHex.Mod -------------------------------------------------------------------------------- /sr/tracer/srImage.Mod: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /sr/tracer/srLifeVox.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srLifeVox.Mod -------------------------------------------------------------------------------- /sr/tracer/srM2Space.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srM2Space.Mod -------------------------------------------------------------------------------- /sr/tracer/srM3Space.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srM3Space.Mod -------------------------------------------------------------------------------- /sr/tracer/srM5Space.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srM5Space.Mod -------------------------------------------------------------------------------- /sr/tracer/srMarsh.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srMarsh.Mod -------------------------------------------------------------------------------- /sr/tracer/srMath.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srMath.Mod -------------------------------------------------------------------------------- /sr/tracer/srRastermovie.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srRastermovie.Mod -------------------------------------------------------------------------------- /sr/tracer/srRender.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srRender.Mod -------------------------------------------------------------------------------- /sr/tracer/srRenderTools.Text: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srRenderTools.Text -------------------------------------------------------------------------------- /sr/tracer/srRetina.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srRetina.Mod -------------------------------------------------------------------------------- /sr/tracer/srRotaVox.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srRotaVox.Mod -------------------------------------------------------------------------------- /sr/tracer/srTexVox.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srTexVox.Mod -------------------------------------------------------------------------------- /sr/tracer/srVoxel.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srVoxel.Mod -------------------------------------------------------------------------------- /sr/tracer/srVoxel2.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srVoxel2.Mod -------------------------------------------------------------------------------- /sr/tracer/srVoxel3.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srVoxel3.Mod -------------------------------------------------------------------------------- /sr/tracer/srVoxel4.Mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacore/A2Community/d767ee6bb842c12ac2bf82a0e6b9c3494fdc8051/sr/tracer/srVoxel4.Mod --------------------------------------------------------------------------------