Package jjil.core

Examples of jjil.core.Error


     * @return the standard deviation, times 256.
     * @throws jjil.core.Error if the variance computed in push() is less than zero.
     */
    public float getStdDev() throws jjil.core.Error {
        float f = getVariance(); // getVariance()
        if (f < 0) throw new Error(
                  Error.PACKAGE.ALGORITHM,
                  ErrorCodes.STATISTICS_VARIANCE_LESS_THAN_ZERO,
                  new Float(f).toString(),
                  null,
                  null);
View Full Code Here


        String szInt = "";
        STATE_INT state = STATE_INT.BEGIN;
        int nChar = isr.read();
        do {
            if (nChar == -1) {
                throw new Error(
                                Error.PACKAGE.ALGORITHM,
                                ErrorCodes.INPUT_TERMINATED_EARLY,
                                isr.toString(),
                                null,
                                null);
            }
            char c = (char) nChar;
            /**
             * Parse float using FSM
             * BEGIN -> DIGITS
             * DIGITS -> DIGITS
             */
            switch (state) {
                case BEGIN:
                    if (c == '-' || c == '+' || Character.isDigit(c)) {
                        szInt += c;
                        nChar = isr.read();
                        state = STATE_INT.DIGITS;
                    } else {
                        // parse error, no digits
                        throw new Error(
                                        Error.PACKAGE.ALGORITHM,
                                        ErrorCodes.PARSE_ERROR,
                                        isr.toString(),
                                        null,
                                        null);
View Full Code Here

        STATE_FLOAT state = STATE_FLOAT.BEGIN;
        // read the float character by character
        int nChar = isr.read();
        do {
            if (nChar == -1) {
                throw new Error(
                                Error.PACKAGE.ALGORITHM,
                                ErrorCodes.INPUT_TERMINATED_EARLY,
                                isr.toString(),
                                null,
                                null);
            }
            char c = (char) nChar;
            /**
             * Parse float using FSM
             * BEGIN -> DIGITS_BEFORE_DECIMAL
             * DIGITS_BEFORE_DECIMAL -> DIGITS_BEFORE_DECIMAL ||
             *                          DIGITS_AFTER_DECIMAL ||
             *                          EXPONENT_BEGIN
             * DIGITS_AFTER_DECIMAL -> DIGITS_AFTER_DECIMAL ||
             *                         EXPONENT_BEGIN
             * EXPONENT_BEGIN -> EXPONENT
             */
            switch (state) {
                case BEGIN:
                    if (c == '+' || c == '-' || Character.isDigit(c)) {
                        szFloat += c;
                        state = STATE_FLOAT.DIGITS_BEFORE_DECIMAL;
                        nChar = isr.read();
                    } else {
                        // illegal empty string
                        throw new Error(
                                        Error.PACKAGE.ALGORITHM,
                                        ErrorCodes.PARSE_ERROR,
                                        isr.toString(),
                                        null,
                                        null);
View Full Code Here

        String szToken = ""; //$NON-NLS-1$
        char c;
        do {
            int nCh = isr.read();
            if (nCh == -1) {
                throw new Error(
                                Error.PACKAGE.ALGORITHM,
                                ErrorCodes.INPUT_TERMINATED_EARLY,
                                isr.toString(),
                                null,
                                null);
            }
            c = (char) nCh;
            szToken += c;
        } while (c != ' ');
        if (szToken.compareTo("(hcsb ") == 0) return new HaarClassifierStumpBase(isr); //$NON-NLS-1$
        else
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            ErrorCodes.PARSE_ERROR,
                            szToken,
                            "(hcsb ",
                            isr.toString());
View Full Code Here

        {

            char[] rC = new char[4];
            isr.read(rC, 0, 4);
            if ("(hr ".compareTo(new String(rC)) != 0) { //$NON-NLS-1$
                throw new Error(
                                Error.PACKAGE.ALGORITHM,
                                ErrorCodes.PARSE_ERROR,
                                new String(rC),
                                "(hr ",
                                isr.toString());
View Full Code Here

           throws jjil.core.Error, IOException
        {
            char[] rC = new char[4];
            isr.read(rC, 0, 4);
            if ("(hf ".compareTo(new String(rC)) != 0) { //$NON-NLS-1$
                throw new Error(
                                Error.PACKAGE.ALGORITHM,
                                ErrorCodes.PARSE_ERROR,
                                new String(rC),
                                "(hf ",
                                isr.toString());
View Full Code Here

    private HaarClassifierTreeBase parent;

    @Override
  public boolean eval(Image image) throws jjil.core.Error {
        if (!(image instanceof Gray32Image)) {
             throw new Error(
                    Error.PACKAGE.ALGORITHM,
                    ErrorCodes.IMAGE_NOT_GRAY32IMAGE,
                    image.toString(),
                    null,
                    null);
View Full Code Here

      
        @Override
    public boolean eval(Image image) throws jjil.core.Error {
            if (!(image instanceof Gray8Image)) {
                 throw new Error(
                                 Error.PACKAGE.ALGORITHM,
                                 ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                                 image.toString(),
                                 null,
                                 null);
View Full Code Here

        for (int i=0; i<n; i++) {
            this.hsc[i] = new HaarClassifierStump(isr, this.width, this.height);
        }
        n = isr.read();
        if (n == -1) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            ErrorCodes.INPUT_TERMINATED_EARLY,
                            isr.toString(),
                            null,
                            null);
        }
        char c = (char) n;
        if (c != ')') {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            ErrorCodes.PARSE_ERROR,
                            new Character(c).toString(),
                            ")",
                            isr.toString());
View Full Code Here

            this.rSortedLabels = new Label[getComponentCount()];
            this.nSortedLabels = -1;
        }
        // see if the requested component is out of bounds
        if (nComponent >= this.rSortedLabels.length) {
            throw new Error(
                    Error.PACKAGE.ALGORITHM,
                    ErrorCodes.CONN_COMP_LABEL_OUT_OF_BOUNDS,
                    new Integer(nComponent).toString(),
                    this.rSortedLabels.toString(),
                    null);
View Full Code Here

TOP

Related Classes of jjil.core.Error

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.