├── .gitignore ├── README.rst ├── build.sbt ├── doc └── README.do.txt ├── jquantlib-contrib └── src │ └── main │ └── java │ └── org │ └── jquantlib │ └── math │ └── randomnumbers │ └── XorShiftRandom.java ├── jquantlib-helpers └── src │ ├── main │ └── java │ │ └── org │ │ └── jquantlib │ │ ├── helpers │ │ ├── CRRAmericanDividendOptionHelper.java │ │ ├── CRRDividendOptionHelper.java │ │ ├── CRREuropeanDividendOptionHelper.java │ │ ├── FDAmericanDividendOptionHelper.java │ │ ├── FDDividendOptionHelper.java │ │ └── FDEuropeanDividendOptionHelper.java │ │ ├── methods │ │ └── lattices │ │ │ └── BlackScholesDividendLattice.java │ │ └── pricingengines │ │ └── vanilla │ │ └── BinomialDividendVanillaEngine.java │ └── test │ └── java │ └── org │ └── jquantlib │ └── testsuite │ └── helpers │ ├── CRRDividendOptionTest.java │ └── FDDividendOptionTest.java ├── jquantlib-ooplugin ├── build.xml ├── nbproject │ ├── build-impl.xml │ ├── build-uno-impl.xml │ ├── genfiles.properties │ ├── private │ │ ├── config.properties │ │ ├── private.properties │ │ └── private.xml │ ├── project-uno.properties │ ├── project.properties │ └── project.xml ├── registry │ └── data │ │ └── org │ │ └── openoffice │ │ └── Office │ │ └── CalcAddins.xcu └── src │ ├── description.xml │ ├── org │ └── jquantlib │ │ ├── CentralRegistrationClass.java │ │ ├── Configuration.java │ │ ├── JQAddIn.idl │ │ ├── JQAddInImpl.java │ │ ├── Settings.java │ │ ├── XJQAddIn.idl │ │ └── ooimpl │ │ ├── MathHelper.java │ │ └── OptionHelper.java │ └── uno-extension-manifest.xml ├── jquantlib-samples └── src │ ├── main │ └── java │ │ └── org │ │ └── jquantlib │ │ └── samples │ │ ├── AllSamples.java │ │ ├── BermudanSwaption.java │ │ ├── Bonds.java │ │ ├── Calendars.java │ │ ├── ConvertibleBonds.java │ │ ├── CoxRossWithHullWhite.java │ │ ├── Dates.java │ │ ├── DiscreteHedging.java │ │ ├── EquityOptions.java │ │ ├── FRA.java │ │ ├── Processes.java │ │ ├── Replication.java │ │ ├── Repo.java │ │ ├── SobolChartSample.java │ │ ├── Swap.java │ │ ├── VolatilityTermStructures.java │ │ ├── YieldCurveTermStructures.java │ │ └── util │ │ ├── ReplicationError.java │ │ ├── ReplicationPathPricer.java │ │ └── StopClock.java │ └── test │ └── java │ └── org │ └── jquantlib │ └── samples │ └── TestSamples.java ├── jquantlib ├── .checkstyle ├── .fbprefs ├── LICENSE.TXT ├── README.txt └── src │ ├── main │ └── java │ │ └── org │ │ └── jquantlib │ │ ├── JQuantLib.java │ │ ├── QL.java │ │ ├── SavedSettings.java │ │ ├── Settings.java │ │ ├── cashflow │ │ ├── AverageBMACoupon.java │ │ ├── AverageBMACouponPricer.java │ │ ├── AverageBMALeg.java │ │ ├── BlackIborCouponPricer.java │ │ ├── Callability.java │ │ ├── CappedFlooredCmsCoupon.java │ │ ├── CappedFlooredCoupon.java │ │ ├── CappedFlooredIborCoupon.java │ │ ├── CashFlow.java │ │ ├── CashFlows.java │ │ ├── CmsCoupon.java │ │ ├── CmsCouponPricer.java │ │ ├── CmsLeg.java │ │ ├── Coupon.java │ │ ├── Dividend.java │ │ ├── Event.java │ │ ├── FixedDividend.java │ │ ├── FixedRateCoupon.java │ │ ├── FixedRateLeg.java │ │ ├── FloatingLeg.java │ │ ├── FloatingRateCoupon.java │ │ ├── FloatingRateCouponPricer.java │ │ ├── FractionalDividend.java │ │ ├── IborCoupon.java │ │ ├── IborCouponPricer.java │ │ ├── IborLeg.java │ │ ├── Leg.java │ │ ├── PricerSetter.java │ │ └── SimpleCashFlow.java │ │ ├── currencies │ │ ├── Africa.java │ │ ├── America.java │ │ ├── Asia.java │ │ ├── Currency.java │ │ ├── Europe.java │ │ ├── ExchangeRate.java │ │ ├── ExchangeRateManager.java │ │ ├── Money.java │ │ └── Oceania.java │ │ ├── daycounters │ │ ├── Actual360.java │ │ ├── Actual365Fixed.java │ │ ├── ActualActual.java │ │ ├── Business252.java │ │ ├── DayCounter.java │ │ ├── SimpleDayCounter.java │ │ └── Thirty360.java │ │ ├── exercise │ │ ├── AmericanExercise.java │ │ ├── BermudanExercise.java │ │ ├── EarlyExercise.java │ │ ├── EuropeanExercise.java │ │ └── Exercise.java │ │ ├── experimental │ │ └── lattices │ │ │ ├── ExtendedAdditiveEQPBinomialTree.java │ │ │ ├── ExtendedBinomialTree.java │ │ │ ├── ExtendedCoxRossRubinstein.java │ │ │ ├── ExtendedEqualJumpsBinomialTree.java │ │ │ ├── ExtendedEqualProbabilitiesBinomialTree.java │ │ │ ├── ExtendedJarrowRudd.java │ │ │ ├── ExtendedJoshi4.java │ │ │ ├── ExtendedLeisenReimer.java │ │ │ ├── ExtendedTian.java │ │ │ └── ExtendedTrigeorgis.java │ │ ├── indexes │ │ ├── AustraliaRegion.java │ │ ├── BMAIndex.java │ │ ├── ChfLiborSwapIsdaFix.java │ │ ├── DailyTenorEURLibor.java │ │ ├── DailyTenorEURLiborON.java │ │ ├── DailyTenorEuribor.java │ │ ├── DailyTenorEuribor365.java │ │ ├── EURLibor.java │ │ ├── EURLibor10M.java │ │ ├── EURLibor11M.java │ │ ├── EURLibor1M.java │ │ ├── EURLibor1Y.java │ │ ├── EURLibor2M.java │ │ ├── EURLibor2W.java │ │ ├── EURLibor3M.java │ │ ├── EURLibor4M.java │ │ ├── EURLibor5M.java │ │ ├── EURLibor6M.java │ │ ├── EURLibor7M.java │ │ ├── EURLibor8M.java │ │ ├── EURLibor9M.java │ │ ├── EURLiborSW.java │ │ ├── EURegion.java │ │ ├── EurLiborSwapIfrFix.java │ │ ├── EurLiborSwapIsdaFixA.java │ │ ├── EurLiborSwapIsdaFixB.java │ │ ├── Euribor.java │ │ ├── Euribor10M.java │ │ ├── Euribor11M.java │ │ ├── Euribor1M.java │ │ ├── Euribor1Y.java │ │ ├── Euribor2M.java │ │ ├── Euribor2W.java │ │ ├── Euribor365.java │ │ ├── Euribor365_10M.java │ │ ├── Euribor365_11M.java │ │ ├── Euribor365_1M.java │ │ ├── Euribor365_1Y.java │ │ ├── Euribor365_2M.java │ │ ├── Euribor365_2W.java │ │ ├── Euribor365_3M.java │ │ ├── Euribor365_3W.java │ │ ├── Euribor365_4M.java │ │ ├── Euribor365_5M.java │ │ ├── Euribor365_6M.java │ │ ├── Euribor365_7M.java │ │ ├── Euribor365_8M.java │ │ ├── Euribor365_9M.java │ │ ├── Euribor365_SW.java │ │ ├── Euribor3M.java │ │ ├── Euribor3W.java │ │ ├── Euribor4M.java │ │ ├── Euribor5M.java │ │ ├── Euribor6M.java │ │ ├── Euribor7M.java │ │ ├── Euribor8M.java │ │ ├── Euribor9M.java │ │ ├── EuriborSW.java │ │ ├── EuriborSwapIfrFix.java │ │ ├── EuriborSwapIsdaFixA.java │ │ ├── EuriborSwapIsdaFixB.java │ │ ├── FranceRegion.java │ │ ├── GbpLiborSwapIsdaFix.java │ │ ├── IborIndex.java │ │ ├── Index.java │ │ ├── IndexManager.java │ │ ├── InflationIndex.java │ │ ├── InterestRateIndex.java │ │ ├── JpyLiborSwapIsdaFixAm.java │ │ ├── JpyLiborSwapIsdaFixPm.java │ │ ├── Region.java │ │ ├── SwapIndex.java │ │ ├── UKRegion.java │ │ ├── UsdLiborSwapIsdaFixAm.java │ │ ├── UsdLiborSwapIsdaFixPm.java │ │ ├── YoYInflationIndex.java │ │ ├── ZeroInflationIndex.java │ │ ├── ibor │ │ │ ├── AUDLibor.java │ │ │ ├── CADLibor.java │ │ │ ├── CADLiborON.java │ │ │ ├── CHFLibor.java │ │ │ ├── Cdor.java │ │ │ ├── DKKLibor.java │ │ │ ├── DailyTenorCHFLibor.java │ │ │ ├── DailyTenorGBPLibor.java │ │ │ ├── DailyTenorJPYLibor.java │ │ │ ├── DailyTenorLibor.java │ │ │ ├── DailyTenorUSDLibor.java │ │ │ ├── GBPLibor.java │ │ │ ├── GBPLiborON.java │ │ │ ├── JPYLibor.java │ │ │ ├── Jibar.java │ │ │ ├── Libor.java │ │ │ ├── NZDLibor.java │ │ │ ├── SEKLibor.java │ │ │ ├── TRLibor.java │ │ │ ├── Tibor.java │ │ │ ├── USDLibor.java │ │ │ ├── USDLiborON.java │ │ │ └── Zibor.java │ │ └── inflation │ │ │ ├── EUHICP.java │ │ │ ├── UKRPI.java │ │ │ ├── YYEUHICP.java │ │ │ ├── YYEUHICPr.java │ │ │ ├── YYUKRPI.java │ │ │ └── YYUKRPIr.java │ │ ├── instruments │ │ ├── AssetOrNothingPayoff.java │ │ ├── AverageType.java │ │ ├── BMASwap.java │ │ ├── BarrierOption.java │ │ ├── BarrierType.java │ │ ├── Bond.java │ │ ├── CallabilitySchedule.java │ │ ├── CapFloor.java │ │ ├── CashOrNothingPayoff.java │ │ ├── ContinuousAveragingAsianOption.java │ │ ├── DiscreteAveragingAsianOption.java │ │ ├── DiscretizedAsset.java │ │ ├── DiscretizedDiscountBond.java │ │ ├── DiscretizedOption.java │ │ ├── DividendSchedule.java │ │ ├── DividendVanillaOption.java │ │ ├── EarlierThanCashFlowComparator.java │ │ ├── EuropeanOption.java │ │ ├── Forward.java │ │ ├── ForwardRateAgreement.java │ │ ├── ForwardTypePayoff.java │ │ ├── GapPayoff.java │ │ ├── ImpliedVolatilityHelper.java │ │ ├── Instrument.java │ │ ├── MakeVanillaSwap.java │ │ ├── NullPayoff.java │ │ ├── OneAssetOption.java │ │ ├── Option.java │ │ ├── Payoff.java │ │ ├── PlainVanillaPayoff.java │ │ ├── Position.java │ │ ├── PriceError.java │ │ ├── Settlement.java │ │ ├── Stock.java │ │ ├── StrikedTypePayoff.java │ │ ├── Swap.java │ │ ├── Swaption.java │ │ ├── TypePayoff.java │ │ ├── VanillaOption.java │ │ ├── VanillaSwap.java │ │ └── bonds │ │ │ ├── CmsRateBond.java │ │ │ ├── ConvertibleBond.java │ │ │ ├── ConvertibleBondOption.java │ │ │ ├── ConvertibleFixedCouponBond.java │ │ │ ├── ConvertibleFloatingRateBond.java │ │ │ ├── ConvertibleZeroCouponBond.java │ │ │ ├── FixedRateBond.java │ │ │ ├── FloatingRateBond.java │ │ │ ├── SoftCallability.java │ │ │ └── ZeroCouponBond.java │ │ ├── lang │ │ ├── annotation │ │ │ ├── CompoundFactor.java │ │ │ ├── Covariance.java │ │ │ ├── Diffusion.java │ │ │ ├── DiscountFactor.java │ │ │ ├── Drift.java │ │ │ ├── Expectation.java │ │ │ ├── Natural.java │ │ │ ├── NonNegative.java │ │ │ ├── PackagePrivate.java │ │ │ ├── QualityAssurance.java │ │ │ ├── Rate.java │ │ │ ├── Real.java │ │ │ ├── Spread.java │ │ │ ├── StdDev.java │ │ │ ├── Time.java │ │ │ ├── Typedef.java │ │ │ ├── Unsigned.java │ │ │ ├── Unused.java │ │ │ ├── Variance.java │ │ │ └── Volatility.java │ │ ├── exceptions │ │ │ └── LibraryException.java │ │ ├── iterators │ │ │ └── Iterables.java │ │ └── reflect │ │ │ ├── DynamicProxyInvocationHandler.java │ │ │ └── ReflectConstants.java │ │ ├── legacy │ │ └── libormarkets │ │ │ ├── LfmCovarianceProxy.java │ │ │ ├── LmCorrelationModel.java │ │ │ ├── LmFixedVolatilityModel.java │ │ │ ├── LmLinearExponentialCorrelationModel.java │ │ │ ├── LmLinearExponentialVolatilityModel.java │ │ │ └── LmVolatilityModel.java │ │ ├── math │ │ ├── AbstractSolver1D.java │ │ ├── Beta.java │ │ ├── Closeness.java │ │ ├── Constants.java │ │ ├── ErrorFunction.java │ │ ├── Factorial.java │ │ ├── Grid.java │ │ ├── IntervalPrice.java │ │ ├── LogGrid.java │ │ ├── Ops.java │ │ ├── PdeShortRate.java │ │ ├── PrimeNumbers.java │ │ ├── RegularisedIncompleteBeta.java │ │ ├── Rounding.java │ │ ├── SampledCurve.java │ │ ├── TransformedGrid.java │ │ ├── distributions │ │ │ ├── BinomialDistribution.java │ │ │ ├── BivariateNormalDistribution.java │ │ │ ├── CumulativeBinomialDistribution.java │ │ │ ├── CumulativeNormalDistribution.java │ │ │ ├── CumulativePoissonDistribution.java │ │ │ ├── Derivative.java │ │ │ ├── GammaDistribution.java │ │ │ ├── GammaFunction.java │ │ │ ├── IncompleteGamma.java │ │ │ ├── InverseCumulativeNormal.java │ │ │ ├── InverseCumulativePoisson.java │ │ │ ├── MoroInverseCumulativeNormal.java │ │ │ ├── NonCentralChiSquaredDistribution.java │ │ │ ├── NormalDistribution.java │ │ │ └── PoissonDistribution.java │ │ ├── functions │ │ │ ├── Abs.java │ │ │ ├── Bind1st.java │ │ │ ├── Bind1stPredicate.java │ │ │ ├── Bind2nd.java │ │ │ ├── Bind2ndPredicate.java │ │ │ ├── Clipped.java │ │ │ ├── CloseEnough.java │ │ │ ├── ComposedFunction.java │ │ │ ├── Constant.java │ │ │ ├── Cos.java │ │ │ ├── Cube.java │ │ │ ├── Everywhere.java │ │ │ ├── Exp.java │ │ │ ├── Expression.java │ │ │ ├── FalsePredicate.java │ │ │ ├── FindIf.java │ │ │ ├── Fourth.java │ │ │ ├── GreaterEqualPredicate.java │ │ │ ├── GreaterThanPredicate.java │ │ │ ├── Identity.java │ │ │ ├── LessEqualPredicate.java │ │ │ ├── LessThanPredicate.java │ │ │ ├── Log.java │ │ │ ├── Minus.java │ │ │ ├── Nowhere.java │ │ │ ├── Sin.java │ │ │ ├── Sqrt.java │ │ │ ├── Square.java │ │ │ └── TruePredicate.java │ │ ├── integrals │ │ │ ├── GaussKronrodAdaptive.java │ │ │ ├── GaussKronrodNonAdaptive.java │ │ │ ├── GaussKronrodPatterson.java │ │ │ ├── Integrator.java │ │ │ ├── KronrodIntegral.java │ │ │ ├── SegmentIntegral.java │ │ │ ├── SimpsonIntegral.java │ │ │ ├── TabulatedGaussLegendre.java │ │ │ └── TrapezoidIntegral.java │ │ ├── interpolations │ │ │ ├── AbstractInterpolation.java │ │ │ ├── AbstractInterpolation2D.java │ │ │ ├── BackwardFlatInterpolation.java │ │ │ ├── BicubicSplineInterpolation.java │ │ │ ├── BilinearInterpolation.java │ │ │ ├── CubicInterpolation.java │ │ │ ├── DefaultExtrapolator.java │ │ │ ├── Extrapolator.java │ │ │ ├── FlatExtrapolator2D.java │ │ │ ├── ForwardFlatInterpolation.java │ │ │ ├── Interpolation.java │ │ │ ├── Interpolation2D.java │ │ │ ├── LinearInterpolation.java │ │ │ ├── LogCubicInterpolation.java │ │ │ ├── LogLinearInterpolation.java │ │ │ ├── MonotonicNaturalCubicInterpolation.java │ │ │ ├── NaturalCubicInterpolation.java │ │ │ ├── SABRInterpolation.java │ │ │ └── factories │ │ │ │ ├── BackwardFlat.java │ │ │ │ ├── BicubicSpline.java │ │ │ │ ├── Bilinear.java │ │ │ │ ├── Cubic.java │ │ │ │ ├── ForwardFlat.java │ │ │ │ ├── Linear.java │ │ │ │ ├── LogCubic.java │ │ │ │ └── LogLinear.java │ │ ├── matrixutilities │ │ │ ├── Algebra.java │ │ │ ├── Array.java │ │ │ ├── BasisIncompleteOrdered.java │ │ │ ├── Cells.java │ │ │ ├── CholeskyDecomposition.java │ │ │ ├── EigenvalueDecomposition.java │ │ │ ├── HypersphereCostFunction.java │ │ │ ├── Identity.java │ │ │ ├── LUDecomposition.java │ │ │ ├── Matrix.java │ │ │ ├── PseudoSqrt.java │ │ │ ├── QRDecomposition.java │ │ │ ├── SVD.java │ │ │ ├── SymmetricSchurDecomposition.java │ │ │ └── internal │ │ │ │ ├── Address.java │ │ │ │ ├── DirectAddress.java │ │ │ │ ├── DirectArrayColAddress.java │ │ │ │ ├── DirectArrayRowAddress.java │ │ │ │ ├── DirectMatrixAddress.java │ │ │ │ ├── MappedAddress.java │ │ │ │ └── MappedMatrixAddress.java │ │ ├── optimization │ │ │ ├── ArmijoLineSearch.java │ │ │ ├── BoundaryConstraint.java │ │ │ ├── CompositeConstraint.java │ │ │ ├── ConjugateGradient.java │ │ │ ├── Constraint.java │ │ │ ├── CostFunction.java │ │ │ ├── EndCriteria.java │ │ │ ├── LeastSquareFunction.java │ │ │ ├── LeastSquareProblem.java │ │ │ ├── LevenbergMarquardt.java │ │ │ ├── LineSearch.java │ │ │ ├── LineSearchBasedMethod.java │ │ │ ├── Minpack.java │ │ │ ├── NoConstraint.java │ │ │ ├── NonLinearLeastSquare.java │ │ │ ├── OptimizationMethod.java │ │ │ ├── ParametersTransformation.java │ │ │ ├── PositiveConstraint.java │ │ │ ├── Problem.java │ │ │ ├── ProjectedCostFunction.java │ │ │ ├── Simplex.java │ │ │ ├── SphereCylinderOptimizer.java │ │ │ └── SteepestDescent.java │ │ ├── randomnumbers │ │ │ ├── GenericLowDiscrepancy.java │ │ │ ├── GenericPseudoRandom.java │ │ │ ├── InverseCumulative.java │ │ │ ├── InverseCumulativeRng.java │ │ │ ├── InverseCumulativeRsg.java │ │ │ ├── MersenneTwisterUniformRng.java │ │ │ ├── PrimitivePolynomials.java │ │ │ ├── PseudoRandom.java │ │ │ ├── RandomNumberGenerator.java │ │ │ ├── RandomSequenceGenerator.java │ │ │ ├── RandomSequenceGeneratorIntf.java │ │ │ ├── SeedGenerator.java │ │ │ ├── SobolRsg.java │ │ │ └── UniformRandomSequenceGenerator.java │ │ ├── solvers1D │ │ │ ├── Bisection.java │ │ │ ├── Brent.java │ │ │ ├── FalsePosition.java │ │ │ ├── Newton.java │ │ │ ├── NewtonSafe.java │ │ │ ├── Ridder.java │ │ │ └── Secant.java │ │ └── statistics │ │ │ ├── ConvergenceStatistics.java │ │ │ ├── DiscrepancyStatistics.java │ │ │ ├── GaussianStatistics.java │ │ │ ├── GeneralStatistics.java │ │ │ ├── GenericGaussianStatistics.java │ │ │ ├── GenericRiskStatistics.java │ │ │ ├── GenericSequenceStatistics.java │ │ │ ├── IncrementalStatistics.java │ │ │ ├── RiskStatistics.java │ │ │ ├── SequenceStatistics.java │ │ │ └── Statistics.java │ │ ├── methods │ │ ├── finitedifferences │ │ │ ├── AmericanCondition.java │ │ │ ├── BSMOperator.java │ │ │ ├── BSMTermOperator.java │ │ │ ├── BoundaryCondition.java │ │ │ ├── BoundaryConditionSet.java │ │ │ ├── CrankNicolson.java │ │ │ ├── CurveDependentStepCondition.java │ │ │ ├── DMinus.java │ │ │ ├── DPlus.java │ │ │ ├── DPlusMinus.java │ │ │ ├── DZero.java │ │ │ ├── DirichletBC.java │ │ │ ├── DynamicPdeSecondOrderParabolic.java │ │ │ ├── ExplicitEuler.java │ │ │ ├── FiniteDifferenceModel.java │ │ │ ├── GenericTimeSetter.java │ │ │ ├── MixedScheme.java │ │ │ ├── NeumannBC.java │ │ │ ├── NullCondition.java │ │ │ ├── Operator.java │ │ │ ├── OperatorFactory.java │ │ │ ├── ParallelEvolver.java │ │ │ ├── Pde.java │ │ │ ├── PdeBSM.java │ │ │ ├── PdeConstantCoeff.java │ │ │ ├── PdeOperator.java │ │ │ ├── PdeSecondOrderParabolic.java │ │ │ ├── PdeTypeUtil.java │ │ │ ├── ShoutCondition.java │ │ │ ├── StandardFiniteDifferenceModel.java │ │ │ ├── StandardSystemFiniteDifferenceModel.java │ │ │ ├── StepCondition.java │ │ │ ├── StepConditionSet.java │ │ │ ├── TridiagonalOperator.java │ │ │ └── ZeroCondition.java │ │ ├── lattices │ │ │ ├── AdditiveEQPBinomialTree.java │ │ │ ├── BinomialTree.java │ │ │ ├── BlackScholesLattice.java │ │ │ ├── CoxRossRubinstein.java │ │ │ ├── EqualJumpsBinomialTree.java │ │ │ ├── EqualProbabilitiesBinomialTree.java │ │ │ ├── JarrowRudd.java │ │ │ ├── Joshi4.java │ │ │ ├── Lattice.java │ │ │ ├── LeisenReimer.java │ │ │ ├── Tian.java │ │ │ ├── Tree.java │ │ │ ├── TreeLattice.java │ │ │ ├── TreeLattice1D.java │ │ │ ├── TreeLattice2D.java │ │ │ ├── Trigeorgis.java │ │ │ ├── TrinomialTree.java │ │ │ └── TsiveriotisFernandesLattice.java │ │ └── montecarlo │ │ │ ├── BrownianBridge.java │ │ │ ├── MonteCarloModel.java │ │ │ ├── MultiVariate.java │ │ │ ├── Path.java │ │ │ ├── PathGenerator.java │ │ │ ├── PathPricer.java │ │ │ ├── Sample.java │ │ │ ├── SingleVariate.java │ │ │ ├── Variate.java │ │ │ ├── monte-carlo.png │ │ │ └── monte-carlo.xmi │ │ ├── model │ │ ├── AffineModel.java │ │ ├── CalibratedModel.java │ │ ├── CalibrationHelper.java │ │ ├── ConstantParameter.java │ │ ├── NullParameter.java │ │ ├── Parameter.java │ │ ├── PiecewiseConstantParameter.java │ │ ├── TermStructureConsistentModel.java │ │ ├── TermStructureFittingParameter.java │ │ ├── equity │ │ │ ├── BatesDoubleExpModel.java │ │ │ ├── BatesModel.java │ │ │ └── HestonModel.java │ │ ├── marketmodels │ │ │ ├── AccountingEngine.java │ │ │ ├── BrownianGenerator.java │ │ │ ├── BrownianGeneratorFactory.java │ │ │ ├── CurveState.java │ │ │ └── MarketModelEvolver.java │ │ ├── shortrate │ │ │ ├── ShortRateModel.java │ │ │ ├── StochasticProcessArray.java │ │ │ ├── calibrationhelpers │ │ │ │ ├── CapHelper.java │ │ │ │ └── SwaptionHelper.java │ │ │ ├── onefactormodels │ │ │ │ ├── BlackKarasinski.java │ │ │ │ ├── CoxIngersollRoss.java │ │ │ │ ├── ExtendedCoxIngersollRoss.java │ │ │ │ ├── HullWhite.java │ │ │ │ ├── OneFactorAffineModel.java │ │ │ │ ├── OneFactorModel.java │ │ │ │ ├── TermStructureConsistentModel.java │ │ │ │ ├── TermStructureConsistentModelClass.java │ │ │ │ └── Vasicek.java │ │ │ └── twofactormodels │ │ │ │ ├── G2.java │ │ │ │ └── TwoFactorModel.java │ │ └── volatility │ │ │ ├── ConstantEstimator.java │ │ │ ├── Garch11.java │ │ │ ├── GarmanKlassAbstract.java │ │ │ ├── GarmanKlassOpenClose.java │ │ │ ├── GarmanKlassSigma1.java │ │ │ ├── GarmanKlassSigma3.java │ │ │ ├── GarmanKlassSigma4.java │ │ │ ├── GarmanKlassSigma5.java │ │ │ ├── GarmanKlassSigma6.java │ │ │ ├── GarmanKlassSimpleSigma.java │ │ │ ├── LocalVolatilityEstimator.java │ │ │ ├── ParkinsonSigma.java │ │ │ ├── SimpleLocalEstimator.java │ │ │ └── VolatilityCompositor.java │ │ ├── pricingengines │ │ ├── AmericanPayoffAtExpiry.java │ │ ├── AmericanPayoffAtHit.java │ │ ├── AnalyticEuropeanEngine.java │ │ ├── BinomialConvertibleEngine.java │ │ ├── BlackCalculator.java │ │ ├── BlackFormula.java │ │ ├── GenericEngine.java │ │ ├── GenericModelEngine.java │ │ ├── MCSimulation.java │ │ ├── PricingEngine.java │ │ ├── asian │ │ │ ├── AnalyticContinuousGeometricAveragePriceAsianEngine.java │ │ │ └── AnalyticDiscreteGeometricAveragePriceAsianEngine.java │ │ ├── barrier │ │ │ └── AnalyticBarrierEngine.java │ │ ├── bond │ │ │ └── DiscountingBondEngine.java │ │ ├── capfloor │ │ │ ├── AnalyticCapFloorEngine.java │ │ │ └── BlackCapFloorEngine.java │ │ ├── hybrid │ │ │ └── DiscretizedConvertible.java │ │ ├── swap │ │ │ └── DiscountingSwapEngine.java │ │ └── vanilla │ │ │ ├── AnalyticDividendEuropeanEngine.java │ │ │ ├── BaroneAdesiWhaleyApproximationEngine.java │ │ │ ├── BinomialVanillaEngine.java │ │ │ ├── BjerksundStenslandApproximationEngine.java │ │ │ ├── DiscretizedVanillaOption.java │ │ │ ├── IntegralEngine.java │ │ │ ├── JuQuadraticApproximationEngine.java │ │ │ ├── JumpDiffusionEngine.java │ │ │ ├── MCEuropeanEngine.java │ │ │ ├── MCVanillaEngine.java │ │ │ └── finitedifferences │ │ │ ├── FDAmericanCondition.java │ │ │ ├── FDAmericanEngine.java │ │ │ ├── FDBermudanEngine.java │ │ │ ├── FDDividendAmericanEngine.java │ │ │ ├── FDDividendEngine.java │ │ │ ├── FDDividendEngineBase.java │ │ │ ├── FDDividendEngineMerton73.java │ │ │ ├── FDDividendEuropeanEngine.java │ │ │ ├── FDEngineAdapter.java │ │ │ ├── FDEuropeanEngine.java │ │ │ ├── FDMultiPeriodEngine.java │ │ │ ├── FDShoutCondition.java │ │ │ ├── FDShoutEngine.java │ │ │ ├── FDStepConditionEngine.java │ │ │ ├── FDVanillaEngine.java │ │ │ └── PayoffFunction.java │ │ ├── processes │ │ ├── BlackScholesMertonProcess.java │ │ ├── EulerDiscretization.java │ │ ├── ForwardMeasureProcess.java │ │ ├── ForwardMeasureProcess1D.java │ │ ├── GeneralizedBlackScholesProcess.java │ │ ├── GeometricBrownianMotionProcess.java │ │ ├── HestonProcess.java │ │ ├── HullWhiteForwardProcess.java │ │ ├── HullWhiteProcess.java │ │ ├── LfmCovarianceParameterization.java │ │ ├── LiborForwardModelProcess.java │ │ ├── Merton76Process.java │ │ ├── OrnsteinUhlenbeckProcess.java │ │ ├── StochasticProcess.java │ │ └── StochasticProcess1D.java │ │ ├── quotes │ │ ├── Handle.java │ │ ├── Quote.java │ │ ├── RelinkableHandle.java │ │ └── SimpleQuote.java │ │ ├── termstructures │ │ ├── AbstractTermStructure.java │ │ ├── AbstractYieldTermStructure.java │ │ ├── BlackVarianceTermStructure.java │ │ ├── BlackVolTermStructure.java │ │ ├── BlackVolatilityTermStructure.java │ │ ├── Bootstrap.java │ │ ├── BootstrapError.java │ │ ├── BootstrapHelper.java │ │ ├── BootstrapHelperSorter.java │ │ ├── CapVolatilityStructure.java │ │ ├── CapletVarianceCurve.java │ │ ├── Compounding.java │ │ ├── InflationTermStructure.java │ │ ├── InterestRate.java │ │ ├── IterativeBootstrap.java │ │ ├── LocalBootstrap.java │ │ ├── LocalVolTermStructure.java │ │ ├── RateHelper.java │ │ ├── RateHelperSorter.java │ │ ├── SwaptionVolatilityStructure.java │ │ ├── TermStructure.java │ │ ├── YieldTermStructure.java │ │ ├── YoYInflationTermStructure.java │ │ ├── ZeroInflationTermStructure.java │ │ ├── volatilities │ │ │ ├── BlackConstantVol.java │ │ │ ├── BlackVarianceCurve.java │ │ │ ├── BlackVarianceSurface.java │ │ │ ├── FlatSmileSection.java │ │ │ ├── ImpliedVolTermStructure.java │ │ │ ├── LocalConstantVol.java │ │ │ ├── LocalVolCurve.java │ │ │ ├── LocalVolSurface.java │ │ │ ├── Sabr.java │ │ │ ├── SmileSection.java │ │ │ ├── VolatilityTermStructure.java │ │ │ └── optionlet │ │ │ │ ├── ConstantOptionletVolatility.java │ │ │ │ └── OptionletVolatilityStructure.java │ │ └── yieldcurves │ │ │ ├── BMASwapRateHelper.java │ │ │ ├── DepositRateHelper.java │ │ │ ├── Discount.java │ │ │ ├── FixedRateBondHelper.java │ │ │ ├── FlatForward.java │ │ │ ├── ForwardRate.java │ │ │ ├── ForwardRateStructure.java │ │ │ ├── ForwardSpreadedTermStructure.java │ │ │ ├── FraRateHelper.java │ │ │ ├── FuturesRateHelper.java │ │ │ ├── ImpliedTermStructure.java │ │ │ ├── InterpolatedDiscountCurve.java │ │ │ ├── InterpolatedForwardCurve.java │ │ │ ├── InterpolatedZeroCurve.java │ │ │ ├── PiecewiseCurve.java │ │ │ ├── PiecewiseYieldCurve.java │ │ │ ├── RelativeDateRateHelper.java │ │ │ ├── SwapRateHelper.java │ │ │ ├── Traits.java │ │ │ ├── ZeroSpreadedTermStructure.java │ │ │ ├── ZeroYield.java │ │ │ └── ZeroYieldStructure.java │ │ ├── time │ │ ├── BusinessDayConvention.java │ │ ├── Calendar.java │ │ ├── Date.java │ │ ├── DateGeneration.java │ │ ├── DateParser.java │ │ ├── Frequency.java │ │ ├── IMM.java │ │ ├── MakeSchedule.java │ │ ├── Month.java │ │ ├── Period.java │ │ ├── PeriodParser.java │ │ ├── Schedule.java │ │ ├── Series.java │ │ ├── TimeGrid.java │ │ ├── TimeSeries.java │ │ ├── TimeUnit.java │ │ ├── Weekday.java │ │ └── calendars │ │ │ ├── Argentina.java │ │ │ ├── Australia.java │ │ │ ├── Brazil.java │ │ │ ├── Canada.java │ │ │ ├── China.java │ │ │ ├── CzechRepublic.java │ │ │ ├── Denmark.java │ │ │ ├── Finland.java │ │ │ ├── Germany.java │ │ │ ├── HongKong.java │ │ │ ├── Hungary.java │ │ │ ├── Iceland.java │ │ │ ├── India.java │ │ │ ├── Indonesia.java │ │ │ ├── Italy.java │ │ │ ├── Japan.java │ │ │ ├── JointCalendar.java │ │ │ ├── Mexico.java │ │ │ ├── NewZealand.java │ │ │ ├── Norway.java │ │ │ ├── NullCalendar.java │ │ │ ├── Poland.java │ │ │ ├── SaudiArabia.java │ │ │ ├── Singapore.java │ │ │ ├── Slovakia.java │ │ │ ├── SouthAfrica.java │ │ │ ├── SouthKorea.java │ │ │ ├── Sweden.java │ │ │ ├── Switzerland.java │ │ │ ├── Taiwan.java │ │ │ ├── Target.java │ │ │ ├── Turkey.java │ │ │ ├── Ukraine.java │ │ │ ├── UnitedKingdom.java │ │ │ └── UnitedStates.java │ │ └── util │ │ ├── ComparablePair.java │ │ ├── DefaultObservable.java │ │ ├── LazyObject.java │ │ ├── Observable.java │ │ ├── ObservableValue.java │ │ ├── Observer.java │ │ ├── Pair.java │ │ ├── PolymorphicVisitable.java │ │ ├── PolymorphicVisitor.java │ │ ├── Std.java │ │ ├── Visitable.java │ │ ├── Visitor.java │ │ └── WeakReferenceObservable.java │ └── test │ ├── java │ └── org │ │ └── jquantlib │ │ └── testsuite │ │ ├── calendars │ │ ├── ArgentinaCalendarTest.java │ │ ├── AustraliaCalendarTest.java │ │ ├── BrazilCalendarTest.java │ │ ├── CalendarTest.java │ │ ├── CalendarUtil.java │ │ ├── CanadaCalendarTest.java │ │ ├── ChinaCalendarTest.java │ │ ├── CzechRepublicCalendarTest.java │ │ ├── DenmarkCalendarTest.java │ │ ├── FinlandCalendarTest.java │ │ ├── GermanyCalendarTest.java │ │ ├── HongKongCalendarTest.java │ │ ├── HungaryCalendarTest.java │ │ ├── IcelandCalendarTest.java │ │ ├── IndiaCalendarTest.java │ │ ├── IndonesiaCalendarTest.java │ │ ├── ItalyCalendarTest.java │ │ ├── JapanCalendarTest.java │ │ ├── MexicoCalendarTest.java │ │ ├── NewZealandCalendarTest.java │ │ ├── NorwayCalendarTest.java │ │ ├── PolandCalendarTest.java │ │ ├── SaudiArabiaCalendarTest.java │ │ ├── SingaporeCalendarTest.java │ │ ├── SlovakiaCalendarTest.java │ │ ├── SouthKoreaCalendarTest.java │ │ ├── SwedenCalendarTest.java │ │ ├── SwitzerlandCalendarTest.java │ │ ├── TaiwanCalendarTest.java │ │ ├── TestCalendarReferences.java │ │ ├── TurkeyCalendarTest.java │ │ ├── UkraineCalendarTest.java │ │ ├── UnitedKingdomCalendarTest.java │ │ └── UnitedStatesCalendarTest.java │ │ ├── currency │ │ └── CurrencyTest.java │ │ ├── daycounters │ │ └── DayCountersTest.java │ │ ├── instruments │ │ ├── AmericanOptionTest.java │ │ ├── AsianOptionTest.java │ │ ├── BarrierOptionTest.java │ │ ├── BondTest.java │ │ ├── ConvertibleBondTest.java │ │ ├── DividendOptionTest.java │ │ ├── EuropeanOptionTest.java │ │ ├── InstrumentsTest.java │ │ └── StocksTest.java │ │ ├── math │ │ ├── ArrayTest.java │ │ ├── MatrixTest.java │ │ ├── TransformedGridTest.java │ │ ├── distributions │ │ │ ├── BinomialDistributionTest.java │ │ │ ├── BivariateNormalDistributionTest.java │ │ │ ├── CumulativeBinomialDistributionTest.java │ │ │ ├── CumulativeNormalDistributionTest.java │ │ │ ├── CumulativePoissonDistributionTest.java │ │ │ ├── GammaDistributionTest.java │ │ │ ├── InverseCumulativeNormalTest.java │ │ │ ├── InverseCumulativePoissonTest.java │ │ │ ├── MoroInverseCumulativeNormalTest.java │ │ │ ├── NonCentralChiSquaredDistributionTest.java │ │ │ ├── NormalDistributionTest.java │ │ │ ├── PoissonNormalTest.java │ │ │ └── RegularisedIncompleteBetaTest.java │ │ ├── integrals │ │ │ ├── GammaFunctionTest.java │ │ │ ├── GaussKonrodPattersonIntegratorTest.java │ │ │ ├── IntegralsTest.java │ │ │ └── TabulatedGaussLegendreTest.java │ │ ├── interpolations │ │ │ ├── BackwardInterpolationTest.java │ │ │ ├── BilinearInterpolationTest.java │ │ │ ├── FlatForwardInterpolationTest.java │ │ │ ├── InterpolationTest.java │ │ │ ├── LinearInterpolationTest.java │ │ │ └── SABRInterpolationTest.java │ │ ├── optimization │ │ │ └── OptimizerTest.java │ │ ├── randomnumbers │ │ │ ├── MersenneTwisterTest.java │ │ │ └── RandomNumberTest.java │ │ ├── solvers1D │ │ │ ├── BisectionTest.java │ │ │ ├── BrentTest.java │ │ │ ├── FalsePositionTest.java │ │ │ ├── NewtonSafeTest.java │ │ │ ├── NewtonTest.java │ │ │ ├── RidderTest.java │ │ │ └── SecantTest.java │ │ └── statistics │ │ │ └── StatisticsTest.java │ │ ├── methods │ │ └── lattices │ │ │ └── ExtendedTrees.java │ │ ├── model │ │ └── volatility │ │ │ └── EstimatorsTest.java │ │ ├── money │ │ └── MoneyTest.java │ │ ├── operators │ │ ├── OperatorTest.java │ │ └── TridiagonalOperatorTest.java │ │ ├── patterns │ │ └── VisitorTest.java │ │ ├── pricers │ │ └── OldPricer.java │ │ ├── pricingengines │ │ └── JumpDiffusionEngineTest.java │ │ ├── quotes │ │ └── QuotesTest.java │ │ ├── termstructures │ │ ├── TermStructuresTest.java │ │ ├── volatilities │ │ │ └── SabrTest.java │ │ └── yieldcurves │ │ │ └── PiecewiseYieldCurveTest.java │ │ ├── time │ │ ├── DatesTest.java │ │ ├── PeriodTest.java │ │ └── ScheduleTest.java │ │ └── util │ │ ├── DateParserTest.java │ │ ├── Flag.java │ │ └── Utilities.java │ └── resources │ └── log4j.properties ├── project ├── build.properties └── plugins.sbt ├── sbt └── version.sbt /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | target 3 | /.classpath 4 | /.project 5 | /.settings 6 | /.idea 7 | /.idea_modules 8 | /.lib 9 | .classpath_nb 10 | .ensime 11 | .ensime_lucene 12 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | JQuantLib is a free, open-source, comprehensive framework for 2 | quantitative finance, written in 100% Java. It provides "quants" and 3 | Java application developers several mathematical and statistical tools 4 | needed for the valuation of shares, options, futures, swaps, and other 5 | financial instruments. 6 | 7 | JQuantLib is based on QuantLib, which is written in C++, aiming to be a 8 | complete rewrite of QuantLib, offering features Java developers expect 9 | to find. JQuantLib aims to be fast, correct, strongly typed, 10 | well-documented, and user-friendly. 11 | 12 | JQuantLib does its best efforts to mimic as close as possible the API 13 | exposed by QuantLib, offering a smooth transition path for developers 14 | and organizations willing to employ financial applications written in 15 | Java whilst keeping commitment to high performance and low latency. 16 | 17 | More info: http://www.jquantlib.org 18 | 19 | Quick guide for the impatient 20 | ============================= 21 | 22 | On a Unix-like console 23 | 24 | :: 25 | 26 | # branch from Github with git 27 | git clone http://github.com/frgomes/jquantlib 28 | 29 | # run demo number 9 (EquityOptions) 30 | cd jquantlib 31 | ./sbt clean samples/run # or simply `sbt clean samples/run` if you have SBT installed 32 | 33 | For impatient developers 34 | ======================== 35 | 36 | More info: http://www.jquantlib.org/en/latest/developersguide.html 37 | 38 | Modules 39 | ======= 40 | 41 | Main modules 42 | ------------ 43 | 44 | - jquantlib -- main module, which resembles QuantLib/C++ 45 | 46 | - jquantlib-helpers -- helper classes 47 | 48 | - jquantlib-contrib -- 3rd party contributions 49 | 50 | - jquantlib-samples -- sample code 51 | 52 | Related software 53 | ---------------- 54 | 55 | - jquantlib-ooplugin -- OpenOffice Calc plugin (outdated, not 56 | maintained) 57 | 58 | -- Richard Gomes 59 | -------------------------------------------------------------------------------- /doc/README.do.txt: -------------------------------------------------------------------------------- 1 | JQuantLib is a free, open-source, comprehensive framework for quantitative finance, written in 100% Java. It provides "quants" and Java application developers several mathematical and statistical tools needed for the valuation of shares, options, futures, swaps, and other financial instruments. 2 | 3 | JQuantLib is based on QuantLib, which is written in C++, aiming to be a complete rewrite of QuantLib, offering features Java developers expect to find. JQuantLib aims to be fast, correct, strongly typed, well-documented, and user-friendly. 4 | 5 | JQuantLib does its best efforts to mimic as close as possible the API exposed by QuantLib, offering a smooth transition path for developers and organizations willing to employ financial applications written in Java whilst keeping commitment to high performance and low latency. 6 | 7 | More info: URL: "http://www.jquantlib.org" 8 | 9 | 10 | 11 | ======= Quick guide for the impatient ======= 12 | 13 | On a Unix-like console 14 | !bc sys 15 | # branch from Github with git 16 | git clone http://github.com/frgomes/jquantlib 17 | 18 | # run demo 19 | cd jquantlib 20 | ./sbt clean run # or simply `sbt clean run` if you have SBT installed 21 | !ec 22 | 23 | 24 | ======= For impatient developers ======= 25 | 26 | On a Unix-like console 27 | !bc sys 28 | # branch from Launchpad 29 | bzr branch lp:jquantlib 30 | 31 | # developer's guide 32 | firefox http://www.jquantlib.org/en/latest/developersguide.html 33 | !ec 34 | 35 | 36 | ======= Modules ======= 37 | 38 | ===== Main modules ===== 39 | 40 | * jquantlib -- main module, which resembles QuantLib/C++ 41 | * jquantlib-helpers -- helper classes 42 | * jquantlib-contrib -- 3rd party contributions 43 | * jquantlib-samples -- sample code 44 | 45 | 46 | ===== Related software ===== 47 | 48 | * jquantlib-ooplugin -- OpenOffice Calc plugin (outdated, not maintained) 49 | 50 | 51 | -- Richard Gomes 52 | -------------------------------------------------------------------------------- /jquantlib-ooplugin/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=2b754fcd 2 | build.xml.script.CRC32=0a20deac 3 | build.xml.stylesheet.CRC32=d5b6853a 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=e49daf05 7 | nbproject/build-impl.xml.script.CRC32=2cc32945 8 | nbproject/build-impl.xml.stylesheet.CRC32=229523de@1.38.3.45 9 | -------------------------------------------------------------------------------- /jquantlib-ooplugin/nbproject/private/config.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frgomes/jquantlib/b8c36ea1954d5d242c41555ac2b60000dd5a8c95/jquantlib-ooplugin/nbproject/private/config.properties -------------------------------------------------------------------------------- /jquantlib-ooplugin/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=false 2 | do.depend=false 3 | do.jar=true 4 | javac.debug=true 5 | javadoc.preview=true 6 | user.properties.file=/home/rgomes/.netbeans/6.9/build.properties 7 | -------------------------------------------------------------------------------- /jquantlib-ooplugin/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | file:/home/rgomes/developer/workspace/jquantlib-ooplugin/src/org/jquantlib/JQAddInImpl.java 6 | 7 | 8 | -------------------------------------------------------------------------------- /jquantlib-ooplugin/nbproject/project-uno.properties: -------------------------------------------------------------------------------- 1 | #Sat Feb 19 13:26:36 GMT 2011 2 | images.dir=images 3 | project.name=JQAddIn 4 | registration.classname=org.jquantlib.JQAddInImpl 5 | external.jar.dir=lib 6 | idl_types.jar=JQAddIn_IDL_types.jar 7 | registry.dir=registry 8 | central.registration.class=org.jquantlib.CentralRegistrationClass 9 | licenses.dir=licenses 10 | manifest.package.extensions=**/*.xcu,**/*.xcs,**/*.xdl,**/*.xlb,**/*.xba,**/*.properties,**/*.default 11 | uno.project.type=office.calc.addin.project 12 | help.content.extensions=**/*.xhp,**/*.tree,${image.extensions} 13 | dialog.content.extensions=**/*.xdl,**/*.properties,**/*.default,${image.extensions} 14 | image.extensions=**/*.png,**/*.jpg,**/*.jpeg,**/*.gif 15 | description.dir=description 16 | dialogs.dir=dialogs 17 | help.dir=help 18 | office.startup.options=-calc 19 | -------------------------------------------------------------------------------- /jquantlib-ooplugin/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | jquantlib-ooplugin 7 | 1.6.5 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /jquantlib-ooplugin/src/description.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | jquantlib-ooplugin 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /jquantlib-ooplugin/src/org/jquantlib/JQAddIn.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * JQAddIn.idl 3 | * 4 | * Created on 2009.04.02 - 14:26:05 5 | * 6 | */ 7 | 8 | #ifndef _org_jquantlib_JQAddIn_ 9 | #define _org_jquantlib_JQAddIn_ 10 | 11 | #include "XJQAddIn.idl" 12 | 13 | module org { module jquantlib { 14 | service JQAddIn : XJQAddIn; 15 | }; }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /jquantlib-ooplugin/src/uno-extension-manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 9 | 11 | -------------------------------------------------------------------------------- /jquantlib-samples/src/main/java/org/jquantlib/samples/Repo.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.samples; 2 | 3 | import org.jquantlib.QL; 4 | 5 | public class Repo implements Runnable { 6 | 7 | public static void main(final String[] args) { 8 | new Repo().run(); 9 | } 10 | 11 | @Override 12 | public void run() { 13 | QL.validateExperimentalMode(); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /jquantlib-samples/src/main/java/org/jquantlib/samples/Swap.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.samples; 2 | 3 | import org.jquantlib.QL; 4 | 5 | public class Swap implements Runnable { 6 | 7 | public static void main(final String[] args) { 8 | new Swap().run(); 9 | } 10 | 11 | @Override 12 | public void run() { 13 | QL.validateExperimentalMode(); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /jquantlib-samples/src/test/java/org/jquantlib/samples/TestSamples.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.samples; 2 | 3 | import org.junit.Ignore; 4 | import org.junit.Test; 5 | 6 | public class TestSamples { 7 | 8 | private final AllSamples samples; 9 | 10 | public TestSamples() { 11 | this.samples = new AllSamples(); 12 | } 13 | 14 | @Test 15 | public void testCompleteSamples() { 16 | samples.runCompleteSamples(); 17 | } 18 | 19 | @Test 20 | public void testIncompleteSamples() { 21 | samples.runIncompleteSamples(); 22 | } 23 | 24 | @Ignore 25 | @Test 26 | public void testPendingSamples() { 27 | samples.runPendingSamples(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /jquantlib/.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /jquantlib/README.txt: -------------------------------------------------------------------------------- 1 | Please visit http://www.jquantlib.org/index.php/ReadMe for more information. 2 | 3 | Thanks 4 | 5 | JQuantLib Team -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/SavedSettings.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib; 2 | 3 | 4 | /** 5 | * helper class to temporarily and safely change the settings 6 | * @author goovy 7 | */ 8 | public class SavedSettings { 9 | 10 | // PLEASE REVIEW THIS IMPLEMENTATION 11 | // 12 | // We cannot rely on finalize() for anything. 13 | // Method finalize() is called by GC when GC decides it's time for reclaiming memory occupied by this class. 14 | // This behaviour is neither deterministic nor reliable and may even never happen at all. 15 | // 16 | 17 | 18 | 19 | 20 | 21 | // private Date evaluationDate_; 22 | // private boolean enforcesTodaysHistoricFixings_; 23 | // 24 | // public SavedSettings(){ 25 | // Date d = Configuration.getSystemConfiguration(null).getGlobalSettings().getEvaluationDate(); 26 | // this.evaluationDate_ = DateFactory.getFactory().getDate(d.getDayOfMonth(), d.getMonth(), d.getYear()); 27 | // enforcesTodaysHistoricFixings_ = Configuration.getSystemConfiguration(null).isEnforcesTodaysHistoricFixings(); 28 | // } 29 | // 30 | // public void destroy(){ 31 | // Configuration.getSystemConfiguration(null).getGlobalSettings().setEvaluationDate(this.evaluationDate_); 32 | // Configuration.getSystemConfiguration(null).setEnforcesTodaysHistoricFixings(this.enforcesTodaysHistoricFixings_); 33 | // } 34 | // 35 | // @Override 36 | // public void finalize(){ 37 | // destroy(); 38 | // } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/cashflow/FixedDividend.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Daniel Kong 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | 23 | package org.jquantlib.cashflow; 24 | 25 | import org.jquantlib.time.Date; 26 | 27 | /** 28 | * Predetermined cash flow 29 | *

30 | * This cash flow pays a predetermined amount at a given date. 31 | * 32 | * @author Daniel Kong 33 | */ 34 | 35 | public class FixedDividend extends Dividend { 36 | 37 | protected double amount; 38 | 39 | public FixedDividend(final double amount, final Date date) { 40 | super(date); 41 | this.amount = amount; 42 | } 43 | 44 | 45 | // 46 | // Overrides Dividend 47 | // 48 | 49 | @Override 50 | public double amount(final double underlying) { 51 | return amount; 52 | } 53 | 54 | 55 | // 56 | // Overrides Cashflow 57 | // 58 | 59 | @Override 60 | public double amount() { 61 | return amount; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/AustraliaRegion.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | /** 25 | * 26 | * Australia as geographical/economic region 27 | * used for inflation applicability 28 | * 29 | * @author Tim Blackler 30 | */ 31 | public class AustraliaRegion extends Region { 32 | 33 | public AustraliaRegion() { 34 | this.data = new Region.Data("Australia","AU"); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/DailyTenorEURLiborON.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | 25 | import org.jquantlib.quotes.Handle; 26 | import org.jquantlib.termstructures.YieldTermStructure; 27 | 28 | /** 29 | * Overnight EUR Libor index 30 | * 31 | * @note This is the London fixing by BBA . Use Euribor if you're interested in the rate fixed by the ECB. 32 | * 33 | * @author Tim Blackler 34 | **/ 35 | public class DailyTenorEURLiborON extends DailyTenorEURLibor { 36 | 37 | public DailyTenorEURLiborON() { 38 | this(new Handle()); 39 | } 40 | 41 | public DailyTenorEURLiborON(final Handle h) { 42 | super(0, h); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLibor10M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 10-months EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLibor10M extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLibor10M() { 42 | this(new Handle()); 43 | } 44 | public EURLibor10M(final Handle h) { 45 | super(new Period(10, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLibor11M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 11-months EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLibor11M extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLibor11M() { 42 | this(new Handle()); 43 | } 44 | public EURLibor11M(final Handle h) { 45 | super(new Period(11, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLibor1M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 1-months EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLibor1M extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLibor1M() { 42 | this(new Handle()); 43 | } 44 | public EURLibor1M(final Handle h) { 45 | super(new Period(1, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLibor1Y.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 1-Year EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLibor1Y extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLibor1Y() { 42 | this(new Handle()); 43 | } 44 | public EURLibor1Y(final Handle h) { 45 | super(new Period(1, TimeUnit.Years), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLibor2M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 2-months EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLibor2M extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLibor2M() { 42 | this(new Handle()); 43 | } 44 | public EURLibor2M(final Handle h) { 45 | super(new Period(2, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLibor2W.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 2-week EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLibor2W extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLibor2W() { 42 | this(new Handle()); 43 | } 44 | public EURLibor2W(final Handle h) { 45 | super(new Period(2, TimeUnit.Weeks), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLibor3M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 3-months EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLibor3M extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLibor3M() { 42 | this(new Handle()); 43 | } 44 | public EURLibor3M(final Handle h) { 45 | super(new Period(3, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLibor4M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 4-months EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLibor4M extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLibor4M() { 42 | this(new Handle()); 43 | } 44 | public EURLibor4M(final Handle h) { 45 | super(new Period(4, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLibor5M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 5-months EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLibor5M extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLibor5M() { 42 | this(new Handle()); 43 | } 44 | public EURLibor5M(final Handle h) { 45 | super(new Period(5, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLibor6M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 6-months EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLibor6M extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLibor6M() { 42 | this(new Handle()); 43 | } 44 | public EURLibor6M(final Handle h) { 45 | super(new Period(6, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLibor7M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 7-months EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLibor7M extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLibor7M() { 42 | this(new Handle()); 43 | } 44 | public EURLibor7M(final Handle h) { 45 | super(new Period(7, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLibor8M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 8-months EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLibor8M extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLibor8M() { 42 | this(new Handle()); 43 | } 44 | public EURLibor8M(final Handle h) { 45 | super(new Period(8, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLibor9M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 9-months EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLibor9M extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLibor9M() { 42 | this(new Handle()); 43 | } 44 | public EURLibor9M(final Handle h) { 45 | super(new Period(9, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURLiborSW.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 1-week EUR Libor index 31 | * 32 | * @author Tim Blackler 33 | */ 34 | public class EURLiborSW extends EURLibor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EURLiborSW() { 42 | this(new Handle()); 43 | } 44 | public EURLiborSW(final Handle h) { 45 | super(new Period(1, TimeUnit.Weeks), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EURegion.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | /** 25 | * 26 | * European Union as geographical/economic region 27 | * used for inflation applicability 28 | * 29 | * @author Tim Blackler 30 | */ 31 | public class EURegion extends Region { 32 | 33 | public EURegion() { 34 | this.data = new Region.Data("EU","EU"); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor10M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 10-months Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor10M extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor10M() { 42 | this(new Handle()); 43 | } 44 | public Euribor10M(final Handle h) { 45 | super(new Period(10, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor11M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 11-months Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor11M extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor11M() { 42 | this(new Handle()); 43 | } 44 | public Euribor11M(final Handle h) { 45 | super(new Period(11, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor1M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 1-month Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor1M extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor1M() { 42 | this(new Handle()); 43 | } 44 | public Euribor1M(final Handle h) { 45 | super(new Period(1, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor1Y.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 1-year Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor1Y extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor1Y() { 42 | this(new Handle()); 43 | } 44 | public Euribor1Y(final Handle h) { 45 | super(new Period(1, TimeUnit.Years), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor2M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 2-months Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor2M extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor2M() { 42 | this(new Handle()); 43 | } 44 | public Euribor2M(final Handle h) { 45 | super(new Period(2, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor2W.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 2-weeks Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor2W extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor2W() { 42 | this(new Handle()); 43 | } 44 | public Euribor2W(final Handle h) { 45 | super(new Period(2, TimeUnit.Weeks), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_10M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 10-months Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_10M extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_10M() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_10M(final Handle h) { 45 | super(new Period(10, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_11M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 11-months Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_11M extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_11M() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_11M(final Handle h) { 45 | super(new Period(11, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_1M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 1-month Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_1M extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_1M() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_1M(final Handle h) { 45 | super(new Period(1, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_1Y.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 1-year Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_1Y extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_1Y() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_1Y(final Handle h) { 45 | super(new Period(1, TimeUnit.Years), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_2M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 2-months Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_2M extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_2M() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_2M(final Handle h) { 45 | super(new Period(2, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_2W.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 2-weeks Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_2W extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_2W() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_2W(final Handle h) { 45 | super(new Period(2, TimeUnit.Weeks), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_3M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 3-months Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_3M extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_3M() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_3M(final Handle h) { 45 | super(new Period(3, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_3W.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 3-weeks Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_3W extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_3W() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_3W(final Handle h) { 45 | super(new Period(3, TimeUnit.Weeks), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_4M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 4-months Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_4M extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_4M() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_4M(final Handle h) { 45 | super(new Period(4, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_5M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 5-months Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_5M extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_5M() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_5M(final Handle h) { 45 | super(new Period(5, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_6M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 6-months Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_6M extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_6M() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_6M(final Handle h) { 45 | super(new Period(6, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_7M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 7-months Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_7M extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_7M() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_7M(final Handle h) { 45 | super(new Period(7, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_8M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 8-months Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_8M extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_8M() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_8M(final Handle h) { 45 | super(new Period(8, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_9M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 9-months Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_9M extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_9M() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_9M(final Handle h) { 45 | super(new Period(9, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor365_SW.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 1-week Euribor365 index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor365_SW extends Euribor365 { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor365_SW() { 42 | this(new Handle()); 43 | } 44 | public Euribor365_SW(final Handle h) { 45 | super(new Period(1, TimeUnit.Weeks), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor3M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 3-months Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor3M extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor3M() { 42 | this(new Handle()); 43 | } 44 | public Euribor3M(final Handle h) { 45 | super(new Period(3, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor3W.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 3-weeks Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor3W extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor3W() { 42 | this(new Handle()); 43 | } 44 | public Euribor3W(final Handle h) { 45 | super(new Period(3, TimeUnit.Weeks), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor4M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 4-months Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor4M extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor4M() { 42 | this(new Handle()); 43 | } 44 | public Euribor4M(final Handle h) { 45 | super(new Period(4, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor5M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 5-months Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor5M extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor5M() { 42 | this(new Handle()); 43 | } 44 | public Euribor5M(final Handle h) { 45 | super(new Period(5, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor6M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 6-months Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor6M extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor6M() { 42 | this(new Handle()); 43 | } 44 | public Euribor6M(final Handle h) { 45 | super(new Period(6, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor7M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 7-months Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor7M extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor7M() { 42 | this(new Handle()); 43 | } 44 | public Euribor7M(final Handle h) { 45 | super(new Period(7, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor8M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 8-months Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor8M extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor8M() { 42 | this(new Handle()); 43 | } 44 | public Euribor8M(final Handle h) { 45 | super(new Period(8, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/Euribor9M.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 9-months Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class Euribor9M extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public Euribor9M() { 42 | this(new Handle()); 43 | } 44 | public Euribor9M(final Handle h) { 45 | super(new Period(9, TimeUnit.Months), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/EuriborSW.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.time.Period; 27 | import org.jquantlib.time.TimeUnit; 28 | 29 | /** 30 | * 1-week Euribor index 31 | * 32 | * @author Srinivas Hasti 33 | */ 34 | public class EuriborSW extends Euribor { 35 | 36 | 37 | // 38 | // public constructors 39 | // 40 | 41 | public EuriborSW() { 42 | this(new Handle()); 43 | } 44 | public EuriborSW(final Handle h) { 45 | super(new Period(1, TimeUnit.Weeks), h); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/FranceRegion.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | /** 25 | * 26 | * France as geographical/economic region 27 | * used for inflation applicability 28 | * 29 | * @author Tim Blackler 30 | */ 31 | public class FranceRegion extends Region { 32 | 33 | public FranceRegion() { 34 | this.data = new Region.Data("France","FR"); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/indexes/UKRegion.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Tim Blackler 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.indexes; 23 | 24 | /** 25 | * 26 | * France as geographical/economic region 27 | * used for inflation applicability 28 | * 29 | * @author Tim Blackler 30 | */ 31 | public class UKRegion extends Region { 32 | 33 | public UKRegion() { 34 | this.data = new Region.Data("UK","UK"); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/instruments/EarlierThanCashFlowComparator.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.instruments; 2 | 3 | import java.io.Serializable; 4 | import java.util.Comparator; 5 | 6 | import org.jquantlib.cashflow.CashFlow; 7 | 8 | /** 9 | * @author Ueli Hofstetter 10 | */ 11 | public class EarlierThanCashFlowComparator implements Comparator, Serializable { 12 | 13 | /** 14 | * Compares its two arguments for order. 15 | * Returns a negative integer, zero, or a positive integer as the 16 | * first argument is less than, equal to, or greater than the second. 17 | */ 18 | @Override 19 | public int compare(final CashFlow o1, final CashFlow o2) { 20 | if(o1.date().le(o2.date())) 21 | return -1; 22 | if(o2.date().le(o1.date())) 23 | return 1; 24 | return 0; 25 | } 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/instruments/Settlement.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Praneet Tiwari 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.instruments; 23 | 24 | /** 25 | * 26 | * @author Praneet Tiwari 27 | */ 28 | public class Settlement { 29 | 30 | public static enum Type { 31 | Physical, Cash 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/instruments/bonds/SoftCallability.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Daniel Kong 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.instruments.bonds; 23 | 24 | import org.jquantlib.cashflow.Callability; 25 | import org.jquantlib.time.Date; 26 | 27 | /** 28 | * %callability leaving to the holder the possibility to convert 29 | * 30 | * @author Daniel Kong 31 | */ 32 | 33 | public class SoftCallability extends Callability { 34 | 35 | private final double trigger; 36 | 37 | public SoftCallability(final Price price, final Date date, final double trigger){ 38 | super(price, Callability.Type.Call, date); 39 | this.trigger = trigger; 40 | } 41 | 42 | public double trigger(){ 43 | return trigger; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/lang/annotation/Natural.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.lang.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Target; 5 | 6 | /** 7 | * This annotation is intended to mark a type as a natural number 8 | * 9 | * @note An annotation processor is responsible for instrumenting the bytecode as needed for 10 | * guarantee that a field, local variable or parameter only assumes valid values. 11 | * 12 | * @see Natural number 13 | * @see JSR 308: Annotations on Java Types 14 | * @see Strong Type Checking 15 | * 16 | * @author Richard Gomes 17 | */ 18 | @Target({ ElementType.TYPE_USE, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.PARAMETER }) 19 | public @interface Natural { 20 | // tagging annotation 21 | } 22 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/lang/annotation/NonNegative.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.lang.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Target; 5 | 6 | /** 7 | * This annotation is intended to mark a type as non-negative number 8 | * 9 | * @note An annotation processor is responsible for instrumenting the bytecode as needed for 10 | * guarantee that a field, local variable or parameter only assumes valid values. 11 | * 12 | * @see Natural number 13 | * @see JSR 308: Annotations on Java Types 14 | * @see Strong Type Checking 15 | * 16 | * @author Richard Gomes 17 | */ 18 | @Target({ ElementType.TYPE_USE, ElementType.FIELD, ElementType.METHOD, ElementType.LOCAL_VARIABLE, ElementType.PARAMETER }) 19 | public @interface NonNegative { 20 | // tagging annotation 21 | } 22 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/lang/annotation/PackagePrivate.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.lang.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Target; 5 | 6 | /** 7 | * This annotation is intended to mark a type as package private 8 | * 9 | * @see JSR 308: Annotations on Java Types 10 | * @see Strong Type Checking 11 | * 12 | * @author Richard Gomes 13 | */ 14 | @Target({ ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE}) 15 | public @interface PackagePrivate { 16 | // tagging annotation 17 | } 18 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/lang/annotation/Unsigned.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.lang.annotation; 2 | 3 | /** 4 | * This annotation serves for documentation purposes only. 5 | *

6 | * JVM does not support unsigned integral types. 7 | * So, in Java and any other JVM backed language, it may become difficult to express these concepts: 8 | *

 9 |  * unsigned byte ub;
10 |  * unsigned word uw;
11 |  * unsigned int  ui;
12 |  * unsigned long ul;
13 |  * 
14 | * 15 | * @see Bug 4504839 16 | * @see Java and Unsigned Types 17 | * 18 | * @author Richard Gomes 19 | */ 20 | public @interface Unsigned { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/lang/reflect/DynamicProxyInvocationHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.lang.reflect; 23 | 24 | import java.lang.reflect.Method; 25 | 26 | /** 27 | * @author Srinivas Hasti 28 | * 29 | */ 30 | //TODO: add comments and explain what this class is about 31 | 32 | // FIXME: Remove code which employs reflection [ Richard Gomes ] 33 | 34 | public class DynamicProxyInvocationHandler implements java.lang.reflect.InvocationHandler { 35 | 36 | private final T delegate; 37 | 38 | public DynamicProxyInvocationHandler(final T obj) { 39 | this.delegate = obj; 40 | } 41 | 42 | @Override 43 | public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { 44 | return delegate.getClass().getMethod(method.getName(), method.getParameterTypes()).invoke(delegate, args); 45 | 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/lang/reflect/ReflectConstants.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.lang.reflect; 2 | 3 | /** 4 | * @author Richard Gomes 5 | */ 6 | //TODO: add comments and explain what this class is about 7 | public class ReflectConstants { 8 | 9 | public static final String SHOULD_NOT_EXTEND_FROM_THIS_CLASS = "Should not extend from this class"; 10 | public static final String SHOULD_OVERRIDE_THIS_METHOD = "Should override this method"; 11 | public static final String SHOULD_BE_ANONYMOUS_OR_EXTENDED = "Class should be anonymous or extended from a generic class"; 12 | public static final String MISSING_GENERIC_PARAMETER_TYPE = "Missing generic parameter type"; 13 | public static final String GENERIC_PARAMETER_MUST_BE_CONCRETE_CLASS = "Generic parameter must be a concrete class"; 14 | public static final String ILLEGAL_TYPE_PARAMETER = "Illegal type parameter"; 15 | public static final String WRONG_ARGUMENT_TYPE = "Unexpected type for type parameter"; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/LogGrid.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | 23 | package org.jquantlib.math; 24 | 25 | import org.jquantlib.math.functions.Log; 26 | import org.jquantlib.math.matrixutilities.Array; 27 | 28 | /** 29 | * @author Srinivas Hasti 30 | */ 31 | // TODO: code review :: license, class comments, comments for access modifiers, comments for @Override 32 | public class LogGrid extends TransformedGrid { 33 | 34 | public LogGrid(Array grid) { 35 | super(grid, new Log()); 36 | } 37 | 38 | public Array logGridArray() { 39 | return transformedGridArray(); 40 | } 41 | 42 | public double logGrid(int i) { 43 | return transformedGrid(i); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/PdeShortRate.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.math; 2 | 3 | import org.jquantlib.methods.finitedifferences.PdeSecondOrderParabolic; 4 | 5 | public class PdeShortRate extends PdeSecondOrderParabolic { 6 | 7 | @Override 8 | public double diffusion(double t, double x) { 9 | // TODO Auto-generated method stub 10 | return 0; 11 | } 12 | 13 | @Override 14 | public double discount(double t, double x) { 15 | // TODO Auto-generated method stub 16 | return 0; 17 | } 18 | 19 | @Override 20 | public double drift(double t, double x) { 21 | // TODO Auto-generated method stub 22 | return 0; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/distributions/Derivative.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | 23 | package org.jquantlib.math.distributions; 24 | 25 | import org.jquantlib.math.Ops; 26 | 27 | 28 | /** 29 | * 30 | * @author Richard Gomes 31 | * 32 | */ 33 | 34 | public interface Derivative extends Ops.DoubleOp { 35 | 36 | /** 37 | * Computes the derivation of the function; f(x) 38 | * 39 | * @param x 40 | * @return f(x) 41 | */ 42 | public double derivative(final double x) /* ReadOnly */; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Abs.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A modulo function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class Abs implements Ops.DoubleOp { 32 | 33 | // 34 | // implements Ops.DoubleOp 35 | // 36 | 37 | @Override 38 | public double op(final double a) { 39 | return Math.abs(a); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Bind1st.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * This method binds the 1st argument of a binary function to a scalar value, effectively enabling 28 | * a binary function to be called in a context intended for a unary function. 29 | * 30 | * @author Richard Gomes 31 | */ 32 | public final class Bind1st implements Ops.DoubleOp { 33 | 34 | private final double scalar; // 1st argument 35 | private final Ops.BinaryDoubleOp f; // 2nd argument 36 | 37 | public Bind1st(final double scalar, final Ops.BinaryDoubleOp f) { 38 | this.scalar = scalar; 39 | this.f = f; 40 | } 41 | 42 | 43 | // 44 | // implements Ops.DoubleOp 45 | // 46 | 47 | @Override 48 | public double op(final double a) { 49 | return f.op(scalar, a); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Bind1stPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | 27 | /** 28 | * This method binds the 1st argument of a binary predicate to a scalar value, effectively enabling 29 | * a binary predicate to be called in a context intended for a unary predicate. 30 | * 31 | * @author Richard Gomes 32 | */ 33 | public final class Bind1stPredicate implements Ops.DoublePredicate { 34 | 35 | private final double scalar; // 1st argument 36 | private final Ops.BinaryDoublePredicate f; // 2nd argument 37 | 38 | public Bind1stPredicate(final double scalar, final Ops.BinaryDoublePredicate f) { 39 | this.scalar = scalar; 40 | this.f = f; 41 | } 42 | 43 | 44 | // 45 | // implements DoublePredicate 46 | // 47 | 48 | @Override 49 | public boolean op(final double a) { 50 | return f.op(scalar, a); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Bind2nd.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * This method binds the 2nd argument of a binary function to a scalar value, effectively enabling 28 | * a binary function to be called in a context intended for a unary function. 29 | * 30 | * @author Richard Gomes 31 | */ 32 | public final class Bind2nd implements Ops.DoubleOp { 33 | 34 | private final Ops.BinaryDoubleOp f; // 1st argument 35 | private final double scalar; // 2nd argument 36 | 37 | public Bind2nd(final Ops.BinaryDoubleOp f, final double scalar) { 38 | this.f = f; 39 | this.scalar = scalar; 40 | } 41 | 42 | 43 | // 44 | // implements Ops.DoubleOp 45 | // 46 | 47 | @Override 48 | public double op(final double a) { 49 | return f.op(a, scalar); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Bind2ndPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | 27 | /** 28 | * This method binds the 2nd argument of a binary predicate to a scalar value, effectively enabling 29 | * a binary predicate to be called in a context intended for a unary predicate. 30 | * 31 | * @author Richard Gomes 32 | */ 33 | public final class Bind2ndPredicate implements Ops.DoublePredicate { 34 | 35 | private final Ops.BinaryDoublePredicate f; // 1st argument 36 | private final double scalar; // 2nd argument 37 | 38 | public Bind2ndPredicate(final Ops.BinaryDoublePredicate f, final double scalar) { 39 | this.f = f; 40 | this.scalar = scalar; 41 | } 42 | 43 | 44 | // 45 | // implements DoublePredicate 46 | // 47 | 48 | @Override 49 | public boolean op(final double a) { 50 | return f.op(a, scalar); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Clipped.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * This class verifies a condition and if true, returns the evaluation of 28 | * a function, otherwise returns Double.NaN. 29 | * 30 | * @author Richard Gomes 31 | */ 32 | public final class Clipped implements Ops.DoubleOp { 33 | 34 | private final Ops.DoublePredicate checker; 35 | private final Ops.DoubleOp function; 36 | 37 | public Clipped(final Ops.DoublePredicate checker, final Ops.DoubleOp function){ 38 | this.checker = checker; 39 | this.function = function; 40 | } 41 | 42 | 43 | // 44 | // implements Ops.DoubleOp 45 | // 46 | 47 | @Override 48 | public double op(final double a) { 49 | return checker.op(a) ? function.op(a) : Double.NaN; 50 | } 51 | 52 | } 53 | 54 | 55 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/CloseEnough.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Closeness; 25 | import org.jquantlib.math.Ops; 26 | 27 | /** 28 | * Verifies if 2 double numbers are close enough 29 | * 30 | * @see Closeness#isCloseEnough(double, double) 31 | * 32 | * @author Richard Gomes 33 | */ 34 | public final class CloseEnough implements Ops.BinaryDoublePredicate { 35 | 36 | // 37 | // implements BinaryDoublePredicate 38 | // 39 | 40 | @Override 41 | public boolean op(final double a, final double b) { 42 | return Closeness.isCloseEnough(a, b); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/ComposedFunction.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.math.functions; 2 | 3 | import org.jquantlib.math.Ops; 4 | 5 | public class ComposedFunction implements Ops.DoubleOp { 6 | 7 | private final Ops.DoubleOp f; 8 | private final Ops.DoubleOp g; 9 | 10 | public ComposedFunction(final Ops.DoubleOp f, final Ops.DoubleOp g) { 11 | this.f = f; 12 | this.g = g; 13 | } 14 | 15 | 16 | // 17 | // implements Ops.DoubleOp 18 | // 19 | 20 | /** 21 | * @return {@latex$ f(g(x)) } 22 | */ 23 | @Override 24 | public double op(final double x) { 25 | return f.op(g.op(x)); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Constant.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A constant function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class Constant implements Ops.DoubleOp { 32 | 33 | private final double value; 34 | 35 | public Constant(final double value) { 36 | this.value = value; 37 | } 38 | 39 | 40 | // 41 | // implements Ops.DoubleOp 42 | // 43 | 44 | /** 45 | * @param a is always discarded 46 | * @return a constant value whatever parameter is received 47 | */ 48 | @Override 49 | public double op(final double a) { 50 | // parameter is discarded and a constant value is returned 51 | return value; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Cos.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A cos(x) function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class Cos implements Ops.DoubleOp { 32 | 33 | // 34 | // implements Ops.DoubleOp 35 | // 36 | 37 | @Override 38 | public double op(final double a) { 39 | return Math.cos(a); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Cube.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A cubic function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class Cube implements Ops.DoubleOp { 32 | 33 | // 34 | // implements Ops.DoubleOp 35 | // 36 | 37 | @Override 38 | public double op(final double a) { 39 | return a*a*a; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Everywhere.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A constant function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class Everywhere implements Ops.DoublePredicate { 32 | 33 | // 34 | // implements Ops.DoublePredicate 35 | // 36 | 37 | /** 38 | * @param a is always discarded 39 | * @return true 40 | */ 41 | @Override 42 | public boolean op(final double a) { 43 | return true; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Exp.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A exp(n) function 28 | * 29 | * @author Srinivas Hasti 30 | */ 31 | public final class Exp implements Ops.DoubleOp { 32 | 33 | // 34 | // implements Ops.DoubleOp 35 | // 36 | 37 | @Override 38 | public double op(final double a) { 39 | return Math.exp(a); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Expression.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import java.util.List; 25 | 26 | import org.jquantlib.math.Ops; 27 | import org.jquantlib.math.Ops.DoubleOp; 28 | 29 | /** 30 | * Processes a sequence of functions 31 | * 32 | * @author Richard Gomes 33 | */ 34 | public class Expression implements Ops.DoubleOp { 35 | 36 | private final List list; 37 | 38 | public Expression(final List list) { 39 | this.list = list; 40 | } 41 | 42 | 43 | // 44 | // implements Ops.DoubleOp 45 | // 46 | 47 | @Override 48 | public double op(final double a) { 49 | double result = a; 50 | for (int i = 0; i. The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * Always false 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class FalsePredicate implements Ops.DoublePredicate { 32 | 33 | // 34 | // implements DoublePredicate 35 | // 36 | 37 | @Override 38 | public boolean op(final double a) { 39 | return false; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Fourth.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A x^4 function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class Fourth implements Ops.DoubleOp { 32 | 33 | // 34 | // implements Ops.DoubleOp 35 | // 36 | 37 | @Override 38 | public double op(final double a) { 39 | final double sqr = a*a; 40 | return sqr*sqr; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/GreaterEqualPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A greater equal function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class GreaterEqualPredicate implements Ops.BinaryDoublePredicate { 32 | 33 | // 34 | // implements BinaryDoublePredicate 35 | // 36 | 37 | @Override 38 | public boolean op(final double a, final double b) { 39 | return a >= b; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/GreaterThanPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A greater than function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class GreaterThanPredicate implements Ops.BinaryDoublePredicate { 32 | 33 | // 34 | // implements BinaryDoublePredicate 35 | // 36 | 37 | @Override 38 | public boolean op(final double a, final double b) { 39 | return a > b; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Identity.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * The identity function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class Identity implements Ops.DoubleOp { 32 | 33 | // 34 | // implements Ops.DoubleOp 35 | // 36 | 37 | @Override 38 | public double op(final double a) { 39 | return a; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/LessEqualPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A less equal function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class LessEqualPredicate implements Ops.BinaryDoublePredicate { 32 | 33 | // 34 | // implements BinaryDoublePredicate 35 | // 36 | 37 | @Override 38 | public boolean op(final double a, final double b) { 39 | return a <= b; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/LessThanPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A less than function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class LessThanPredicate implements Ops.BinaryDoublePredicate { 32 | 33 | // 34 | // implements BinaryDoublePredicate 35 | // 36 | 37 | @Override 38 | public boolean op(final double a, final double b) { 39 | return a < b; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Log.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A log(n) function 28 | * 29 | * @author Srinivas Hasti 30 | */ 31 | public final class Log implements Ops.DoubleOp { 32 | 33 | // 34 | // implements Ops.DoubleOp 35 | // 36 | 37 | @Override 38 | public double op(final double a) { 39 | return Math.log(a); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Minus.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | 27 | /** 28 | * A binary subtraction function 29 | * 30 | * @author Richard Gomes 31 | */ 32 | public final class Minus implements Ops.BinaryDoubleOp { 33 | 34 | // 35 | // implements Ops.DoubleOp 36 | // 37 | 38 | @Override 39 | public double op(final double a, final double b) { 40 | return a - b; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Nowhere.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A constant function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class Nowhere implements Ops.DoublePredicate { 32 | 33 | // 34 | // implements Ops.DoublePredicate 35 | // 36 | 37 | /** 38 | * @param a is always discarded 39 | * @return false 40 | */ 41 | @Override 42 | public boolean op(final double a) { 43 | return false; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Sin.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A sin(x) function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class Sin implements Ops.DoubleOp { 32 | 33 | // 34 | // implements Ops.DoubleOp 35 | // 36 | 37 | @Override 38 | public double op(final double a) { 39 | return Math.sin(a); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Sqrt.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A square root function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class Sqrt implements Ops.DoubleOp { 32 | 33 | // 34 | // implements Ops.DoubleOp 35 | // 36 | 37 | @Override 38 | public double op(final double a) { 39 | return Math.sqrt(a); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/Square.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * A square function 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class Square implements Ops.DoubleOp { 32 | 33 | // 34 | // implements Ops.DoubleOp 35 | // 36 | 37 | @Override 38 | public double op(final double a) { 39 | return a*a; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/functions/TruePredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.functions; 23 | 24 | import org.jquantlib.math.Ops; 25 | 26 | /** 27 | * Always true 28 | * 29 | * @author Richard Gomes 30 | */ 31 | public final class TruePredicate implements Ops.DoublePredicate { 32 | 33 | // 34 | // implements DoublePredicate 35 | // 36 | 37 | @Override 38 | public boolean op(final double a) { 39 | return true; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/interpolations/factories/Bilinear.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | 23 | package org.jquantlib.math.interpolations.factories; 24 | 25 | import org.jquantlib.math.interpolations.BilinearInterpolation; 26 | import org.jquantlib.math.interpolations.Interpolation2D; 27 | import org.jquantlib.math.matrixutilities.Array; 28 | import org.jquantlib.math.matrixutilities.Matrix; 29 | 30 | /** 31 | * Bilinear interpolation factory 32 | * 33 | * @see BilinearInterpolation 34 | * 35 | * @author Richard Gomes 36 | */ 37 | public class Bilinear implements Interpolation2D.Interpolator2D { 38 | 39 | public Interpolation2D interpolate(final Array vx, final Array vy, final Matrix mz) /* @ReadOnly */ { 40 | return new BilinearInterpolation(vx, vy, mz); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/matrixutilities/Identity.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.math.matrixutilities; 2 | 3 | import java.util.EnumSet; 4 | import java.util.Set; 5 | 6 | import org.jquantlib.lang.annotation.QualityAssurance; 7 | import org.jquantlib.lang.annotation.QualityAssurance.Quality; 8 | import org.jquantlib.lang.annotation.QualityAssurance.Version; 9 | import org.jquantlib.math.matrixutilities.internal.Address; 10 | 11 | /** 12 | * Identity Matrix 13 | * 14 | * @author Richard Gomes 15 | */ 16 | @QualityAssurance(quality = Quality.Q1_TRANSLATION, version = Version.OTHER, reviewers = { "Richard Gomes" }) 17 | public class Identity extends Matrix { 18 | 19 | /** 20 | * Creates an identity matrix 21 | * 22 | * @return An m-by-n matrix with ones on the diagonal and zeros elsewhere. 23 | */ 24 | public Identity(final int dim) { 25 | this(dim, EnumSet.noneOf(Address.Flags.class)); 26 | } 27 | 28 | 29 | /** 30 | * Default constructor 31 | *

32 | * Builds a Matrix with dimensions 1x1 33 | * 34 | * @param flags is a Set<Address.Flags> 35 | * 36 | * @see Address.Flags 37 | */ 38 | public Identity(final int dim, final Set flags) { 39 | super(dim, dim, flags); 40 | final int offset = addr.isFortran() ? 1 : 0; 41 | for (int i = offset; i < dim+offset; i++) { 42 | this.set(i, i, 1.0); 43 | } 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/optimization/LineSearchBasedMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Ueli Hofstetter 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.optimization; 23 | 24 | import org.jquantlib.QL; 25 | 26 | 27 | 28 | public abstract class LineSearchBasedMethod extends OptimizationMethod { 29 | 30 | protected LineSearch lineSearch_; 31 | 32 | protected LineSearchBasedMethod() { 33 | QL.validateExperimentalMode(); 34 | } 35 | 36 | public LineSearchBasedMethod(final LineSearch lineSearch){ 37 | QL.validateExperimentalMode(); 38 | lineSearch_ = lineSearch; 39 | //FIXME: is this correct 40 | if(lineSearch_ == null){ 41 | lineSearch_ = new ArmijoLineSearch(); 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/optimization/ParametersTransformation.java: -------------------------------------------------------------------------------- 1 | 2 | package org.jquantlib.math.optimization; 3 | 4 | import org.jquantlib.math.matrixutilities.Array; 5 | 6 | public interface ParametersTransformation { 7 | public Array direct(Array x); 8 | public Array inverse(Array x); 9 | } 10 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/optimization/SphereCylinderOptimizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Ueli Hofstetter 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.math.optimization; 23 | 24 | public class SphereCylinderOptimizer { 25 | 26 | /* 27 | * non existing in version 0.8.1 28 | */ 29 | public SphereCylinderOptimizer() { 30 | if (System.getProperty("EXPERIMENTAL") == null) { 31 | throw new UnsupportedOperationException("Work in progress"); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/math/randomnumbers/InverseCumulative.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | 23 | package org.jquantlib.math.randomnumbers; 24 | 25 | import org.jquantlib.math.Ops; 26 | 27 | /** 28 | * @author Richard Gomes 29 | */ 30 | public interface InverseCumulative extends Ops.DoubleOp { 31 | // tagging interface 32 | } 33 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/AmericanCondition.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | 23 | package org.jquantlib.methods.finitedifferences; 24 | 25 | import org.jquantlib.instruments.Option.Type; 26 | import org.jquantlib.math.matrixutilities.Array; 27 | 28 | /** 29 | * @author Srinivas Hasti 30 | * 31 | */ 32 | public class AmericanCondition extends CurveDependentStepCondition { 33 | 34 | public AmericanCondition(Type type, double strike) { 35 | super(type, strike); 36 | } 37 | 38 | public AmericanCondition(Array a) { 39 | super(a); 40 | } 41 | 42 | public/* @Real */double applyToValue(/* @Real */double current, /* @Real */ 43 | double intrinsic) { 44 | return Math.max(current, intrinsic); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/BSMTermOperator.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This file is part of JQuantLib, a free-software/open-source library 5 | for financial quantitative analysts and developers - http://jquantlib.org/ 6 | 7 | JQuantLib is free software: you can redistribute it and/or modify it 8 | under the terms of the QuantLib license. You should have received a 9 | copy of the license along with this program; if not, please email 10 | . The license is also available online at 11 | . 12 | 13 | This program is distributed in the hope that it will be useful, but WITHOUT 14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 | FOR A PARTICULAR PURPOSE. See the license for more details. 16 | 17 | JQuantLib is based on QuantLib. http://quantlib.org/ 18 | When applicable, the original copyright notice follows this notice. 19 | */ 20 | package org.jquantlib.methods.finitedifferences; 21 | 22 | import org.jquantlib.math.matrixutilities.Array; 23 | import org.jquantlib.processes.GeneralizedBlackScholesProcess; 24 | 25 | /** 26 | * @author Srinivas Hasti 27 | * 28 | */ 29 | public class BSMTermOperator extends PdeOperator { 30 | 31 | public BSMTermOperator(final Array grid, final GeneralizedBlackScholesProcess process, final double residualTime) { 32 | super(PdeBSM.class, grid, process, residualTime); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/BoundaryConditionSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This file is part of JQuantLib, a free-software/open-source library 5 | for financial quantitative analysts and developers - http://jquantlib.org/ 6 | 7 | JQuantLib is free software: you can redistribute it and/or modify it 8 | under the terms of the QuantLib license. You should have received a 9 | copy of the license along with this program; if not, please email 10 | . The license is also available online at 11 | . 12 | 13 | This program is distributed in the hope that it will be useful, but WITHOUT 14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 | FOR A PARTICULAR PURPOSE. See the license for more details. 16 | 17 | JQuantLib is based on QuantLib. http://quantlib.org/ 18 | When applicable, the original copyright notice follows this notice. 19 | */ 20 | package org.jquantlib.methods.finitedifferences; 21 | 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | /** 26 | * @author Srinivas Hasti 27 | * 28 | */ 29 | public class BoundaryConditionSet> { 30 | private List> bcSet = new ArrayList>(); 31 | 32 | public void push_back(List a) { 33 | bcSet.add(a); 34 | } 35 | 36 | public List get(int i) { 37 | return bcSet.get(i); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/CrankNicolson.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.methods.finitedifferences; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * @author Srinivas Hasti 28 | * 29 | */ 30 | public class CrankNicolson extends MixedScheme { 31 | 32 | public CrankNicolson(T op, 33 | List> bcs) { 34 | super(op, 0.5, bcs); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/DPlus.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.methods.finitedifferences; 23 | 24 | /** 25 | * @author Srinivas Hasti 26 | * 27 | */ 28 | public class DPlus extends TridiagonalOperator { 29 | 30 | public DPlus(int gridPoints, /* Real */double h) { 31 | super(gridPoints); 32 | setFirstRow(-1 / h, 1 / h); 33 | setMidRows(0.0, -1 / h, 1 / h); 34 | setLastRow(-1 / h, 1 / h); 35 | // linear extrapolation 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/DZero.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.methods.finitedifferences; 23 | 24 | /** 25 | * @author Srinivas Hasti 26 | * 27 | */ 28 | public class DZero extends TridiagonalOperator { 29 | 30 | public DZero(int gridPoints, /* Real */double h) { 31 | super(gridPoints); 32 | setFirstRow(-1 / h, 1 / h); // linear extrapolation 33 | setMidRows(-1 / (2 * h), 0.0, 1 / (2 * h)); 34 | setLastRow(-1 / h, 1 / h); // linear extrapolation 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/ExplicitEuler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.methods.finitedifferences; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * @author Srinivas Hasti 28 | * 29 | */ 30 | public class ExplicitEuler extends MixedScheme { 31 | 32 | public ExplicitEuler(Operator L, List> bcs) { 33 | super(L, 0.0, bcs); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/NullCondition.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This file is part of JQuantLib, a free-software/open-source library 5 | for financial quantitative analysts and developers - http://jquantlib.org/ 6 | 7 | JQuantLib is free software: you can redistribute it and/or modify it 8 | under the terms of the QuantLib license. You should have received a 9 | copy of the license along with this program; if not, please email 10 | . The license is also available online at 11 | . 12 | 13 | This program is distributed in the hope that it will be useful, but WITHOUT 14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 | FOR A PARTICULAR PURPOSE. See the license for more details. 16 | 17 | JQuantLib is based on QuantLib. http://quantlib.org/ 18 | When applicable, the original copyright notice follows this notice. 19 | */ 20 | package org.jquantlib.methods.finitedifferences; 21 | 22 | import org.jquantlib.math.matrixutilities.Array; 23 | 24 | /** 25 | * @author Srinivas Hasti 26 | * 27 | */ 28 | public class NullCondition implements StepCondition { 29 | 30 | @Override 31 | public void applyTo(T a, double t) { 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/Pde.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.methods.finitedifferences; 23 | 24 | /** 25 | * The objects passed into Pde classes 26 | * must implement the methods defined by this. 27 | * 28 | * @author Srinivas Hasti 29 | * 30 | */ 31 | public interface Pde { 32 | 33 | public abstract /*Real*/ double diffusion(/*Time*/double t, /*Real*/ 34 | double x); 35 | 36 | public abstract /*Real*/ double drift( /*Time*/double t, /*Real*/ 37 | double x); 38 | 39 | public abstract /*Real*/ double discount(/*Time*/double t, /*Real*/ 40 | double x); 41 | } 42 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/PdeTypeUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This file is part of JQuantLib, a free-software/open-source library 5 | for financial quantitative analysts and developers - http://jquantlib.org/ 6 | 7 | JQuantLib is free software: you can redistribute it and/or modify it 8 | under the terms of the QuantLib license. You should have received a 9 | copy of the license along with this program; if not, please email 10 | . The license is also available online at 11 | . 12 | 13 | This program is distributed in the hope that it will be useful, but WITHOUT 14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 | FOR A PARTICULAR PURPOSE. See the license for more details. 16 | 17 | JQuantLib is based on QuantLib. http://quantlib.org/ 18 | When applicable, the original copyright notice follows this notice. 19 | */ 20 | package org.jquantlib.methods.finitedifferences; 21 | 22 | import org.jquantlib.lang.exceptions.LibraryException; 23 | import org.jquantlib.processes.GeneralizedBlackScholesProcess; 24 | 25 | /** 26 | * @author Srinivas Hasti 27 | * 28 | */ 29 | public final class PdeTypeUtil { 30 | public static T getPdeInstance(final Class clazz, final GeneralizedBlackScholesProcess process) { 31 | try { 32 | return clazz.getConstructor(process.getClass()).newInstance(process); 33 | } catch (final Exception e) { 34 | throw new LibraryException(e); // QA:[RG]::verified 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/StandardFiniteDifferenceModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This file is part of JQuantLib, a free-software/open-source library 5 | for financial quantitative analysts and developers - http://jquantlib.org/ 6 | 7 | JQuantLib is free software: you can redistribute it and/or modify it 8 | under the terms of the QuantLib license. You should have received a 9 | copy of the license along with this program; if not, please email 10 | . The license is also available online at 11 | . 12 | 13 | This program is distributed in the hope that it will be useful, but WITHOUT 14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 | FOR A PARTICULAR PURPOSE. See the license for more details. 16 | 17 | JQuantLib is based on QuantLib. http://quantlib.org/ 18 | When applicable, the original copyright notice follows this notice. 19 | */ 20 | package org.jquantlib.methods.finitedifferences; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * @author Srinivas Hasti 26 | * 27 | */ 28 | public class StandardFiniteDifferenceModel extends FiniteDifferenceModel> { 29 | 30 | public StandardFiniteDifferenceModel( 31 | final TridiagonalOperator op, 32 | final List> bcs) { 33 | super(TridiagonalOperator.class, CrankNicolson.class, op, bcs); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/StepCondition.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | 23 | package org.jquantlib.methods.finitedifferences; 24 | 25 | 26 | /** 27 | * @author Srinivas Hasti 28 | * 29 | */ 30 | public interface StepCondition { 31 | public void applyTo(T a, double/* @Time */t); 32 | } 33 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/StepConditionSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This file is part of JQuantLib, a free-software/open-source library 5 | for financial quantitative analysts and developers - http://jquantlib.org/ 6 | 7 | JQuantLib is free software: you can redistribute it and/or modify it 8 | under the terms of the QuantLib license. You should have received a 9 | copy of the license along with this program; if not, please email 10 | . The license is also available online at 11 | . 12 | 13 | This program is distributed in the hope that it will be useful, but WITHOUT 14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 | FOR A PARTICULAR PURPOSE. See the license for more details. 16 | 17 | JQuantLib is based on QuantLib. http://quantlib.org/ 18 | When applicable, the original copyright notice follows this notice. 19 | */ 20 | package org.jquantlib.methods.finitedifferences; 21 | 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | /** 26 | * @author Srinivas Hasti 27 | * 28 | */ 29 | public class StepConditionSet { 30 | 31 | private List> stepConditions = new ArrayList>(); 32 | 33 | public void applyTo(List a, /* Time */double t) { 34 | for (int i = 0; i < stepConditions.size(); i++) { 35 | stepConditions.get(i).applyTo(a.get(i), t); 36 | } 37 | } 38 | 39 | public void push_back(StepCondition a) { 40 | stepConditions.add(a); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/finitedifferences/ZeroCondition.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | 23 | package org.jquantlib.methods.finitedifferences; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * @author Srinivas Hasti 29 | * 30 | */ 31 | public class ZeroCondition implements StepCondition> { 32 | 33 | /* (non-Javadoc) 34 | * @see org.jquantlib.methods.finitedifferences.StepConditon#applyTo(java.lang.Object, double) 35 | */ 36 | @Override 37 | public void applyTo(List a, double t) { 38 | for (int i = 0; i < a.size(); i++) { 39 | a.set(i,Math.max(a.get(i), 0.0)); 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/montecarlo/Variate.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 Richard Gomes 3 | 4 | This file is part of JQuantLib, a free-software/open-source library 5 | for financial quantitative analysts and developers - http://jquantlib.org/ 6 | 7 | JQuantLib is free software: you can redistribute it and/or modify it 8 | under the terms of the QuantLib license. You should have received a 9 | copy of the license along with this program; if not, please email 10 | . The license is also available online at 11 | . 12 | 13 | This program is distributed in the hope that it will be useful, but WITHOUT 14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 | FOR A PARTICULAR PURPOSE. See the license for more details. 16 | 17 | JQuantLib is based on QuantLib. http://quantlib.org/ 18 | When applicable, the original copyright notice follows this notice. 19 | */ 20 | 21 | package org.jquantlib.methods.montecarlo; 22 | 23 | /** 24 | * @author Richard Gomes 25 | */ 26 | public interface Variate { 27 | 28 | // Tagging interface 29 | 30 | } 31 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/methods/montecarlo/monte-carlo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frgomes/jquantlib/b8c36ea1954d5d242c41555ac2b60000dd5a8c95/jquantlib/src/main/java/org/jquantlib/methods/montecarlo/monte-carlo.png -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/model/marketmodels/AccountingEngine.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.model.marketmodels; 2 | 3 | 4 | /** 5 | * Engine collecting cash flows along a market-model simulation 6 | * 7 | * @author Ueli Hofstetter 8 | */ 9 | // TODO: code review :: license, class comments, comments for access modifiers, comments for @Override 10 | // TODO: code review :: please verify against QL/C++ code 11 | public class AccountingEngine { 12 | 13 | public AccountingEngine( 14 | final MarketModelEvolver evolver, 15 | final Object /* const Clone& product*/ Mark, 16 | final /*@Real*/ double initialNumeraireValue) { 17 | 18 | if (System.getProperty("EXPERIMENTAL") == null) 19 | throw new UnsupportedOperationException("Work in progress"); 20 | } 21 | 22 | 23 | 24 | // void multiplePathValues(SequenceStatistics& stats, 25 | // Size numberOfPaths); 26 | // private: 27 | // Real singlePathValues(std::vector& values); 28 | // 29 | // boost::shared_ptr evolver_; 30 | // Clone product_; 31 | // 32 | // Real initialNumeraireValue_; 33 | // Size numberProducts_; 34 | // 35 | // // workspace 36 | // std::vector numerairesHeld_; 37 | // std::vector numberCashFlowsThisStep_; 38 | // std::vector > 39 | // cashFlowsGenerated_; 40 | // std::vector discounters_; 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/model/marketmodels/BrownianGenerator.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.model.marketmodels; 2 | 3 | /** 4 | * 5 | * @author Ueli Hofstetter 6 | * 7 | */ 8 | // TODO: code review :: license, class comments, comments for access modifiers, comments for @Override 9 | // TODO: code review :: please verify against QL/C++ code 10 | public abstract class BrownianGenerator { 11 | 12 | public BrownianGenerator(){ 13 | if (System.getProperty("EXPERIMENTAL") == null) 14 | throw new UnsupportedOperationException("Work in progress"); 15 | } 16 | 17 | public abstract double nextStep(); 18 | public abstract double nextPath(); 19 | public abstract int numberOfFactors(); 20 | public abstract int numberOfSteps(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/model/marketmodels/BrownianGeneratorFactory.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.model.marketmodels; 2 | 3 | /** 4 | * 5 | * @author Ueli Hofstetter 6 | * 7 | */ 8 | // TODO: code review :: license, class comments, comments for access modifiers, comments for @Override 9 | // TODO: code review :: please verify against QL/C++ code 10 | public abstract class BrownianGeneratorFactory { 11 | 12 | public BrownianGeneratorFactory() { 13 | if (System.getProperty("EXPERIMENTAL") == null) 14 | throw new UnsupportedOperationException("Work in progress"); 15 | } 16 | 17 | public abstract BrownianGenerator create(int factors,int steps) ; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/model/marketmodels/MarketModelEvolver.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.model.marketmodels; 2 | 3 | /** 4 | * Market-model evolver 5 | *

6 | * Abstract base class. The evolver does the actual gritty work of evolving the forward rates from one time to the next. 7 | * 8 | * @author Ueli Hofstetter 9 | */ 10 | // TODO: code review :: license, class comments, comments for access modifiers, comments for @Override 11 | // TODO: code review :: please verify against QL/C++ code 12 | public abstract class MarketModelEvolver { 13 | 14 | abstract int [] numeraires(); 15 | abstract double startNewPath(); 16 | abstract double advanceStep(); 17 | abstract int currentStep(); 18 | abstract CurveState currentState(); 19 | abstract void setInitialState(CurveState curveState); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/model/shortrate/onefactormodels/TermStructureConsistentModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Praneet Tiwari 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | package org.jquantlib.model.shortrate.onefactormodels; 23 | 24 | import org.jquantlib.quotes.Handle; 25 | import org.jquantlib.termstructures.YieldTermStructure; 26 | import org.jquantlib.util.Observable; 27 | 28 | /** 29 | * Term-structure consistent model class 30 | *

31 | * This is a base class for models that can reprice exactly any discount bond. 32 | * 33 | * @category shortrate 34 | * 35 | * @author Praneet Tiwari 36 | */ 37 | public interface TermStructureConsistentModel extends Observable { 38 | 39 | public Handle termStructure(); 40 | } 41 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/pricingengines/capfloor/AnalyticCapFloorEngine.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.pricingengines.capfloor; 2 | 3 | import org.jquantlib.QL; 4 | 5 | 6 | public class AnalyticCapFloorEngine{ 7 | 8 | 9 | public AnalyticCapFloorEngine() { 10 | QL.validateExperimentalMode(); 11 | } 12 | 13 | //public AnalyticCapFloorEngine(final AffineModel model){ 14 | // : GenericModelEngine(model) 17 | // {} 18 | // } 19 | // void calculate(){} 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/pricingengines/swap/DiscountingSwapEngine.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.pricingengines.swap; 2 | 3 | import org.jquantlib.QL; 4 | import org.jquantlib.cashflow.CashFlows; 5 | import org.jquantlib.instruments.Swap; 6 | import org.jquantlib.math.Constants; 7 | import org.jquantlib.quotes.Handle; 8 | import org.jquantlib.termstructures.YieldTermStructure; 9 | import org.jquantlib.util.Observer; 10 | 11 | // TODO: code review :: please verify against QL/C++ code 12 | // TODO: code review :: license, class comments, comments for access modifiers, comments for @Override 13 | public class DiscountingSwapEngine extends Swap.EngineImpl implements /* Swap.Engine, */ Observer { 14 | 15 | private final Handle discountCurve; 16 | 17 | public DiscountingSwapEngine(final Handle discountCurve) /* @ReadOnly */ { 18 | if (System.getProperty("EXPERIMENTAL") == null) 19 | throw new UnsupportedOperationException("Work in progress"); 20 | this.discountCurve = discountCurve; 21 | this.discountCurve.addObserver(this); 22 | } 23 | 24 | @Override 25 | public void calculate() /* @ReadOnly */ { 26 | QL.require(!discountCurve.empty() , "no discounting term structure set"); // TODO: message 27 | 28 | final Swap.ArgumentsImpl a = (Swap.ArgumentsImpl)arguments_; 29 | final Swap.ResultsImpl r = (Swap.ResultsImpl)results_; 30 | r.value = 0.0; 31 | r.errorEstimate = Constants.NULL_REAL; 32 | r.legNPV = new double[a.legs.size()]; 33 | r.legBPS = new double[a.legs.size()]; 34 | for (int i=0; i 8 | * typedef FDDividendEngineMerton73 FDDividendEngine; 9 | * 10 | * 11 | * @author Richard Gomes 12 | */ 13 | public final class FDDividendEngine extends FDDividendEngineMerton73 { 14 | 15 | public FDDividendEngine( 16 | final GeneralizedBlackScholesProcess process, 17 | final int timeSteps, 18 | final int gridPoints, 19 | final boolean timeDependent) { 20 | super(process, timeSteps, gridPoints, timeDependent); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/pricingengines/vanilla/finitedifferences/PayoffFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | 4 | This file is part of JQuantLib, a free-software/open-source library 5 | for financial quantitative analysts and developers - http://jquantlib.org/ 6 | 7 | JQuantLib is free software: you can redistribute it and/or modify it 8 | under the terms of the QuantLib license. You should have received a 9 | copy of the license along with this program; if not, please email 10 | . The license is also available online at 11 | . 12 | 13 | This program is distributed in the hope that it will be useful, but WITHOUT 14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 | FOR A PARTICULAR PURPOSE. See the license for more details. 16 | 17 | JQuantLib is based on QuantLib. http://quantlib.org/ 18 | When applicable, the original copyright notice follows this notice. 19 | */ 20 | package org.jquantlib.pricingengines.vanilla.finitedifferences; 21 | 22 | import org.jquantlib.instruments.Payoff; 23 | import org.jquantlib.math.Ops; 24 | 25 | /** 26 | * @author Srinivas Hasti 27 | * 28 | */ 29 | public class PayoffFunction implements Ops.DoubleOp { 30 | private final Payoff payOff; 31 | 32 | public PayoffFunction(final Payoff payOff) { 33 | super(); 34 | this.payOff = payOff; 35 | } 36 | 37 | 38 | // 39 | // implements Ops.DoubleOp 40 | // 41 | 42 | @Override 43 | public double op(final double a) { 44 | return payOff.get(a); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/termstructures/Bootstrap.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 John Martin 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | 23 | package org.jquantlib.termstructures; 24 | 25 | import org.jquantlib.termstructures.yieldcurves.PiecewiseYieldCurve; 26 | 27 | 28 | public interface Bootstrap { 29 | 30 | public void calculate(); 31 | 32 | public void setup(Curve curve); 33 | //XXX 34 | // public void setup( 35 | // final YieldTermStructure termStructure, 36 | // final Bootstrapable bootstrapable, 37 | // final RateHelper[] instruments, 38 | // final BootstrapTraits traits); 39 | } -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/termstructures/RateHelperSorter.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | 23 | package org.jquantlib.termstructures; 24 | 25 | import java.io.Serializable; 26 | import java.util.Comparator; 27 | 28 | /** 29 | * This class implements a {@link Comparator} for {@link RateHelper} objects. 30 | * 31 | * @see Comparator 32 | * @see RateHelper 33 | * 34 | * @author Richard Gomes 35 | * @param 36 | */ 37 | public class RateHelperSorter implements Comparator, Serializable { 38 | 39 | private static final long serialVersionUID = 6335152611463577317L; 40 | 41 | public int compare(final T h1, final T h2) /* @ReadOnly */ { 42 | return h1.latestDate().compareTo(h2.latestDate()); 43 | } 44 | } -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/time/TimeSeries.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Srinivas Hasti 3 | Copyright (C) 2010 Ricahrd Gomes 4 | 5 | This source code is release under the BSD License. 6 | 7 | This file is part of JQuantLib, a free-software/open-source library 8 | for financial quantitative analysts and developers - http://jquantlib.org/ 9 | 10 | JQuantLib is free software: you can redistribute it and/or modify it 11 | under the terms of the JQuantLib license. You should have received a 12 | copy of the license along with this program; if not, please email 13 | . The license is also available online at 14 | . 15 | 16 | This program is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 18 | FOR A PARTICULAR PURPOSE. See the license for more details. 19 | 20 | JQuantLib is based on QuantLib. http://quantlib.org/ 21 | When applicable, the original copyright notice follows this notice. 22 | */ 23 | 24 | package org.jquantlib.time; 25 | 26 | 27 | /** 28 | * Container for historical data 29 | *

30 | * This class acts as a generic repository for a set of historical data. 31 | * Any single datum can be accessed through its date, while 32 | * sets of consecutive data can be accessed through iterators. 33 | *

34 | * This class is intended to keep closest compatibility with QuantLib/C++ as possible, being 35 | * nothing more than a shortcut to class {@link Series}, where the first parametric type is 36 | * fixed as {@link Date}. 37 | * 38 | * @see Series 39 | * 40 | * @author Richard Gomes 41 | */ 42 | public class TimeSeries extends Series { 43 | 44 | public TimeSeries(final Class classV) { 45 | super(Date.class, classV); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/util/ComparablePair.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | 23 | package org.jquantlib.util; 24 | 25 | /** 26 | * Mimicks std::pair 27 | * 28 | * @see std::pair 29 | * 30 | * @author Richard Gomes 31 | */ 32 | public class ComparablePair, T2> implements Comparable> { 33 | 34 | private final T1 first; 35 | private final T2 second; 36 | 37 | public ComparablePair(final T1 first, final T2 second) { 38 | this.first = first; 39 | this.second = second; 40 | } 41 | 42 | public T1 first() { 43 | return first; 44 | } 45 | 46 | public T2 second() { 47 | return second; 48 | } 49 | 50 | 51 | // 52 | // implements Comparable 53 | // 54 | 55 | @Override 56 | public int compareTo(ComparablePair o) { 57 | return this.first().compareTo(o.first()); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/util/Pair.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | 23 | package org.jquantlib.util; 24 | 25 | /** 26 | * Mimicks std::pair 27 | * 28 | * @see std::pair 29 | * 30 | * @author Richard Gomes 31 | */ 32 | public class Pair { 33 | 34 | private final T1 first; 35 | private final T2 second; 36 | 37 | public Pair(final T1 first, final T2 second) { 38 | this.first = first; 39 | this.second = second; 40 | } 41 | 42 | public T1 first() { 43 | return first; 44 | } 45 | 46 | public T2 second() { 47 | return second; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /jquantlib/src/main/java/org/jquantlib/util/Visitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 Richard Gomes 3 | 4 | This source code is release under the BSD License. 5 | 6 | This file is part of JQuantLib, a free-software/open-source library 7 | for financial quantitative analysts and developers - http://jquantlib.org/ 8 | 9 | JQuantLib is free software: you can redistribute it and/or modify it 10 | under the terms of the JQuantLib license. You should have received a 11 | copy of the license along with this program; if not, please email 12 | . The license is also available online at 13 | . 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 | FOR A PARTICULAR PURPOSE. See the license for more details. 18 | 19 | JQuantLib is based on QuantLib. http://quantlib.org/ 20 | When applicable, the original copyright notice follows this notice. 21 | */ 22 | 23 | package org.jquantlib.util; 24 | 25 | 26 | /** 27 | * This interface defines the {@link Visitor} side of the Visitor design pattern 28 | * 29 | * @author Richard Gomes 30 | * 31 | * @see Visitable 32 | * @see PolymorphicVisitor 33 | * @see PolymorphicVisitable 34 | * 35 | * @see The Visitor Design Pattern 36 | * 37 | * @param defines de data structure to be visited 38 | */ 39 | public interface Visitor { 40 | 41 | /** 42 | * This method is responsible for processing a data structure. 43 | * 44 | * @param element is one element of the data structure 45 | * 46 | * @see Visitable 47 | * @see PolymorphicVisitor 48 | * @see PolymorphicVisitable 49 | */ 50 | public void visit(T element); 51 | } 52 | -------------------------------------------------------------------------------- /jquantlib/src/test/java/org/jquantlib/testsuite/instruments/StocksTest.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.testsuite.instruments; 2 | 3 | import static org.junit.Assert.fail; 4 | 5 | import org.jquantlib.QL; 6 | import org.jquantlib.instruments.Instrument; 7 | import org.jquantlib.instruments.Stock; 8 | import org.jquantlib.quotes.Quote; 9 | import org.jquantlib.quotes.RelinkableHandle; 10 | import org.jquantlib.quotes.SimpleQuote; 11 | import org.jquantlib.testsuite.util.Flag; 12 | import org.junit.Test; 13 | 14 | public class StocksTest { 15 | 16 | public StocksTest() { 17 | QL.info("::::: "+this.getClass().getSimpleName()+" :::::"); 18 | } 19 | 20 | @Test 21 | public void testStocks() { 22 | QL.info("Testing price valuation of Stocks..."); 23 | 24 | final double iniPrice = 3.56; 25 | final double newPrice = iniPrice*1.0214; // changed +2.14% 26 | 27 | // define Stock 28 | final RelinkableHandle h = new RelinkableHandle(new SimpleQuote(iniPrice)); 29 | final Instrument s = new Stock(h); 30 | 31 | // attach an Observer to Stock 32 | final Flag priceChange = new Flag(); 33 | s.addObserver(priceChange); 34 | 35 | // verify initial price 36 | if (iniPrice != s.NPV()) { 37 | fail("stock quote valuation failed"); 38 | } 39 | 40 | // set a new price 41 | h.linkTo(new SimpleQuote(newPrice)); 42 | 43 | // Observer must detect price change 44 | if (!priceChange.isUp()) { 45 | fail("Observer was not notified of instrument change"); 46 | } 47 | 48 | if (newPrice != s.NPV()) { 49 | fail("stock quote havent changed value"); 50 | } 51 | 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /jquantlib/src/test/java/org/jquantlib/testsuite/math/TransformedGridTest.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.testsuite.math; 2 | 3 | import static org.junit.Assert.fail; 4 | 5 | import org.jquantlib.QL; 6 | import org.jquantlib.math.Grid; 7 | import org.jquantlib.math.Ops; 8 | import org.jquantlib.math.TransformedGrid; 9 | import org.jquantlib.math.matrixutilities.Array; 10 | import org.junit.Test; 11 | 12 | public class TransformedGridTest { 13 | 14 | public TransformedGridTest() { 15 | QL.info("::::: "+this.getClass().getSimpleName()+" :::::"); 16 | } 17 | 18 | @Test 19 | public void testConstruction() { 20 | 21 | QL.info("Testing transformed grid construction..."); 22 | 23 | final PlusOne p1 = new PlusOne(); 24 | final Array grid = Grid.BoundedGrid(0, 100, 100); 25 | final TransformedGrid tg = new TransformedGrid(grid, p1); 26 | if (Math.abs(tg.grid(0) - 0.0) > 1e-5) { 27 | fail("grid creation failed"); 28 | } 29 | 30 | if (Math.abs(tg.transformedGrid(0) - 1.0) > 1e-5) { 31 | fail("grid transformation failed"); 32 | } 33 | } 34 | 35 | 36 | private final class PlusOne implements Ops.DoubleOp { 37 | 38 | // 39 | // implements Ops.DoubleOp 40 | // 41 | 42 | @Override 43 | public double op(final double a) { 44 | return a + 1.0; 45 | } 46 | 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /jquantlib/src/test/java/org/jquantlib/testsuite/math/randomnumbers/RandomNumberTest.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.testsuite.math.randomnumbers; 2 | 3 | import org.jquantlib.QL; 4 | import org.junit.Test; 5 | 6 | // TODO: code review :: please verify against QL/C++ code 7 | public class RandomNumberTest { 8 | 9 | public RandomNumberTest() { 10 | QL.info("::::: "+this.getClass().getSimpleName()+" :::::"); 11 | } 12 | 13 | @Test 14 | public void testGaussian(){ 15 | QL.info("Testing Gaussian pseudo-random number generation..."); 16 | QL.info("to be implemented"); 17 | 18 | } 19 | 20 | @Test 21 | public void testDefaultPoisson(){ 22 | QL.info("Testing Poisson pseudo-random number generation..."); 23 | QL.info("to be implemented"); 24 | } 25 | 26 | @Test 27 | public void testCustomPoisson(){ 28 | QL.info("Testing custom Poisson pseudo-random number generation..."); 29 | QL.info("to be implemented"); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /jquantlib/src/test/java/org/jquantlib/testsuite/time/PeriodTest.java: -------------------------------------------------------------------------------- 1 | package org.jquantlib.testsuite.time; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | import static org.junit.Assert.assertFalse; 5 | import static org.junit.Assert.assertTrue; 6 | 7 | import java.util.HashSet; 8 | 9 | import org.jquantlib.QL; 10 | import org.jquantlib.time.Period; 11 | import org.jquantlib.time.TimeUnit; 12 | import org.junit.Test; 13 | 14 | 15 | public class PeriodTest { 16 | 17 | @Test 18 | public void testEqualsandHashCode() { 19 | 20 | QL.info("Testing equals and hashcode"); 21 | 22 | final Period oneDay = new Period(1, TimeUnit.Days); 23 | final Period oneYear = new Period(1, TimeUnit.Years); 24 | final Period oneDayAgo = new Period(-1, TimeUnit.Days); 25 | final Period oneDayAgain = new Period(1, TimeUnit.Days); 26 | final Period oneNull = new Period(1, null); 27 | final Period oneNullAgain = new Period(1, null); 28 | final Period twoNull = new Period(1, null); 29 | 30 | assertFalse(oneDay.equals(twoNull)); 31 | assertEquals(oneNull, oneNullAgain); 32 | 33 | assertFalse(oneDay.equals(null)); 34 | assertFalse(oneDay.equals(oneNull)); 35 | assertEquals(oneDay, oneDay); 36 | assertFalse(oneDay.equals(oneDayAgo)); 37 | assertFalse(oneDay.equals(oneYear)); 38 | assertEquals(oneDay, oneDayAgain); 39 | 40 | HashSet testSet = new HashSet(); 41 | testSet.add(oneDay); 42 | testSet.add(oneDayAgo); 43 | 44 | assertTrue(testSet.contains(oneDay)); 45 | assertFalse(testSet.contains(oneYear)); 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /jquantlib/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=debug, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 4 | log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n 5 | -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.11 2 | -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.3.1") 2 | addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0") 3 | -------------------------------------------------------------------------------- /version.sbt: -------------------------------------------------------------------------------- 1 | version in ThisBuild := "0.3.0-SNAPSHOT" 2 | --------------------------------------------------------------------------------