public virtual void test_of() { DeformedSurface test = DeformedSurface.of(METADATA, SURFACE_ORG, FUNCTION); assertEquals(test.DeformationFunction, FUNCTION); assertEquals(test.Metadata, METADATA); assertEquals(test.Name, METADATA.SurfaceName); assertEquals(test.OriginalSurface, SURFACE_ORG); assertEquals(test.ParameterCount, SIZE); assertEquals(test.getParameter(2), SURFACE_ORG.getParameter(2)); assertEquals(test.getParameterMetadata(2), SURFACE_ORG.getParameterMetadata(2)); }
public override bool Equals(object obj) { if (obj == this) { return(true); } if (obj != null && obj.GetType() == this.GetType()) { DeformedSurface other = (DeformedSurface)obj; return(JodaBeanUtils.equal(metadata, other.metadata) && JodaBeanUtils.equal(originalSurface, other.originalSurface) && JodaBeanUtils.equal(deformationFunction, other.deformationFunction)); } return(false); }
//------------------------------------------------------------------------- public virtual void coverage() { DeformedSurface test1 = DeformedSurface.of(METADATA, SURFACE_ORG, FUNCTION); coverImmutableBean(test1); Surface surface1 = InterpolatedNodalSurface.of(DefaultSurfaceMetadata.of("TestSurface1"), XVALUES, YVALUES, ZVALUES, INTERPOLATOR); DeformedSurface test2 = DeformedSurface.of(DefaultSurfaceMetadata.of("DeformedTestSurface1"), surface1, (DoublesPair x) => { return(ValueDerivatives.of(surface1.zValue(x), surface1.zValueParameterSensitivity(x).Sensitivity)); }); coverBeanEquals(test1, test2); }
public virtual void test_zValue() { double tol = 1.0e-14; double x = 2.5; double y = 1.44; DeformedSurface test = DeformedSurface.of(METADATA, SURFACE_ORG, FUNCTION); double computedValue1 = test.zValue(x, y); double computedValue2 = test.zValue(DoublesPair.of(x, y)); UnitParameterSensitivity computedSensi1 = test.zValueParameterSensitivity(x, y); UnitParameterSensitivity computedSensi2 = test.zValueParameterSensitivity(DoublesPair.of(x, y)); ValueDerivatives expected = FUNCTION.apply(DoublesPair.of(x, y)); assertEquals(computedValue1, expected.Value); assertEquals(computedValue2, expected.Value); assertTrue(DoubleArrayMath.fuzzyEquals(computedSensi1.Sensitivity.toArray(), expected.Derivatives.toArray(), tol)); assertTrue(DoubleArrayMath.fuzzyEquals(computedSensi2.Sensitivity.toArray(), expected.Derivatives.toArray(), tol)); }
//------------------------------------------------------------------------- /// <summary> /// Obtains an instance. /// </summary> /// <param name="metadata"> the surface metadata </param> /// <param name="originalSurface"> the original surface </param> /// <param name="deformationFunction"> the deformation function </param> /// <returns> the surface </returns> public static DeformedSurface of(SurfaceMetadata metadata, Surface originalSurface, System.Func <DoublesPair, ValueDerivatives> deformationFunction) { return(DeformedSurface.builder().metadata(metadata).originalSurface(originalSurface).deformationFunction(deformationFunction).build()); }
public virtual void test_withParameter() { assertThrowsIllegalArg(() => DeformedSurface.of(METADATA, SURFACE_ORG, FUNCTION).withParameter(1, 1.2d)); }