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

  • 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Javadoc

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove blank line

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@yukiiwashita yukiiwashita deleted the topic/combined-curve branch May 3, 2018 14:12
jodastephen pushed 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
Development

Successfully merging this pull request may close these issues.

None yet

2 participants