INTERFACE NewDerivatives2D (* SHAPE Attributes2D *); IMPORT Neighborhood2D; CONST N = 6; (* Number of derivatives *) TYPE T = ARRAY [0..N-1] OF REAL; (* Set of derivatives at a texel *) PROCEDURE FromNeighborhood(READONLY z: Neighborhood.T; VAR (*OUT*) a: T); (* Estimates the local derivatives at a texel from its neighborhood. *) PROCEDURE EnergyAndStateForcesFromStateNeigborhood( READONLY z: ARRAY OF Neighborhood2D.T; (* Multi-layer neighborhood *) energy: LocalEvaluator.T; (* Local energy evaluator *) VAR (*OUT*) E: LONGREAL; (* Computed local energy *) VAR (*OUT*) dEdz: ARRAY OF Neighborhood2D.T; (* Derivatives of "E" rel.to "z" *) ); (* Computes the energy term associated with one texel, and its partial derivatives relative to the texel values, from the texel's neighborhood. *) TYPE Evaluator = OBJECT METHODS eval (READONLY p: ARRAY OF T; VAR E: LONGREAL; VAR dEdp: ARRAY OF T); (* Given the attributes in the neighborhood of a texel, in all layers, computes the corresponding local term of the energy function, and its derivatives relative to each attribute. *) print (wr: Wr.T); (* Prints a description of the energy evaluation function *) END; BEGIN END NewDerivatives2D.