Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combined curve #1677

Merged
merged 2 commits into from May 3, 2018
Merged

Combined curve #1677

merged 2 commits into from May 3, 2018

Conversation

@yukiiwashita
Copy link
Contributor

@yukiiwashita yukiiwashita commented May 3, 2018

  • Create a new curve class formed of two underlying curves.
  • Add split and withUnderlyingCurve methods to the interface. These will be used curve gamma calculation with the combined curve.
@PropertyDefinition(validate = "notNull")
private final Curve spreadCurve;

@PropertyDefinition(validate = "notNull", overrideGet = true)

This comment has been minimized.

@jodastephen

jodastephen May 3, 2018
Member

Javadoc

// check value type
if (!baseMetadata.getXValueType().equals(metadata.getXValueType())) {
throw new IllegalArgumentException(Messages.format(
"xValueTypee is {} in baseCurve, but {} in CombinedCurve",

This comment has been minimized.

@jodastephen

jodastephen May 3, 2018
Member

Spelling

}
if (!spreadMetadata.getXValueType().equals(metadata.getXValueType())) {
throw new IllegalArgumentException(Messages.format(
"xValueTypee is {} in spreadCurve, but {} in CombinedCurve",

This comment has been minimized.

@jodastephen

jodastephen May 3, 2018
Member

Spelling

}
if (!baseMetadata.getYValueType().equals(metadata.getYValueType())) {
throw new IllegalArgumentException(Messages.format(
"yValueTypee is {} in baseCurve, but {} in CombinedCurve",

This comment has been minimized.

@jodastephen

jodastephen May 3, 2018
Member

Spelling

}
if (!spreadMetadata.getYValueType().equals(metadata.getYValueType())) {
throw new IllegalArgumentException(Messages.format(
"yValueTypee is {} in spreadCurve, but {} in CombinedCurve",

This comment has been minimized.

@jodastephen

jodastephen May 3, 2018
Member

Spelling

baseCurve.withParameter(parameterIndex, newValue),
spreadCurve,
metadata);

This comment has been minimized.

@jodastephen

jodastephen May 3, 2018
Member

Remove blank line

if (curveIndex == 0) {
return curve;
}
return this;

This comment has been minimized.

@jodastephen

jodastephen May 3, 2018
Member

I think it would be better to throw an exception (Javadoc change too)

* @param curve the new split curve
* @return the new curve
*/
public default Curve withUnderlyingCurve(int curveIndex, Curve curve) {

This comment has been minimized.

@jodastephen

jodastephen May 3, 2018
Member

Does these methods not need to be implemented anywhere else? Like AddFixedCurve?

@yukiiwashita yukiiwashita self-assigned this May 3, 2018
@yukiiwashita yukiiwashita merged commit a5faf78 into master May 3, 2018
15 checks passed
15 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
security/snyk No dependency changes
Details
security/snyk - modules/basics/pom.xml No dependency changes
Details
security/snyk - modules/calc/pom.xml No dependency changes
Details
security/snyk - modules/collect/pom.xml No dependency changes
Details
security/snyk - modules/data/pom.xml No dependency changes
Details
security/snyk - modules/loader/pom.xml No dependency changes
Details
security/snyk - modules/market/pom.xml No dependency changes
Details
security/snyk - modules/math/pom.xml No dependency changes
Details
security/snyk - modules/measure/pom.xml No dependency changes
Details
security/snyk - modules/pom.xml No dependency changes
Details
security/snyk - modules/pricer/pom.xml No dependency changes
Details
security/snyk - modules/product/pom.xml No dependency changes
Details
security/snyk - modules/report/pom.xml No dependency changes
Details
@yukiiwashita yukiiwashita deleted the topic/combined-curve branch May 3, 2018
jodastephen added a commit that referenced this pull request May 11, 2018
* combined curve

* addressed review comments
@jodastephen jodastephen modified the milestones: v1.8, v2.0 Jun 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants