    001    /*
    002     * Licensed to the Apache Software Foundation (ASF) under one or more
    003     * contributor license agreements.  See the NOTICE file distributed with
    004     * this work for additional information regarding copyright ownership.
    005     * The ASF licenses this file to You under the Apache License, Version 2.0
    006     * (the "License"); you may not use this file except in compliance with
    007     * the License.  You may obtain a copy of the License at
    008     *
    009     *      http://www.apache.org/licenses/LICENSE-2.0
    010     *
    011     * Unless required by applicable law or agreed to in writing, software
    012     * distributed under the License is distributed on an "AS IS" BASIS,
    013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014     * See the License for the specific language governing permissions and
    015     * limitations under the License.
    016     */
    017
    018    package org.apache.commons.math3.stat.ranking;
    019
    020    /**
    021     * Strategies for handling NaN values in rank transformations.
    022     * <ul>
    023     * <li>MINIMAL - NaNs are treated as minimal in the ordering, equivalent to
    024     * (that is, tied with) <code>Double.NEGATIVE_INFINITY</code>.</li>
    025     * <li>MAXIMAL - NaNs are treated as maximal in the ordering, equivalent to
    026     * <code>Double.POSITIVE_INFINITY</code></li>
    027     * <li>REMOVED - NaNs are removed before the rank transform is applied</li>
    028     * <li>FIXED - NaNs are left "in place," that is the rank transformation is
    029     * applied to the other elements in the input array, but the NaN elements
    030     * are returned unchanged.</li>
    031     * <li>FAILED - If any NaN is encountered in the input array, an appropriate
    032     * exception is thrown</li>
    033     * </ul>
    034     *
    035     * @since 2.0
    036     * @version $Id: NaNStrategy.java 1422313 2012-12-15 18:53:41Z psteitz $
    037     */
    038    public enum NaNStrategy {
    039
    040        /** NaNs are considered minimal in the ordering */
    041        MINIMAL,
    042
    043        /** NaNs are considered maximal in the ordering */
    044        MAXIMAL,
    045
    046        /** NaNs are removed before computing ranks */
    047        REMOVED,
    048
    049        /** NaNs are left in place */
    050        FIXED,
    051
    052        /** NaNs result in an exception
    053         * @since 3.1
    054         */
    055        FAILED
    056    }