Package javax.vecmath

Examples of javax.vecmath.MismatchedSizeException


     *   if number of data columns differs from number of coefficients.
     */
    public Representer(Kernel kernel, GMatrix data, GVector coeffs) {
        if (kernel == null) throw new NullPointerException("kernel");
        if (data.getNumCol() != coeffs.getSize()) {
            throw new MismatchedSizeException();
        }
       
        this.kernel = kernel;
        this.points = new GVector[data.getNumCol()];
        this.coeffs = new GVector(coeffs);
View Full Code Here


    *
    * @throws MismatchedSizeException if vectors have different sizes
     */
    public static double distanceSquared(GVector x1, GVector x2) {
        if (x1.getSize() != x2.getSize()) {
            throw new MismatchedSizeException("x1 size: " + x1.getSize() +
                                              "; x2 size: " + x2.getSize());
        }
       
        double distSquared = 0;
        for(int i = 0; i < x1.getSize(); i++) {
View Full Code Here

    public void setPlane(final double[] x, final double[] y, final double[] z)
            throws MismatchedSizeException
    {
        final int N = x.length;
        if (N!=y.length || N!=z.length) {
            throw new MismatchedSizeException();
        }
        double sum_x  = 0;
        double sum_y  = 0;
        double sum_z  = 0;
        double sum_xx = 0;
View Full Code Here

     * @throws MismatchedSizeException if <var>x</var> and <var>y</var> don't have the same length.
     */
    public double setLine(final double[] x, final double[] y) throws MismatchedSizeException {
        final int N = x.length;
        if (N != y.length) {
            throw new MismatchedSizeException();
        }
        int    count  = 0;
        double mean_x = 0;
        double mean_y = 0;
        for (int i=0; i<N; i++) {
View Full Code Here

            throws MismatchedSizeException
    {
        transform = null;
        final boolean add = positions.isEmpty();
        if (!add && points.length != positions.size()) {
            throw new MismatchedSizeException(Errors.format(ErrorKeys.MISMATCHED_ARRAY_LENGTH));
        }
        final int dimension = getDimension();
        for (int i=0; i<points.length; i++) {
            final MappedPosition mp;
            if (add) {
View Full Code Here

            throws MismatchedSizeException, MismatchedDimensionException,
                   MismatchedReferenceSystemException
    {
        final int necessaryNumber = getMinimumPointCount();
        if (points.length < necessaryNumber) {
            throw new MismatchedSizeException(Errors.format(ErrorKeys.INSUFFICIENT_POINTS_$2,
                        points.length, necessaryNumber));
        }
        CoordinateReferenceSystem crs = null;
        final int dimension = getDimension();
        for (int i=0; i<points.length; i++) {
View Full Code Here

TOP

Related Classes of javax.vecmath.MismatchedSizeException

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.