Class ConvertedOpInfo

  • All Implemented Interfaces:
    Comparable<OpInfo>, OpInfo

    public class ConvertedOpInfo
    extends Object
    implements OpInfo
    An OpInfo whose input and output types are transformed through the use of engine.convert Function Ops. Op instances created by this OpInfo utilize a engine.convert "preconverter" Op to coerce each provided input to the type expected by the Op, and after execution use a engine.convert "postconverter" Op to coerce the output back into the type expected by the user. If the Op defines a preallocated output buffer, a engine.copy Computers.Arity1 Op is used to place the computational results of the Op back into the passed output buffer.

    As an example, consider a Function<Double, Double>. If we have a engine.convert Op that goes from Integer to Double and a engine.convert Op that goes from Double to Integer then we can construct a Function<Integer, Integer> Op. At runtime, we will utilize the former engine.convert Op to preconvert the input Integer into a Double, invoke the Function<Double, Double>, and then postconvert the Double into an Integer using the latter engine.convert Op, which is returned to the user.

    Author:
    Gabriel Selzer