class Lambda[A, B] extends Scalan.AstGraph with Scalan.Def[(A) ⇒ B]
- Alphabetic
- By Inheritance
- Lambda
- Def
- AstGraph
- Node
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Lambda(f: Nullable[(Scalan.Ref[A]) ⇒ Scalan.Ref[B]], x: Scalan.Ref[A], y: Scalan.Ref[B], mayInline: Boolean, alphaEquality: Boolean = true)
- 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
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
lazy val
allNodes: Map[Int, Scalan.GraphNode]
- Definition Classes
- AstGraph
- val alphaEquality: Boolean
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val boundVarId: Int
-
val
boundVars: Seq[Scalan.Sym]
If this graph represent Lambda abstraction, the boundVars is lambda bound symbols.
-
final
def
buildFlatSchedule(schedule: Scalan.Schedule, flatBuf: Buffer[Scalan.Sym]): Unit
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 toflatBuf
AFTER the unfolded body.- Definition Classes
- AstGraph
-
def
buildUsageMap(schedule: Scalan.Schedule, usingDeps: Boolean): Map[Int, Scalan.GraphNode]
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. HOTSPOT: don't beautify the code
- Definition Classes
- AstGraph
-
def
canEqual(other: Any): Boolean
- Definition Classes
- Lambda → Equals
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
deps: Array[Scalan.Sym]
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
-
lazy val
domain: Set[Int]
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
- def eA: Scalan.Elem[A]
- def eB: Scalan.Elem[B]
-
final
def
elements: Array[AnyRef]
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.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(other: Any): Boolean
Default equality of definitions.
- val f: Nullable[(Scalan.Ref[A]) ⇒ Scalan.Ref[B]]
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
lazy val
flatSchedule: Scalan.Schedule
- Definition Classes
- AstGraph
-
lazy val
freeVars: Seq[Scalan.Sym]
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. HOTSPOT: don't beautify the code -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getDeps: Array[Scalan.Sym]
Override to redefine how dependencies are computed.
-
def
globalUsagesOf(s: Scalan.Sym): Buffer[Scalan.Sym]
- Definition Classes
- AstGraph
-
def
hasManyUsages(s: Scalan.Sym): Boolean
- Definition Classes
- AstGraph
-
def
hasManyUsagesGlobal(s: Scalan.Sym): Boolean
- Definition Classes
- AstGraph
-
def
hashCode(): Int
Computed once and saved to avoid repeated computations, which is not necessary because definitions are immutable by default.
-
def
isBoundVar(s: Scalan.Sym): Boolean
Checks the symbol is lambda bound.
-
def
isIdentity: Boolean
Whether this graph represents identity function.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
isLocalDef(s: Scalan.Sym): Boolean
- Definition Classes
- AstGraph
- Annotations
- @inline()
-
final
def
isLocalDefId(id: Int): Boolean
- Definition Classes
- AstGraph
- Annotations
- @inline()
-
final
def
isRoot(s: Scalan.Sym): Boolean
- Definition Classes
- AstGraph
- Annotations
- @inline()
- val mayInline: Boolean
-
def
mirror(t: Scalan.Transformer): Scalan.Ref[(A) ⇒ B]
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
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
nodeId: Int
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()
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
productArity: Int
- Definition Classes
- Lambda → Product
-
def
productElement(n: Int): Any
- Definition Classes
- Lambda → Product
-
def
productIterator: Iterator[Any]
- Definition Classes
- Product
-
def
productPrefix: String
- Definition Classes
- Product
-
def
resultType: Scalan.Elem[(A) ⇒ B]
Type of a resulting value produced by the operation represented by this definition.
-
lazy val
rootIds: Buffer[Int]
Extract identifies out of
roots
. -
val
roots: Seq[Scalan.Sym]
Terminal nodes of the graph.
-
lazy val
schedule: Scalan.Schedule
Sequence of node references forming a schedule.
Sequence of node references forming a schedule. HOTSPOT: don't beautify the code
- Definition Classes
- AstGraph
-
lazy val
scheduleIds: Buffer[Int]
Schedule represents a body of compound definition - topologically ordered sequence of nodes of the graph.
-
final
def
self: Scalan.Ref[(A) ⇒ B]
Reference to this definition created lazily on demand.
Reference to this definition created lazily on demand.
- Definition Classes
- Def
-
final
def
syms: Array[Scalan.Sym]
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
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
User readable string representation of this definition.
-
def
transform(t: Scalan.Transformer): Scalan.Def[(A) ⇒ B]
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
-
lazy val
usageMap: Map[Int, Scalan.GraphNode]
Symbol Usage information for this graph
Symbol Usage information for this graph
- Definition Classes
- AstGraph
-
def
usagesOf(id: Int): Buffer[Int]
HOTSPOT: for performance we return mutable structure, but it should never be changed.
HOTSPOT: for performance we return mutable structure, but it should never be changed.
- Definition Classes
- AstGraph
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- val x: Scalan.Ref[A]
- val y: Scalan.Ref[B]