RAPI
R_ext/stats_package.h
Go to the documentation of this file.
00001 /*
00002  *  R : A Computer Language for Statistical Data Analysis
00003  *  Copyright (C) 2007  The R Core Team.
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU Lesser General Public License as published by
00007  *  the Free Software Foundation; either version 2.1 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU Lesser General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Lesser General Public License
00016  *  along with this program; if not, a copy is available at
00017  *  https://www.R-project.org/Licenses/
00018  */
00019 
00020 #ifndef R_STATS_PACKAGE_H
00021 #define R_STATS_PACKAGE_H
00022 #include <Rconfig.h>
00023 
00024 #ifdef HAVE_VISIBILITY_ATTRIBUTE
00025 # define attribute_hidden __attribute__ ((visibility ("hidden")))
00026 #else
00027 # define attribute_hidden
00028 #endif
00029 
00030 enum AlgType {NREG = 1, OPT = 2};
00031                 /* 0-based indices into v */
00032 enum  VPos {F = 9, F0 = 12, FDIF = 10, G = 27, HC = 70};
00033                 /* 0-based indices into iv */
00034 enum IVPos {AI = 90, AM = 94, ALGSAV = 50, COVMAT = 25,
00035         COVPRT = 13, COVREQ = 14, DRADPR = 100,
00036         DTYPE = 15, IERR = 74, INITH = 24, INITS = 24,
00037         IPIVOT = 75, IVNEED =  2, LASTIV = 42, LASTV = 44,
00038         LMAT =  41, MXFCAL = 16, MXITER = 17, NEXTV  = 46,
00039         NFCALL =  5, NFCOV = 51, NFGCAL = 6, NGCOV = 52,
00040         NITER = 30, NVDFLT = 49, NVSAVE = 8, OUTLEV = 18,
00041         PARPRT = 19, PARSAV = 48, PERM = 57, PRUNIT = 20,
00042         QRTYP = 79, RDREQ = 56, RMAT = 77, SOLPRT = 21,
00043         STATPR = 22, TOOBIG = 1, VNEED = 3, VSAVE = 59,
00044         X0PRT = 23};
00045 
00046 void attribute_hidden
00047 S_Rf_divset(int alg, int iv[], int liv, int lv, double v[]);
00048 
00049 void attribute_hidden
00050 S_nlsb_iterate(double b[], double d[], double dr[], int iv[],
00051            int liv, int lv, int n, int nd, int p,
00052            double r[], double rd[], double v[], double x[]);
00053 
00054 void attribute_hidden
00055 S_nlminb_iterate(double b[], double d[], double fx, double g[],
00056          double h[], int iv[], int liv, int lv, int n,
00057          double v[], double x[]);
00058 
00059 static R_INLINE int S_v_length(int alg, int n)
00060 {
00061     return (alg - 1) ? (105 + (n * (2 * n + 20))) :
00062     (130 + (n * (n + 27))/2);
00063 }
00064 
00065 static R_INLINE int S_iv_length(int alg, int n)
00066 {
00067     return (alg - 1) ? (82 + 4 * n) : (78 + 3 * n);
00068 }
00069 
00070 #endif /* R_STATS_PACKAGE_H */
00071 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines