Package edu.cmu.tetrad.search.utils
Record Class TetradInt
java.lang.Object
java.lang.Record
edu.cmu.tetrad.search.utils.TetradInt
- Record Components:
i- The first node.j- The second node.k- The third node.l- The fourth node.
- All Implemented Interfaces:
TetradSerializable,Serializable
Represents an ordered tetrad (quartet) of nodes, where the order of nodes within {i, j} and {k, l} does not matter,
but the order of the pairs <{i, j}, {k, l}> does matter.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTetradInt(int i, int j, int k, int l) Initializes a TetradInt record while ensuring that all provided nodes are distinct. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this TetradInt object with the specified object for equality.inthashCode()Computes the hash code for this TetradInt instance.inti()Returns the value of theirecord component.intj()Returns the value of thejrecord component.intk()Returns the value of thekrecord component.intl()Returns the value of thelrecord component.toString()Returns a string representation of this TetradInt object.
-
Constructor Details
-
TetradInt
public TetradInt(int i, int j, int k, int l) Initializes a TetradInt record while ensuring that all provided nodes are distinct.- Parameters:
i- The first node of the tetrad.j- The second node of the tetrad.k- The third node of the tetrad.l- The fourth node of the tetrad.- Throws:
IllegalArgumentException- If any two nodes among i, j, k, and l are not distinct.
-
-
Method Details
-
hashCode
public int hashCode()Computes the hash code for this TetradInt instance. The hash code calculation takes into account the unordered pairs {i, j} and {k, l}, ensuring that the order of nodes within each pair does not affect the result. However, the order of the two pairs <{i, j}, {k, l}> impacts the hash code. -
equals
Compares this TetradInt object with the specified object for equality. Two TetradInt objects are considered equal if their unordered pairs {i, j} and {k, l} are identical, in the same order or reversed, but the order of the pairs <{i, j}, {k, l}> must match. -
toString
Returns a string representation of this TetradInt object. The string format represents the sets of pairs <{i, j}, {k, l}> where the individual pairs are sorted in ascending order, ensuring consistent representation regardless of the original order of the individual nodes i, j, k, and l. -
i
public int i()Returns the value of theirecord component.- Returns:
- the value of the
irecord component
-
j
public int j()Returns the value of thejrecord component.- Returns:
- the value of the
jrecord component
-
k
public int k()Returns the value of thekrecord component.- Returns:
- the value of the
krecord component
-
l
public int l()Returns the value of thelrecord component.- Returns:
- the value of the
lrecord component
-