Save This Page
Home » mahout-collections-1.0-src » org.apache.mahout.collections » [javadoc | source]
    1   /**
    2    * Licensed to the Apache Software Foundation (ASF) under one
    3    * or more contributor license agreements. See the NOTICE file
    4    * distributed with this work for additional information
    5    * regarding copyright ownership. The ASF licenses this file
    6    * to you under the Apache License, Version 2.0 (the
    7    * "License"); you may not use this file except in compliance
    8    * with the License. You may obtain a copy of the License at
    9    *
   10    * http://www.apache.org/licenses/LICENSE-2.0
   11    *
   12    * Unless required by applicable law or agreed to in writing,
   13    * software distributed under the License is distributed on an
   14    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   15    * KIND, either express or implied. See the License for the
   16    * specific language governing permissions and limitations
   17    * under the License.
   18    */
   19   
   20   /*
   21   Copyright 1999 CERN - European Organization for Nuclear Research.
   22   Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose 
   23   is hereby granted without fee, provided that the above copyright notice appear in all copies and 
   24   that both that copyright notice and this permission notice appear in supporting documentation. 
   25   CERN makes no representations about the suitability of this software for any purpose. 
   26   It is provided "as is" without expressed or implied warranty.
   27   */
   28   package org.apache.mahout.collections;
   29   
   30   /**
   31    * Defines some useful constants.
   32    */
   33   public class Constants {
   34     /*
   35      * machine constants
   36      */
   37     protected static final double MACHEP = 1.11022302462515654042E-16;
   38     protected static final double MAXLOG = 7.09782712893383996732E2;
   39     protected static final double MINLOG = -7.451332191019412076235E2;
   40     protected static final double MAXGAM = 171.624376956302725;
   41     protected static final double SQTPI = 2.50662827463100050242E0;
   42     protected static final double SQRTH = 7.07106781186547524401E-1;
   43     protected static final double LOGPI = 1.14472988584940017414;
   44   
   45     protected static final double big = 4.503599627370496e15;
   46     protected static final double biginv = 2.22044604925031308085e-16;
   47   
   48   
   49     /*
   50    * MACHEP =  1.38777878078144567553E-17       2**-56
   51    * MAXLOG =  8.8029691931113054295988E1       log(2**127)
   52    * MINLOG = -8.872283911167299960540E1        log(2**-128)
   53    * MAXNUM =  1.701411834604692317316873e38    2**127
   54    *
   55    * For IEEE arithmetic (IBMPC):
   56    * MACHEP =  1.11022302462515654042E-16       2**-53
   57    * MAXLOG =  7.09782712893383996843E2         log(2**1024)
   58    * MINLOG = -7.08396418532264106224E2         log(2**-1022)
   59    * MAXNUM =  1.7976931348623158E308           2**1024
   60    *
   61    * The global symbols for mathematical constants are
   62    * PI     =  3.14159265358979323846           pi
   63    * PIO2   =  1.57079632679489661923           pi/2
   64    * PIO4   =  7.85398163397448309616E-1        pi/4
   65    * SQRT2  =  1.41421356237309504880           sqrt(2)
   66    * SQRTH  =  7.07106781186547524401E-1        sqrt(2)/2
   67    * LOG2E  =  1.4426950408889634073599         1/log(2)
   68    * SQ2OPI =  7.9788456080286535587989E-1      sqrt( 2/pi )
   69    * LOGE2  =  6.93147180559945309417E-1        log(2)
   70    * LOGSQ2 =  3.46573590279972654709E-1        log(2)/2
   71    * THPIO4 =  2.35619449019234492885           3*pi/4
   72    * TWOOPI =  6.36619772367581343075535E-1     2/pi
   73    */
   74     protected Constants() {
   75     }
   76   }

Save This Page
Home » mahout-collections-1.0-src » org.apache.mahout.collections » [javadoc | source]