java.lang.Object
java.lang.Record
org.aya.terck.CallMatrix<Def,Param>
- All Implemented Interfaces:
org.aya.pretty.doc.Docile,Selector.Candidate<CallMatrix<Def,Param>>
public record CallMatrix<Def,Param> (@NotNull Callable callable, Def domain, Def codomain, @NotNull kala.collection.immutable.ImmutableSeq<Param> domainTele, @NotNull kala.collection.immutable.ImmutableSeq<Param> codomainTele, @NotNull Relation[][] matrix)
extends Record
implements org.aya.pretty.doc.Docile, Selector.Candidate<CallMatrix<Def,Param>>
A call matrix for a call `f --> g` has dimensions `arity(g) * arity(f)`.
Each row corresponds to one argument in the call to `g` (the codomain).
Each column corresponds to one formal argument of caller `f` (the domain).
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCallMatrix(@NotNull Callable callable, Def domain, Def codomain, @NotNull kala.collection.immutable.ImmutableSeq<Param> domainTele, @NotNull kala.collection.immutable.ImmutableSeq<Param> codomainTele) CallMatrix(@NotNull Callable callable, Def domain, Def codomain, @NotNull kala.collection.immutable.ImmutableSeq<Param> domainTele, @NotNull kala.collection.immutable.ImmutableSeq<Param> codomainTele, @NotNull Relation[][] matrix) Creates an instance of aCallMatrixrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Callablecallable()Returns the value of thecallablerecord component.codomain()Returns the value of thecodomainrecord component.@NotNull kala.collection.immutable.ImmutableSeq<Param>Returns the value of thecodomainTelerecord component.intcols()static <Def,Param>
@NotNull CallMatrix<Def,Param> combine(@NotNull CallMatrix<Def, Param> A, @NotNull CallMatrix<Def, Param> B) Combine two call matrices if there exists an indirect call, for example: If `f` calls `g` with call matrix `A` and `g` calls `h` with call matrix `B`, the `f` indirectly calls `h` with call matrix `combine(A, B)` or `AB` in matrix notation.compare(@NotNull CallMatrix<Def, Param> other) Compare two call matrices by their decrease amount.domain()Returns the value of thedomainrecord component.@NotNull kala.collection.immutable.ImmutableSeq<Param>Returns the value of thedomainTelerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull Relation[][]matrix()Returns the value of thematrixrecord component.introws()void@NotNull org.aya.pretty.doc.DoctoDoc()final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.aya.terck.Selector.Candidate
notWorseThan
-
Constructor Details
-
CallMatrix
-
CallMatrix
public CallMatrix(@NotNull @NotNull Callable callable, @NotNull Def domain, @NotNull Def codomain, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<Param> domainTele, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<Param> codomainTele, @NotNull @NotNull Relation[][] matrix) Creates an instance of aCallMatrixrecord class.- Parameters:
callable- the value for thecallablerecord componentdomain- the value for thedomainrecord componentcodomain- the value for thecodomainrecord componentdomainTele- the value for thedomainTelerecord componentcodomainTele- the value for thecodomainTelerecord componentmatrix- the value for thematrixrecord component
-
-
Method Details
-
rows
public int rows() -
cols
public int cols() -
set
-
compare
Compare two call matrices by their decrease amount.- Specified by:
comparein interfaceSelector.Candidate<Def>
-
combine
@Contract(pure=true) @NotNull public static <Def,Param> @NotNull CallMatrix<Def,Param> combine(@NotNull @NotNull CallMatrix<Def, Param> A, @NotNull @NotNull CallMatrix<Def, Param> B) Combine two call matrices if there exists an indirect call, for example: If `f` calls `g` with call matrix `A` and `g` calls `h` with call matrix `B`, the `f` indirectly calls `h` with call matrix `combine(A, B)` or `AB` in matrix notation. -
toDoc
@NotNull public @NotNull org.aya.pretty.doc.Doc toDoc()- Specified by:
toDocin interfaceorg.aya.pretty.doc.Docile
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
callable
Returns the value of thecallablerecord component.- Returns:
- the value of the
callablerecord component
-
domain
Returns the value of thedomainrecord component.- Returns:
- the value of the
domainrecord component
-
codomain
Returns the value of thecodomainrecord component.- Returns:
- the value of the
codomainrecord component
-
domainTele
Returns the value of thedomainTelerecord component.- Returns:
- the value of the
domainTelerecord component
-
codomainTele
Returns the value of thecodomainTelerecord component.- Returns:
- the value of the
codomainTelerecord component
-
matrix
Returns the value of thematrixrecord component.- Returns:
- the value of the
matrixrecord component
-