Class DualScale<T>
Object
DualScale<T>
- Type Parameters:
- T- element-type to store.
Stores two versions of the same object, representing two different scales.
 
This is a monad that provides a framework for applying a chain of operations on both scales.
- Author:
- Owen Feehan
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription<R> Rapply(BiFunction<T, T, R> function) Apply aBiFunctionto both elements.The element scaled to match the size of the input-image.The element scaled to match the size of the input for model inference.<S,U> DualScale <S> combine(DualScale<U> other, BiFunction<T, U, S> combineFunction) Create a derivedDualScaleby combining the respective elements of this instance with another.<S> DualScale<S> Create a derivedDualScaleby applying an identical mapping to each element.
- 
Constructor Details- 
DualScaleCreates a newDualScaleinstance.- Parameters:
- inputScale- The element scaled to match the size of the input-image.
- modelScale- The element scaled to match the size of the input for model inference.
 
 
- 
- 
Method Details- 
atInputScaleThe element scaled to match the size of the input-image.- Returns:
- the element, at the requested scale.
 
- 
atModelScaleThe element scaled to match the size of the input for model inference.- Returns:
- the element, at the requested scale.
 
- 
mapCreate a derivedDualScaleby applying an identical mapping to each element.- Type Parameters:
- S- the target element-type after the mapping.
- Parameters:
- mappingFunction- maps an instance of type- Tto type- S.
- Returns:
- a newly created DualScalecontaining the mapped instances.
 
- 
combineCreate a derivedDualScaleby combining the respective elements of this instance with another.- Type Parameters:
- S- the target element-type after combining.
- U- the element-type of- other.
- Parameters:
- other- the other- DualScaleto combine with.
- combineFunction- combines the respective elements from the two- DualScales to form an element in the derived instance.
- Returns:
- a newly created DualScalecontaining the respectiuve outputs fromcombineFunction.
 
- 
applyApply aBiFunctionto both elements.- Type Parameters:
- R- the return type of the- BiFunction.
- Parameters:
- function- the function to apply, to the input-scale and model-scale elements, respectively.
- Returns:
- the result of applying the functionto the respective elements.
 
 
-