Class Generate<NAMETYPE extends Name>


  • public class Generate<NAMETYPE extends Name>
    extends PrimitiveTensorFunction<NAMETYPE>
    An indexed tensor whose values are generated by a function
    Author:
    bratseth
    • Constructor Detail

      • Generate

        public Generate​(TensorType type,
                        java.util.function.Function<java.util.List<java.lang.Long>,​java.lang.Double> generator)
        The same as Generate.free
    • Method Detail

      • free

        public static <NAMETYPE extends NameGenerate<NAMETYPE> free​(TensorType type,
                                                                      java.util.function.Function<java.util.List<java.lang.Long>,​java.lang.Double> generator)
        Creates a generated tensor from a free function
        Parameters:
        type - the type of the tensor
        generator - the function generating values from a list of numbers specifying the indexes of the tensor cell which will receive the value
        Throws:
        java.lang.IllegalArgumentException - if any of the tensor dimensions are not indexed bound
      • bound

        public static <NAMETYPE extends NameGenerate<NAMETYPE> bound​(TensorType type,
                                                                       ScalarFunction<NAMETYPE> generator)
        Creates a generated tensor from a bound function
        Parameters:
        type - the type of the tensor
        generator - the function generating values from a list of numbers specifying the indexes of the tensor cell which will receive the value
        Throws:
        java.lang.IllegalArgumentException - if any of the tensor dimensions are not indexed bound
      • toString

        public java.lang.String toString​(ToStringContext context)
        Description copied from class: TensorFunction
        Return a string representation of this context.
        Specified by:
        toString in class TensorFunction<NAMETYPE extends Name>
        Parameters:
        context - a context which must be passed to all nested functions when requesting the string value