.. java:import:: fr.inria.tapenade.analysis ActivityPattern .. java:import:: fr.inria.tapenade.representation SymbolTableConstants .. java:import:: fr.inria.tapenade.representation TapEnv .. java:import:: fr.inria.tapenade.representation TapList .. java:import:: fr.inria.tapenade.representation TypeSpec .. java:import:: fr.inria.tapenade.representation Unit .. java:import:: fr.inria.tapenade.representation WrapperTypeSpec .. java:import:: fr.inria.tapenade.utils TapPair UnitDiffInfo ============ .. java:package:: fr.inria.tapenade.differentiation :noindex: .. java:type:: public final class UnitDiffInfo Collection of diffUnits and other infos for a given Unit. Constructors ------------ UnitDiffInfo ^^^^^^^^^^^^ .. java:constructor:: protected UnitDiffInfo(Unit unit, DifferentiationEnv adEnv) :outertype: UnitDiffInfo Methods ------- getAdjoint ^^^^^^^^^^ .. java:method:: protected Unit getAdjoint(ActivityPattern pattern) :outertype: UnitDiffInfo :return: the Adjoint Unit that belongs to the given ActivityPattern, or null if no such Unit exists. getAllDiffPatterns ^^^^^^^^^^^^^^^^^^ .. java:method:: protected TapList getAllDiffPatterns(int diffMode) :outertype: UnitDiffInfo getAllDiffPatternsAndUnits ^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected TapList> getAllDiffPatternsAndUnits(int diffMode) :outertype: UnitDiffInfo getAllDiffs ^^^^^^^^^^^ .. java:method:: protected TapList getAllDiffs(ActivityPattern pattern) :outertype: UnitDiffInfo :return: all differentiation units of this unit for the given activity pattern. Therefore doesn't return the copied Unit. getAllDiffs ^^^^^^^^^^^ .. java:method:: protected TapList getAllDiffs(int diffKind) :outertype: UnitDiffInfo :return: all differentiation units of this unit for the given diffKind. getAllDiffs ^^^^^^^^^^^ .. java:method:: protected TapList getAllDiffs() :outertype: UnitDiffInfo :return: all differentiation units of this unit, not geting the copied, non-diff Unit. getAllDiffsAndMode ^^^^^^^^^^^^^^^^^^ .. java:method:: protected TapList[] getAllDiffsAndMode() :outertype: UnitDiffInfo :return: all differentiation units and differentiation mode of this unit, not geting the copied, non-diff Unit. getAllDiffsPlusCopy ^^^^^^^^^^^^^^^^^^^ .. java:method:: protected TapList getAllDiffsPlusCopy() :outertype: UnitDiffInfo :return: all differentiation units of this unit, plus the copied Unit if exists. getAnyContainingDiffUnit ^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected Unit getAnyContainingDiffUnit(Unit unit, Unit container) :outertype: UnitDiffInfo :return: the most representative differentiated counterpart of a given source unit, contained in a container unit. This is somewhat arbitrary. If possible, we return the TANGENT, which also happens to contain the unique diff for modules (DIFFERENTIATED==TANGENT). Else the ADJOINT. Else the ADJOINT_BWD. Else the ORIGCOPY. getCopyForDiff ^^^^^^^^^^^^^^ .. java:method:: protected Unit getCopyForDiff() :outertype: UnitDiffInfo :return: For a package Unit, returns the corresponding package Unit for the differentiated code, and for a procedure Unit, returns the copy of this Unit for the differentiated code. getDiff ^^^^^^^ .. java:method:: protected Unit getDiff() :outertype: UnitDiffInfo :return: the differentiated Unit (only for modules?). getDiffForModeAndActivity ^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected Unit getDiffForModeAndActivity(int diffMode, ActivityPattern pattern) :outertype: UnitDiffInfo getDiffReturnType ^^^^^^^^^^^^^^^^^ .. java:method:: protected WrapperTypeSpec getDiffReturnType(int diffKind) :outertype: UnitDiffInfo :return: the diff unit return type if any differentiated version has a non-void return type. Otherwise, returns null. getSplitBackward ^^^^^^^^^^^^^^^^ .. java:method:: protected Unit getSplitBackward(ActivityPattern pattern) :outertype: UnitDiffInfo :return: the Adjoint Split mode backward Unit that belongs to the given ActivityPattern, or null if no such Unit exists. getSplitForward ^^^^^^^^^^^^^^^ .. java:method:: protected Unit getSplitForward(ActivityPattern pattern) :outertype: UnitDiffInfo :return: the Adjoint Split mode forward Unit that belongs to the given ActivityPattern, or null if no such Unit exists. getTangent ^^^^^^^^^^ .. java:method:: protected Unit getTangent(ActivityPattern pattern) :outertype: UnitDiffInfo :return: the Tangent Unit that belongs to the given ActivityPattern, or null if no such Unit exists. getUnitDiffArgsByValueNeedOnlyIncrementInfoS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected boolean[] getUnitDiffArgsByValueNeedOnlyIncrementInfoS(ActivityPattern pattern) :outertype: UnitDiffInfo For each ActivityPattern of the unit. :return: an array of booleans indexed by rank as a formal parameter (0 for result), which are true when the diff of this argument is passed by value and yet need be overwritten (cf getUnitDiffArgsByValueNeedOverwriteInfoS), but this overwriting of the diff is only an increment of its value and therefore the special differentiation mechanism for passed-by-value arguments may be simplified. getUnitDiffArgsByValueNeedOverwriteInfoS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected boolean[] getUnitDiffArgsByValueNeedOverwriteInfoS(ActivityPattern pattern) :outertype: UnitDiffInfo For each ActivityPattern of the unit :return: an array of booleans indexed by rank as a formal parameter (0 for result), which are true when this argument is passed by value (and therefore its diff too) or is the result, and at the same time the corresponding diff argument (which is thus passed by value) needs to be modified by the diff of the unit (for this ActivityPattern). For instance in C, this will force to change the diff formal parameter from type T_B to T_B*, and pass the address of v instead of actual parameter v. getUnitFormalArgsActivityS ^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected boolean[] getUnitFormalArgsActivityS(ActivityPattern pattern) :outertype: UnitDiffInfo :return: the unitFormalArgsActivityS for the given pattern. For each Pattern, a boolean array that tells if each formal argument is differentiated. hasDiffs ^^^^^^^^ .. java:method:: protected boolean hasDiffs() :outertype: UnitDiffInfo setAdjoint ^^^^^^^^^^ .. java:method:: protected void setAdjoint(ActivityPattern pattern, Unit adjointUnit) :outertype: UnitDiffInfo Set the Adjoint Unit for the given pattern. setDiff ^^^^^^^ .. java:method:: protected void setDiff(Unit diffU) :outertype: UnitDiffInfo Set the differentiated Unit (only for modules?). setSplitBackward ^^^^^^^^^^^^^^^^ .. java:method:: protected void setSplitBackward(ActivityPattern pattern, Unit bwdUnit) :outertype: UnitDiffInfo Set the Backward Unit for the given pattern. setSplitForward ^^^^^^^^^^^^^^^ .. java:method:: protected void setSplitForward(ActivityPattern pattern, Unit fwdUnit) :outertype: UnitDiffInfo Set the Forward Unit for the given pattern. setTangent ^^^^^^^^^^ .. java:method:: protected void setTangent(ActivityPattern pattern, Unit tangentUnit) :outertype: UnitDiffInfo Set the Tangent Unit for the given pattern. setUnitDiffArgsByValueNeedOnlyIncrementInfoS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected void setUnitDiffArgsByValueNeedOnlyIncrementInfoS(ActivityPattern pattern, boolean[] val) :outertype: UnitDiffInfo Set the info that can be retrieved by getUnitDiffArgsByValueNeedOnlyIncrementInfoS(). setUnitDiffArgsByValueNeedOverwriteInfoS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected void setUnitDiffArgsByValueNeedOverwriteInfoS(ActivityPattern pattern, boolean[] val) :outertype: UnitDiffInfo Set the info that can be retrieved by getUnitDiffArgsByValueNeedOverwriteInfoS(). setUnitFormalArgsActivityS ^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected void setUnitFormalArgsActivityS(ActivityPattern pattern, boolean[] args) :outertype: UnitDiffInfo Set the unitFormalArgsActivityS for the given pattern. toString ^^^^^^^^ .. java:method:: @Override public String toString() :outertype: UnitDiffInfo