@Test public void test() { assertEquals(PARAMS.getNumberOfModelParameters(), 4); assertEquals(PARAMS.getNumberOfFittingParameters(), 3); UncoupledParameterTransforms other = new UncoupledParameterTransforms(INIT, NULLS, FIXED); assertEquals(PARAMS, other); assertEquals(PARAMS.hashCode(), other.hashCode()); other = new UncoupledParameterTransforms( new DoubleMatrix1D(new double[] {1, 2, 4, 5}), NULLS, FIXED); assertFalse(other.equals(PARAMS)); other = new UncoupledParameterTransforms( INIT, new ParameterLimitsTransform[] { new DoubleRangeLimitTransform(1, 2), new NullTransform(), new NullTransform(), new NullTransform() }, FIXED); assertFalse(other.equals(PARAMS)); other = new UncoupledParameterTransforms(INIT, NULLS, new BitSet(4)); assertFalse(other.equals(PARAMS)); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testInverseJacobianWrongParameters() { PARAMS.inverseJacobian(new DoubleMatrix1D(new double[] {1, 2})); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testInverseJacobianNullParameters() { PARAMS.inverseJacobian(null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testInverseTransformNullParameters() { PARAMS.inverseTransform(null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testTransformWrongParameters() { PARAMS.transform(new DoubleMatrix1D(new double[] {1, 2})); }
@Test public void testTransformAndInverse() { final DoubleMatrix1D functionParameters = new DoubleMatrix1D(new double[] {1, 2, 6, 4}); assertEquals(PARAMS.inverseTransform(PARAMS.transform(functionParameters)), functionParameters); }