Class/Object

scalan.primitives.Functions

Lambda

Related Docs: object Lambda | package Functions

Permalink

class Lambda[A, B] extends Scalan.AstGraph with Scalan.Def[(A) ⇒ B]

Represent lambda expression as IR node.

Self Type
Scalan.Lambda[A, B]
Linear Supertypes
Scalan.Def[(A) ⇒ B], Scalan.AstGraph, Scalan.Node, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Lambda
  2. Def
  3. AstGraph
  4. Node
  5. Product
  6. Equals
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Lambda(f: Nullable[(Scalan.Ref[A]) ⇒ Scalan.Ref[B]], x: Scalan.Ref[A], y: Scalan.Ref[B], mayInline: Boolean, alphaEquality: Boolean = true)

    Permalink

    f

    optional function, which was used to compute y

    x

    lambda-bound variable

    y

    symbol representing result of lambda invocation

    mayInline

    whether this lambda can be inlined when applied

    alphaEquality

    whether to use alpha-equality in equals

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. lazy val allNodes: Map[Int, Scalan.GraphNode]

    Permalink
    Definition Classes
    AstGraph
  5. val alphaEquality: Boolean

    Permalink

    whether to use alpha-equality in equals

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. val boundVarId: Int

    Permalink
  8. val boundVars: Seq[Scalan.Sym]

    Permalink

    If this graph represent Lambda abstraction, the boundVars is lambda bound symbols.

    If this graph represent Lambda abstraction, the boundVars is lambda bound symbols. otherwise this is empty set.

    Definition Classes
    LambdaAstGraph
  9. final def buildFlatSchedule(schedule: Scalan.Schedule, flatBuf: Buffer[Scalan.Sym]): Unit

    Permalink

    Flatten the given schedule into single sequence of non-AstGraph definitions.

    Flatten the given schedule into single sequence of non-AstGraph definitions. All scope forming definitions like Lambda and ThunkDef are recursively unfolded in the given buffer flatBuf. NOTE: The symbols of AstGraph-like definitions are added to flatBuf AFTER the unfolded body.

    Definition Classes
    AstGraph
  10. def buildUsageMap(schedule: Scalan.Schedule, usingDeps: Boolean): Map[Int, Scalan.GraphNode]

    Permalink

    Build usage information induced by the given schedule.

    Build usage information induced by the given schedule. For each symbol of the schedule a GraphNode is created and usages are collected.

    Definition Classes
    AstGraph
  11. def canEqual(other: Any): Boolean

    Permalink
    Definition Classes
    Lambda → Equals
  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  13. final def deps: Array[Scalan.Sym]

    Permalink

    Dependencies of this definition from other definitions.

    Dependencies of this definition from other definitions. If definition is interpreted as an operation, then dependencies are arguments of the operation. If definition if compound (like Lambda of ThunkDef) then deps is equals to free variables used in the body of the compound definition. This array also refers to predecessors of this graph node, so it is used to build topological ordering (execution schedule) of operations.

    returns

    array of referencies to other definitions.

    Definition Classes
    Node
  14. lazy val domain: Set[Int]

    Permalink

    Set of symbol ids in the schedule.

    Set of symbol ids in the schedule. Can be used to quickly recognize symbols belonging to the body of this definition.

    Definition Classes
    AstGraph
  15. def eA: Scalan.Elem[A]

    Permalink
  16. def eB: Scalan.Elem[B]

    Permalink
  17. final def elements: Array[AnyRef]

    Permalink

    All data elements of this graph node to be used in structural equality.

    All data elements of this graph node to be used in structural equality.

    Definition Classes
    Node
    See also

    equals where elements are used.

  18. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. def equals(other: Any): Boolean

    Permalink

    Default equality of definitions.

    Default equality of definitions. Two definitions are equal if they have same elements.

    Definition Classes
    LambdaNode → Equals → AnyRef → Any
  20. val f: Nullable[(Scalan.Ref[A]) ⇒ Scalan.Ref[B]]

    Permalink

    optional function, which was used to compute y

  21. lazy val flatSchedule: Scalan.Schedule

    Permalink
    Definition Classes
    AstGraph
  22. lazy val freeVars: Seq[Scalan.Sym]

    Permalink

    Collect a set of symbols used in the graph but which are not part of its schedule.

    Collect a set of symbols used in the graph but which are not part of its schedule. If the graph represents a compound definition (Lambda, Thunk etc), then each item in freeVars is used in the body, but not part of it. Intersection of free vars with bound vars is empty.

    Definition Classes
    LambdaAstGraph
  23. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  24. def getDeps: Array[Scalan.Sym]

    Permalink

    Override to redefine how dependencies are computed.

    Override to redefine how dependencies are computed. For example, in core implementation this is overriden in Lambda and ThunkDef using freeVars.

    Attributes
    protected
    Definition Classes
    LambdaNode
  25. def globalUsagesOf(s: Scalan.Sym): Buffer[Scalan.Sym]

    Permalink
    Definition Classes
    AstGraph
  26. def hasManyUsages(s: Scalan.Sym): Boolean

    Permalink
    Definition Classes
    AstGraph
  27. def hasManyUsagesGlobal(s: Scalan.Sym): Boolean

    Permalink
    Definition Classes
    AstGraph
  28. def hashCode(): Int

    Permalink

    Computed once and saved to avoid repeated computations, which is not necessary because definitions are immutable by default.

    Computed once and saved to avoid repeated computations, which is not necessary because definitions are immutable by default. If some definition require mutability, this method can be overriden accordingly.

    Definition Classes
    LambdaNode → AnyRef → Any
  29. def isBoundVar(s: Scalan.Sym): Boolean

    Permalink

    Checks the symbol is lambda bound.

    Checks the symbol is lambda bound.

    Definition Classes
    LambdaAstGraph
    Annotations
    @inline()
  30. def isIdentity: Boolean

    Permalink

    Whether this graph represents identity function.

    Whether this graph represents identity function.

    Definition Classes
    LambdaAstGraph
  31. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  32. final def isLocalDef(s: Scalan.Sym): Boolean

    Permalink
    Definition Classes
    AstGraph
    Annotations
    @inline()
  33. final def isLocalDefId(id: Int): Boolean

    Permalink
    Definition Classes
    AstGraph
    Annotations
    @inline()
  34. final def isRoot(s: Scalan.Sym): Boolean

    Permalink
    Definition Classes
    AstGraph
    Annotations
    @inline()
  35. val mayInline: Boolean

    Permalink

    whether this lambda can be inlined when applied

  36. def mirror(t: Scalan.Transformer): Scalan.Ref[(A) ⇒ B]

    Permalink

    Clone this definition transforming all symbols using t.

    Clone this definition transforming all symbols using t. If new Def[A] is created, it is added to the graph with collapsing and rewriting. Can be overriden to implement node-specific mirroring (see MethodCall).

    t

    mapping of symbols to symbols (Ref[_] => Ref[_])

    returns

    symbol of the logical clone. If d don't contain symbols, then d.self is returned.

    Definition Classes
    Def
  37. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  38. final def nodeId: Int

    Permalink

    Unique id of the graph node assigned for each new instance using freshId generator.

    Unique id of the graph node assigned for each new instance using freshId generator. Doesn't participate in equality of this Def, thus definitions with different ids may still be structurally equal. Used to provide global Def numbering.

    Definition Classes
    Node
    Annotations
    @inline()
  39. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  40. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  41. def productArity: Int

    Permalink
    Definition Classes
    Lambda → Product
  42. def productElement(n: Int): Any

    Permalink
    Definition Classes
    Lambda → Product
  43. def productIterator: Iterator[Any]

    Permalink
    Definition Classes
    Product
  44. def productPrefix: String

    Permalink
    Definition Classes
    Product
  45. def resultType: Scalan.Elem[(A) ⇒ B]

    Permalink

    Type of a resulting value produced by the operation represented by this definition.

    Type of a resulting value produced by the operation represented by this definition. For example, if this definition represents application of +: (Int, Int) => Int operation then the result type is Int and resultType should return IntElement.

    Definition Classes
    LambdaDef
  46. lazy val rootIds: Buffer[Int]

    Permalink

    Extract identifies out of roots.

    Extract identifies out of roots.

    Definition Classes
    LambdaAstGraph
  47. val roots: Seq[Scalan.Sym]

    Permalink

    Terminal nodes of the graph.

    Terminal nodes of the graph. There are incoming, but no outgoing edges.

    Definition Classes
    LambdaAstGraph
  48. lazy val schedule: Scalan.Schedule

    Permalink

    Sequence of node references forming a schedule.

    Sequence of node references forming a schedule.

    Definition Classes
    AstGraph
  49. lazy val scheduleIds: Buffer[Int]

    Permalink

    Schedule represents a body of compound definition - topologically ordered sequence of nodes of the graph.

    Schedule represents a body of compound definition - topologically ordered sequence of nodes of the graph. It is implemented differently depending on node type.

    Definition Classes
    LambdaAstGraph
    See also

    Lambda, ThunkDef

  50. final def self: Scalan.Ref[(A) ⇒ B]

    Permalink

    Reference to this definition created lazily on demand.

    Reference to this definition created lazily on demand.

    Definition Classes
    Def
  51. def show(config: GraphVizConfig): Unit

    Permalink
    Definition Classes
    AstGraph
  52. def show(emitMetadata: Boolean): Unit

    Permalink
    Definition Classes
    AstGraph
  53. def show(): Unit

    Permalink
    Definition Classes
    AstGraph
  54. final def syms: Array[Scalan.Sym]

    Permalink

    References to other nodes in this Def instance.

    References to other nodes in this Def instance. Note: This is different form deps for compound definitions like Lambda and ThunkDef.

    Definition Classes
    Node
  55. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  56. def toString(): String

    Permalink

    User readable string representation of this definition.

    User readable string representation of this definition. (for debugging only)

    Definition Classes
    LambdaNode → AnyRef → Any
  57. def transform(t: Scalan.Transformer): Scalan.Def[(A) ⇒ B]

    Permalink

    Create a copy of this definition applying the given transformer to all syms.

    Create a copy of this definition applying the given transformer to all syms.

    Definition Classes
    Def
  58. lazy val usageMap: Map[Int, Scalan.GraphNode]

    Permalink

    Symbol Usage information for this graph

    Symbol Usage information for this graph

    Definition Classes
    AstGraph
  59. def usagesOf(id: Int): Buffer[Int]

    Permalink

    Definition Classes
    AstGraph
  60. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. val x: Scalan.Ref[A]

    Permalink

    lambda-bound variable

  64. val y: Scalan.Ref[B]

    Permalink

    symbol representing result of lambda invocation

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Scalan.Def[(A) ⇒ B]

Inherited from Scalan.AstGraph

Inherited from Scalan.Node

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped