public class LsOptimalPredictor12 extends Object
The method used for this class is based on the PDF document: Lewis, M. and Smith, D. H. (1994). "Optimal Predictors for the Data Compression of Digital Elevation Models using the Method of Lagrange Multipliers"
The floating-point arithmetic operations for the encode method in this class are performed using the Java strictfp specification. This design choice is essential to the correct operation of this module. Because one of the goals for Gridfour is to facilitate portability to other development environments, it is essential that the math operations performed here be reliably reproducible across platforms and programming languages.
Constructor and Description |
---|
LsOptimalPredictor12() |
Modifier and Type | Method and Description |
---|---|
double[] |
computeCoefficients(int nRows,
int nColumns,
int[] values)
Computes the coefficients for an optimal predictor.
|
LsOptimalPredictorResult |
encode(int nRows,
int nColumns,
int[] values)
Encode the specified raster using the Smith-Lewis Optimal Predictor
12-coefficient variation
|
double |
getMeanAbsError() |
double |
getMeanError()
Gets the mean error for the predictor.
|
double |
getPercentZeroIntegerResiduals()
Gets the percent of the integer coded residuals that have a
zero value.
|
double |
getRootMeanSquaredError()
Gets the root mean squared error (RMSE) for the predictor.
|
public LsOptimalPredictorResult encode(int nRows, int nColumns, int[] values)
nRows
- the number of rows in the rasternColumns
- the number of columns in the rastervalues
- the values for the raster given as an array of integers
in row-major order.public double[] computeCoefficients(int nRows, int nColumns, int[] values)
row i: u3 u0 S(i,j) row i-1: u4 u1 u2 row i-2: u5 u6 u7
nRows
- a value of 6 or greaternColumns
- a value of 6 or greatervalues
- an array of values given in row-major order.public double getMeanError()
public double getRootMeanSquaredError()
public double getPercentZeroIntegerResiduals()
public double getMeanAbsError()
Copyright © 2022. All rights reserved.