Example #1
0
        //-------------------------------------------------------------------------
        public virtual void test_multipliedBy_currency()
        {
            CurrencyParameterSensitivities multiplied = SENSI_2.multipliedBy(USD, FACTOR1);

            assertEquals(multiplied.size(), 2);
            DoubleArray test1 = multiplied.getSensitivity(NAME1, USD).Sensitivity;

            for (int i = 0; i < VECTOR1.size(); i++)
            {
                assertEquals(test1.get(i), VECTOR2.get(i) * FACTOR1);
            }
            DoubleArray test2 = multiplied.getSensitivity(NAME2, USD).Sensitivity;

            for (int i = 0; i < VECTOR1.size(); i++)
            {
                assertEquals(test2.get(i), VECTOR3.get(i) * FACTOR1);
            }
        }
Example #2
0
        public virtual void test_multipliedBy()
        {
            UnitParameterSensitivities multiplied = SENSI_1.multipliedBy(FACTOR1);
            DoubleArray test = multiplied.Sensitivities.get(0).Sensitivity;

            for (int i = 0; i < VECTOR1.size(); i++)
            {
                assertEquals(test.get(i), VECTOR1.get(i) * FACTOR1);
            }
        }