Package net.algart.arrays
Class Matrices.ResizingMethod
java.lang.Object
net.algart.arrays.Matrices.ResizingMethod
- Direct Known Subclasses:
Matrices.ResizingMethod.Averaging
- Enclosing class:
Matrices
Resizing mode for Matrices.asResized method.
This class is immutable and thread-safe: there are no ways to modify settings of the created instance.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classResizing method with averaging (while compression). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Matrices.ResizingMethod.AveragingResizing with averaging (while compression), but without interpolation.static final Matrices.ResizingMethod.AveragingResizing with polylinear interpolation and averaging while compression.static final Matrices.ResizingMethodResizing with polylinear interpolation (useful for expanding), but without interpolation.static final Matrices.ResizingMethodSimplest resizing method. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true for any instances ofMatrices.ResizingMethod.Averagingclass, in particular, forAVERAGINGandPOLYLINEAR_AVERAGINGcases, false for other cases.final booleanReturns true forPOLYLINEAR_INTERPOLATIONandPOLYLINEAR_AVERAGINGcases, and for inheritors ofMatrices.ResizingMethod.Averagingclass created withMatrices.InterpolationMethod.POLYLINEAR_FUNCTIONconstructor argument, false for other cases.ReturnsMatrices.InterpolationMethod.POLYLINEAR_FUNCTIONforPOLYLINEAR_INTERPOLATIONandPOLYLINEAR_AVERAGINGcases,Matrices.InterpolationMethod.STEP_FUNCTIONforSIMPLEandAVERAGINGcases, and the argument of the constructor for inheritors ofMatrices.ResizingMethod.Averagingclass.
-
Field Details
-
SIMPLE
Simplest resizing method. See details in comments toMatrices.asResized. -
AVERAGING
Resizing with averaging (while compression), but without interpolation. See details in comments toMatrices.asResized. -
POLYLINEAR_INTERPOLATION
Resizing with polylinear interpolation (useful for expanding), but without interpolation. See details in comments toMatrices.asResized. -
POLYLINEAR_AVERAGING
Resizing with polylinear interpolation and averaging while compression. See details in comments toMatrices.asResized.
-
-
Method Details
-
averaging
public boolean averaging()Returns true for any instances ofMatrices.ResizingMethod.Averagingclass, in particular, forAVERAGINGandPOLYLINEAR_AVERAGINGcases, false for other cases.- Returns:
- whether this mode performs averaging of several elements.
-
interpolation
public final boolean interpolation()Returns true forPOLYLINEAR_INTERPOLATIONandPOLYLINEAR_AVERAGINGcases, and for inheritors ofMatrices.ResizingMethod.Averagingclass created withMatrices.InterpolationMethod.POLYLINEAR_FUNCTIONconstructor argument, false for other cases.- Returns:
- whether this mode performs some form of interpolation between elements.
-
interpolationMethod
ReturnsMatrices.InterpolationMethod.POLYLINEAR_FUNCTIONforPOLYLINEAR_INTERPOLATIONandPOLYLINEAR_AVERAGINGcases,Matrices.InterpolationMethod.STEP_FUNCTIONforSIMPLEandAVERAGINGcases, and the argument of the constructor for inheritors ofMatrices.ResizingMethod.Averagingclass.- Returns:
- the interpolation method used while resizing.
-