Package org.jquantlib.lang.exceptions

Examples of org.jquantlib.lang.exceptions.LibraryException


      throw new LibraryException("SABR derivative not implemented");
    }

    @Override
        public double secondDerivative(final double x) {
      throw new LibraryException("SABR secondDerivative not implemented");
    }
View Full Code Here


    // TODO: code review :: please verify against QL/C++ code

    @Override
    public double /* @Real */drift(final double /* @Time */t, final double /* @Real */x) {
        throw new LibraryException("not implemented"); // QA:[RG]::verified // TODO: message
    }
View Full Code Here

        throw new LibraryException("not implemented"); // QA:[RG]::verified // TODO: message
    }

    @Override
    public double /* @Real */diffusion(final double /* @Time */t, final double /* @Real */x) {
        throw new LibraryException("not implemented"); // QA:[RG]::verified // TODO: message
    }
View Full Code Here

        throw new LibraryException("not implemented"); // QA:[RG]::verified // TODO: message
    }

    @Override
    public double /* @Real */apply(final double /* @Real */x, final double /* @Real */y) {
        throw new LibraryException("not implemented"); // QA:[RG]::verified // TODO: message
    }
View Full Code Here

            // obtain RNG Class from first generic parameter
            final Class<RNG> rngClass = (Class<RNG>) TypeToken.getClazz(GenericPseudoRandom.class, 0);
            final Constructor<RNG> c = rngClass.getConstructor(long.class);
            rng = c.newInstance(seed);
        } catch (final Exception e) {
            throw new LibraryException(e); // QA:[RG]::verified
        }

        // instantiate a RandomSequenceGenerator given a RNG type
        final RandomSequenceGenerator<RNG> rsg;
        try {
            // obtain Class from previously created RNG variable
            final Class<RandomSequenceGenerator<RNG>> rsgClass = (Class<RandomSequenceGenerator<RNG>>) TypeToken.getClazz(rng.getClass());
            final Constructor<RandomSequenceGenerator<RNG>> c = rsgClass.getConstructor(int.class, rng.getClass());
            rsg = c.newInstance(dimension, rng);
        } catch (final Exception e) {
            throw new LibraryException(e); // QA:[RG]::verified
        }

        // instantiate a InverseCumulative given its generic type (second generic parameter)
        final IC ic;
        try {
            // obtain IC Class from second generic parameter
            final Class<IC> icClass = (Class<IC>) TypeToken.getClazz(GenericPseudoRandom.class, 1);
            final Constructor<IC> c;
            if (icInstance!=null) {
                c = icClass.getConstructor(rsg.getClass(), icClass.getClass());
                ic = c.newInstance(rsg, icInstance);
            } else {
                c = icClass.getConstructor(rsg.getClass());
                ic = c.newInstance(rsg);
            }
        } catch (final Exception e) {
            throw new LibraryException(e); // QA:[RG]::verified
        }
        return (InverseCumulativeRsg<RandomSequenceGenerator<RNG>, IC>) ic;
    }
View Full Code Here

            // obtain RSG Class from first generic parameter
            final Class<RSG> rsgClass = (Class<RSG>) TypeToken.getClazz(GenericLowDiscrepancy.class, 0);
            final Constructor<RSG> c = rsgClass.getConstructor(int.class, long.class);
            rsg = c.newInstance(dimension, seed);
        } catch (final Exception e) {
            throw new LibraryException(e); // QA:[RG]::verified
        }

        // instantiate a InverseCumulative given its generic type (second generic parameter)
        final IC ic;
        try {
            // obtain IC Class from second generic parameter
            final Class<IC> icClass = (Class<IC>) TypeToken.getClazz(GenericPseudoRandom.class, 1);
            final Constructor<IC> c;
            if (icInstance!=null) {
                c = icClass.getConstructor(rsg.getClass(), icClass.getClass());
                ic = c.newInstance(rsg, icInstance);
            } else {
                c = icClass.getConstructor(rsg.getClass());
                ic = c.newInstance(rsg);
            }
        } catch (final Exception e) {
            throw new LibraryException(e); // QA:[RG]::verified
        }
        return (InverseCumulativeRsg<RSG, IC>) ic;
    }
View Full Code Here

            break;
        case(20):
            order_=order; x_=x20; w_=w20; n_=n20;
            break;
        default:
            throw new LibraryException("order not supported"); // QA:[RG]::verified // TODO: message
        }
    }
View Full Code Here

            //floorRates_.reserve(floatingLeg_.size());
            while (floorRates_.size() < floatingLeg_.size()) {
                floorRates_.add(floorRates_.get(floorRates_.size()-1));
            }
        } else
            throw new LibraryException("only Cap/Floor types allowed in this constructor"); // QA:[RG]::verified // TODO: message

        final Date evaluationDate = new Settings().evaluationDate();
        for (final CashFlow cashFlow : floatingLeg_) {
            cashFlow.addObserver(this);
        }
View Full Code Here

        if (klass==Default.class) {
            this.policy = new Default();
        } else if (klass==MidPoint.class) {
            this.policy = new MidPoint();
        } else {
            throw new LibraryException(ReflectConstants.WRONG_ARGUMENT_TYPE);
        }
    }
View Full Code Here

        if (klass==Default.class) {
            this.policy = new Default();
        } else if (klass==MidPoint.class) {
            this.policy = new MidPoint();
        } else {
            throw new LibraryException(ReflectConstants.WRONG_ARGUMENT_TYPE);
        }
    }
View Full Code Here

TOP

Related Classes of org.jquantlib.lang.exceptions.LibraryException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.