/** * Tests on a per coefficient basis if this matrix is equal to the given {@code other} to an * {@code epsilon}. * <p> * If the two matrices have different frames, this method returns {@code false}. * </p> * * @param other the other matrix to compare against this. Not modified. * @param epsilon the tolerance to use when comparing each component. * @return {@code true} if the two matrices are equal and are expressed in the same reference * frame, {@code false} otherwise. */ default boolean epsilonEquals(FrameMatrix3DReadOnly other, double epsilon) { if (getReferenceFrame() != other.getReferenceFrame()) return false; return Matrix3DReadOnly.super.epsilonEquals(other, epsilon); } }
/** * Sets this matrix to {@code other}. * * @param other the other frame matrix to copy the values of. Not modified. * @throws ReferenceFrameMismatchException if the matrix is not expressed in the same reference * frame as {@code this}. */ default void set(FrameMatrix3DReadOnly other) { set(other.getReferenceFrame(), other); }
/** * Tests on a per component basis if this matrix is exactly equal to {@code other}. * <p> * If the two matrices have different frames, this method returns {@code false}. * </p> * <p> * The method returns {@code false} if the given matrix is {@code null}. * </p> * * @param other the other matrix to compare against this. Not modified. * @return {@code true} if the two matrices are exactly equal component-wise and are expressed in * the same reference frame, {@code false} otherwise. */ default boolean equals(FrameMatrix3DReadOnly other) { if (other == null || getReferenceFrame() != other.getReferenceFrame()) return false; return Matrix3DReadOnly.super.equals(other); }
/** * Sets this matrix to {@code other}. * * @param other the other matrix to copy the values and reference frame from. Not modified. */ default void setIncludingFrame(FrameMatrix3DReadOnly other) { setIncludingFrame(other.getReferenceFrame(), other); }
/** * Packs a column of this matrix into a 3D frame tuple. * * @param column the index of the column to pack. * @param columnToPack the tuple in which the column of this matrix is stored. Modified. * @throws ArrayIndexOutOfBoundsException if {@code column} ∉ [0, 2]. */ default void getColumn(int column, FrameTuple3DBasics columnToPack) { columnToPack.setReferenceFrame(getReferenceFrame()); Matrix3DReadOnly.super.getColumn(column, columnToPack); }
/** * Packs a row of this matrix into a 3D frame tuple. * * @param row the index of the row to pack. * @param rowToPack the array in which the row of this matrix is stored. Modified. * @throws ArrayIndexOutOfBoundsException if {@code row} ∉ [0, 2]. */ default void getRow(int row, FrameTuple3DBasics rowToPack) { rowToPack.setReferenceFrame(getReferenceFrame()); Matrix3DReadOnly.super.getRow(row, rowToPack); }
/** * Sets this matrix to {@code other}. * <p> * If {@code other} is expressed in the frame as {@code this}, then this method is equivalent to * {@link #set(FrameMatrix3DReadOnly)}. * </p> * <p> * If {@code other} is expressed in a different frame than {@code this}, then {@code this} is set * to {@code other} once transformed to be expressed in {@code this.getReferenceFrame()}. * </p> * * @param other the other frame matrix to set this to. Not modified. */ default void setMatchingFrame(FrameMatrix3DReadOnly other) { Matrix3DBasics.super.set(other); other.getReferenceFrame().transformFromThisToDesiredFrame(getReferenceFrame(), this); }