cminpack-1.3.1/ 000755 000765 000765 00000000000 12222761304 015006 5 ustar 00devernay devernay 000000 000000 cminpack-1.3.1/.cproject 000644 000765 000765 00000017401 12222754721 016630 0 ustar 00devernay devernay 000000 000000
cminpack-1.3.1/.project 000644 000765 000765 00000004365 12222754721 016472 0 ustar 00devernay devernay 000000 000000
cminpack
org.eclipse.cdt.managedbuilder.core.genmakebuilder
clean,full,incremental,
?name?
org.eclipse.cdt.make.core.append_environment
true
org.eclipse.cdt.make.core.autoBuildTarget
all
org.eclipse.cdt.make.core.buildArguments
org.eclipse.cdt.make.core.buildCommand
make
org.eclipse.cdt.make.core.cleanBuildTarget
clean
org.eclipse.cdt.make.core.contents
org.eclipse.cdt.make.core.activeConfigSettings
org.eclipse.cdt.make.core.enableAutoBuild
false
org.eclipse.cdt.make.core.enableCleanBuild
true
org.eclipse.cdt.make.core.enableFullBuild
true
org.eclipse.cdt.make.core.fullBuildTarget
all
org.eclipse.cdt.make.core.stopOnError
true
org.eclipse.cdt.make.core.useDefaultBuildCmd
true
org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
org.eclipse.cdt.core.cnature
org.eclipse.cdt.core.ccnature
org.eclipse.cdt.managedbuilder.core.managedBuildNature
org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
cminpack-1.3.1/chkder.c 000644 000765 000765 00000011652 12222754721 016424 0 ustar 00devernay devernay 000000 000000 #include "cminpack.h"
#include
#include "cminpackP.h"
#define log10e 0.43429448190325182765
#define factor 100.
/* Table of constant values */
__cminpack_attr__
void __cminpack_func__(chkder)(int m, int n, const real *x,
real *fvec, real *fjac, int ldfjac, real *xp,
real *fvecp, int mode, real *err)
{
/* Local variables */
int i, j;
real eps, epsf, temp, epsmch;
real epslog;
/* ********** */
/* subroutine chkder */
/* this subroutine checks the gradients of m nonlinear functions */
/* in n variables, evaluated at a point x, for consistency with */
/* the functions themselves. the user must call chkder twice, */
/* first with mode = 1 and then with mode = 2. */
/* mode = 1. on input, x must contain the point of evaluation. */
/* on output, xp is set to a neighboring point. */
/* mode = 2. on input, fvec must contain the functions and the */
/* rows of fjac must contain the gradients */
/* of the respective functions each evaluated */
/* at x, and fvecp must contain the functions */
/* evaluated at xp. */
/* on output, err contains measures of correctness of */
/* the respective gradients. */
/* the subroutine does not perform reliably if cancellation or */
/* rounding errors cause a severe loss of significance in the */
/* evaluation of a function. therefore, none of the components */
/* of x should be unusually small (in particular, zero) or any */
/* other value which may cause loss of significance. */
/* the subroutine statement is */
/* subroutine chkder(m,n,x,fvec,fjac,ldfjac,xp,fvecp,mode,err) */
/* where */
/* m is a positive integer input variable set to the number */
/* of functions. */
/* n is a positive integer input variable set to the number */
/* of variables. */
/* x is an input array of length n. */
/* fvec is an array of length m. on input when mode = 2, */
/* fvec must contain the functions evaluated at x. */
/* fjac is an m by n array. on input when mode = 2, */
/* the rows of fjac must contain the gradients of */
/* the respective functions evaluated at x. */
/* ldfjac is a positive integer input parameter not less than m */
/* which specifies the leading dimension of the array fjac. */
/* xp is an array of length n. on output when mode = 1, */
/* xp is set to a neighboring point of x. */
/* fvecp is an array of length m. on input when mode = 2, */
/* fvecp must contain the functions evaluated at xp. */
/* mode is an integer input variable set to 1 on the first call */
/* and 2 on the second. other values of mode are equivalent */
/* to mode = 1. */
/* err is an array of length m. on output when mode = 2, */
/* err contains measures of correctness of the respective */
/* gradients. if there is no severe loss of significance, */
/* then if err(i) is 1.0 the i-th gradient is correct, */
/* while if err(i) is 0.0 the i-th gradient is incorrect. */
/* for values of err between 0.0 and 1.0, the categorization */
/* is less certain. in general, a value of err(i) greater */
/* than 0.5 indicates that the i-th gradient is probably */
/* correct, while a value of err(i) less than 0.5 indicates */
/* that the i-th gradient is probably incorrect. */
/* subprograms called */
/* minpack supplied ... dpmpar */
/* fortran supplied ... dabs,dlog10,dsqrt */
/* argonne national laboratory. minpack project. march 1980. */
/* burton s. garbow, kenneth e. hillstrom, jorge j. more */
/* ********** */
/* epsmch is the machine precision. */
epsmch = __cminpack_func__(dpmpar)(1);
eps = sqrt(epsmch);
if (mode != 2) {
/* mode = 1. */
for (j = 0; j < n; ++j) {
temp = eps * fabs(x[j]);
if (temp == 0.) {
temp = eps;
}
xp[j] = x[j] + temp;
}
return;
}
/* mode = 2. */
epsf = factor * epsmch;
epslog = log10e * log(eps);
for (i = 0; i < m; ++i) {
err[i] = 0.;
}
for (j = 0; j < n; ++j) {
temp = fabs(x[j]);
if (temp == 0.) {
temp = 1.;
}
for (i = 0; i < m; ++i) {
err[i] += temp * fjac[i + j * ldfjac];
}
}
for (i = 0; i < m; ++i) {
temp = 1.;
if (fvec[i] != 0. && fvecp[i] != 0. &&
fabs(fvecp[i] - fvec[i]) >= epsf * fabs(fvec[i]))
{
temp = eps * fabs((fvecp[i] - fvec[i]) / eps - err[i])
/ (fabs(fvec[i]) +
fabs(fvecp[i]));
}
err[i] = 1.;
if (temp > epsmch && temp < eps) {
err[i] = (log10e * log(temp) - epslog) / epslog;
}
if (temp >= eps) {
err[i] = 0.;
}
}
/* last card of subroutine chkder. */
} /* chkder_ */
cminpack-1.3.1/chkder_.c 000644 000765 000765 00000013160 12222754721 016557 0 ustar 00devernay devernay 000000 000000 /* chkder.f -- translated by f2c (version 20020621).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
#include "minpack.h"
#include
#define real __minpack_real__
#define log10e 0.43429448190325182765
#define factor 100.
/* Table of constant values */
__minpack_attr__
void __minpack_func__(chkder)(const int *m, const int *n, const real *x,
real *fvec, real *fjac, const int *ldfjac, real *xp,
real *fvecp, const int *mode, real *err)
{
/* Initialized data */
const int c__1 = 1;
/* System generated locals */
int fjac_dim1, fjac_offset, i__1, i__2;
/* Local variables */
int i__, j;
real eps, epsf, temp, epsmch;
real epslog;
/* ********** */
/* subroutine chkder */
/* this subroutine checks the gradients of m nonlinear functions */
/* in n variables, evaluated at a point x, for consistency with */
/* the functions themselves. the user must call chkder twice, */
/* first with mode = 1 and then with mode = 2. */
/* mode = 1. on input, x must contain the point of evaluation. */
/* on output, xp is set to a neighboring point. */
/* mode = 2. on input, fvec must contain the functions and the */
/* rows of fjac must contain the gradients */
/* of the respective functions each evaluated */
/* at x, and fvecp must contain the functions */
/* evaluated at xp. */
/* on output, err contains measures of correctness of */
/* the respective gradients. */
/* the subroutine does not perform reliably if cancellation or */
/* rounding errors cause a severe loss of significance in the */
/* evaluation of a function. therefore, none of the components */
/* of x should be unusually small (in particular, zero) or any */
/* other value which may cause loss of significance. */
/* the subroutine statement is */
/* subroutine chkder(m,n,x,fvec,fjac,ldfjac,xp,fvecp,mode,err) */
/* where */
/* m is a positive integer input variable set to the number */
/* of functions. */
/* n is a positive integer input variable set to the number */
/* of variables. */
/* x is an input array of length n. */
/* fvec is an array of length m. on input when mode = 2, */
/* fvec must contain the functions evaluated at x. */
/* fjac is an m by n array. on input when mode = 2, */
/* the rows of fjac must contain the gradients of */
/* the respective functions evaluated at x. */
/* ldfjac is a positive integer input parameter not less than m */
/* which specifies the leading dimension of the array fjac. */
/* xp is an array of length n. on output when mode = 1, */
/* xp is set to a neighboring point of x. */
/* fvecp is an array of length m. on input when mode = 2, */
/* fvecp must contain the functions evaluated at xp. */
/* mode is an integer input variable set to 1 on the first call */
/* and 2 on the second. other values of mode are equivalent */
/* to mode = 1. */
/* err is an array of length m. on output when mode = 2, */
/* err contains measures of correctness of the respective */
/* gradients. if there is no severe loss of significance, */
/* then if err(i) is 1.0 the i-th gradient is correct, */
/* while if err(i) is 0.0 the i-th gradient is incorrect. */
/* for values of err between 0.0 and 1.0, the categorization */
/* is less certain. in general, a value of err(i) greater */
/* than 0.5 indicates that the i-th gradient is probably */
/* correct, while a value of err(i) less than 0.5 indicates */
/* that the i-th gradient is probably incorrect. */
/* subprograms called */
/* minpack supplied ... dpmpar */
/* fortran supplied ... dabs,dlog10,dsqrt */
/* argonne national laboratory. minpack project. march 1980. */
/* burton s. garbow, kenneth e. hillstrom, jorge j. more */
/* ********** */
/* Parameter adjustments */
--err;
--fvecp;
--fvec;
--xp;
--x;
fjac_dim1 = *ldfjac;
fjac_offset = 1 + fjac_dim1 * 1;
fjac -= fjac_offset;
/* Function Body */
/* epsmch is the machine precision. */
epsmch = __minpack_func__(dpmpar)(&c__1);
eps = sqrt(epsmch);
if (*mode == 2) {
goto L20;
}
/* mode = 1. */
i__1 = *n;
for (j = 1; j <= i__1; ++j) {
temp = eps * fabs(x[j]);
if (temp == 0.) {
temp = eps;
}
xp[j] = x[j] + temp;
/* L10: */
}
/* goto L70; */
return;
L20:
/* mode = 2. */
epsf = factor * epsmch;
epslog = log10e * log(eps);
i__1 = *m;
for (i__ = 1; i__ <= i__1; ++i__) {
err[i__] = 0.;
/* L30: */
}
i__1 = *n;
for (j = 1; j <= i__1; ++j) {
temp = fabs(x[j]);
if (temp == 0.) {
temp = 1.;
}
i__2 = *m;
for (i__ = 1; i__ <= i__2; ++i__) {
err[i__] += temp * fjac[i__ + j * fjac_dim1];
/* L40: */
}
/* L50: */
}
i__1 = *m;
for (i__ = 1; i__ <= i__1; ++i__) {
temp = 1.;
if (fvec[i__] != 0. && fvecp[i__] != 0. && fabs(fvecp[i__] -
fvec[i__]) >= epsf * fabs(fvec[i__]))
{
temp = eps * fabs((fvecp[i__] - fvec[i__]) / eps - err[i__])
/ (fabs(fvec[i__]) +
fabs(fvecp[i__]));
}
err[i__] = 1.;
if (temp > epsmch && temp < eps) {
err[i__] = (log10e * log(temp) - epslog) / epslog;
}
if (temp >= eps) {
err[i__] = 0.;
}
/* L60: */
}
/* L70: */
/* return 0; */
/* last card of subroutine chkder. */
} /* chkder_ */
cminpack-1.3.1/cmake/ 000755 000765 000765 00000000000 12222754721 016073 5 ustar 00devernay devernay 000000 000000 cminpack-1.3.1/CMakeLists.txt 000644 000765 000765 00000005111 12222754721 017551 0 ustar 00devernay devernay 000000 000000 # The name of our project is "CMINPACK". CMakeLists files in this project can
# refer to the root source directory of the project as ${CMINPACK_SOURCE_DIR} and
# to the root binary directory of the project as ${CMINPACK_BINARY_DIR}.
cmake_minimum_required (VERSION 2.6)
project (CMINPACK)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
include(${PROJECT_SOURCE_DIR}/cmake/cminpack_utils.cmake)
# Set version and OS-specific settings
set(CMINPACK_VERSION 1.3.0 CACHE STRING "CMinpack version")
DISSECT_VERSION()
GET_OS_INFO()
# Add an "uninstall" target
CONFIGURE_FILE ("${PROJECT_SOURCE_DIR}/cmake/uninstall_target.cmake.in"
"${PROJECT_BINARY_DIR}/uninstall_target.cmake" IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET (uninstall "${CMAKE_COMMAND}" -P
"${PROJECT_BINARY_DIR}/uninstall_target.cmake")
enable_testing()
if (OS_LINUX)
option (USE_FPIC "Use the -fPIC compiler flag." ON)
else (OS_LINUX)
option (USE_FPIC "Use the -fPIC compiler flag." OFF)
endif (OS_LINUX)
option (SHARED_LIBS "Build shared libraries instead of static." OFF)
if (SHARED_LIBS)
message (STATUS "Building shared libraries.")
set (LIB_TYPE SHARED)
else (SHARED_LIBS)
message (STATUS "Building static libraries.")
set (LIB_TYPE STATIC)
if(WIN32)
add_definitions(-DCMINPACK_NO_DLL)
endif(WIN32)
endif (SHARED_LIBS)
#set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}/../build)
add_subdirectory (cmake)
add_subdirectory (examples)
set (cminpack_srcs
cminpack.h cminpackP.h
chkder.c enorm.c hybrd1.c hybrj.c lmdif1.c lmstr1.c qrfac.c r1updt.c
dogleg.c fdjac1.c hybrd.c lmder1.c lmdif.c lmstr.c qrsolv.c rwupdt.c
dpmpar.c fdjac2.c hybrj1.c lmder.c lmpar.c qform.c r1mpyq.c covar.c covar1.c
minpack.h
chkder_.c enorm_.c hybrd1_.c hybrj_.c lmdif1_.c lmstr1_.c qrfac_.c r1updt_.c
dogleg_.c fdjac1_.c hybrd_.c lmder1_.c lmdif_.c lmstr_.c qrsolv_.c rwupdt_.c
dpmpar_.c fdjac2_.c hybrj1_.c lmder_.c lmpar_.c qform_.c r1mpyq_.c covar_.c
)
set (cminpack_hdrs
cminpack.h minpack.h)
add_library (cminpack ${LIB_TYPE} ${cminpack_srcs})
install (TARGETS cminpack
LIBRARY DESTINATION ${CMINPACK_LIB_INSTALL_DIR} COMPONENT library
ARCHIVE DESTINATION ${CMINPACK_LIB_INSTALL_DIR} COMPONENT library
RUNTIME DESTINATION ${CMINPACK_LIB_INSTALL_DIR} COMPONENT library)
install (FILES ${cminpack_hdrs} DESTINATION ${CMINPACK_INCLUDE_INSTALL_DIR}
COMPONENT cminpack_hdrs)
if (USE_FPIC AND NOT SHARED_LIBS)
set_target_properties (cminpack PROPERTIES COMPILE_FLAGS -fPIC)
endif (USE_FPIC AND NOT SHARED_LIBS)
set_target_properties(cminpack PROPERTIES VERSION ${CMINPACK_VERSION})
cminpack-1.3.1/cminpack.h 000644 000765 000765 00000042650 12222754721 016760 0 ustar 00devernay devernay 000000 000000 /* Header file for cminpack, by Frederic Devernay.
The documentation for all functions can be found in the file
minpack-documentation.txt from the distribution, or in the source
code of each function. */
#ifndef __CMINPACK_H__
#define __CMINPACK_H__
/* The default floating-point type is "double" for C/C++ and "float" for CUDA,
but you can change this by defining one of the following symbols when
compiling the library, and before including cminpack.h when using it:
__cminpack_double__ for double
__cminpack_float__ for float
__cminpack_half__ for half from the OpenEXR library (in this case, you must
compile cminpack with a C++ compiler)
*/
#ifdef __cminpack_double__
#define __cminpack_real__ double
#endif
#ifdef __cminpack_float__
#define __cminpack_real__ float
#endif
#ifdef __cminpack_half__
#include
#define __cminpack_real__ half
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Cmake will define cminpack_EXPORTS on Windows when it
configures to build a shared library. If you are going to use
another build system on windows or create the visual studio
projects by hand you need to define cminpack_EXPORTS when
building a DLL on windows.
*/
#if defined (__GNUC__)
#define CMINPACK_DECLSPEC_EXPORT __declspec(__dllexport__)
#define CMINPACK_DECLSPEC_IMPORT __declspec(__dllimport__)
#endif
#if defined (_MSC_VER) || defined (__BORLANDC__)
#define CMINPACK_DECLSPEC_EXPORT __declspec(dllexport)
#define CMINPACK_DECLSPEC_IMPORT __declspec(dllimport)
#endif
#ifdef __WATCOMC__
#define CMINPACK_DECLSPEC_EXPORT __export
#define CMINPACK_DECLSPEC_IMPORT __import
#endif
#ifdef __IBMC__
#define CMINPACK_DECLSPEC_EXPORT _Export
#define CMINPACK_DECLSPEC_IMPORT _Import
#endif
#if !defined(CMINPACK_NO_DLL) && (defined(__WIN32__) || defined(WIN32) || defined (_WIN32))
#if defined(cminpack_EXPORTS) || defined(CMINPACK_EXPORTS) || defined(CMINPACK_DLL_EXPORTS)
#define CMINPACK_EXPORT CMINPACK_DECLSPEC_EXPORT
#else
#define CMINPACK_EXPORT CMINPACK_DECLSPEC_IMPORT
#endif /* cminpack_EXPORTS */
#else /* defined (_WIN32) */
#define CMINPACK_EXPORT
#endif
#if defined(__CUDA_ARCH__) || defined(__CUDACC__)
#define __cminpack_attr__ __device__
#ifndef __cminpack_real__
#define __cminpack_float__
#define __cminpack_real__ float
#endif
#define __cminpack_type_fcn_nn__ __cminpack_attr__ int fcn_nn
#define __cminpack_type_fcnder_nn__ __cminpack_attr__ int fcnder_nn
#define __cminpack_type_fcn_mn__ __cminpack_attr__ int fcn_mn
#define __cminpack_type_fcnder_mn__ __cminpack_attr__ int fcnder_mn
#define __cminpack_type_fcnderstr_mn__ __cminpack_attr__ int fcnderstr_mn
#define __cminpack_decl_fcn_nn__
#define __cminpack_decl_fcnder_nn__
#define __cminpack_decl_fcn_mn__
#define __cminpack_decl_fcnder_mn__
#define __cminpack_decl_fcnderstr_mn__
#define __cminpack_param_fcn_nn__
#define __cminpack_param_fcnder_nn__
#define __cminpack_param_fcn_mn__
#define __cminpack_param_fcnder_mn__
#define __cminpack_param_fcnderstr_mn__
#else
#define __cminpack_attr__
#ifndef __cminpack_real__
#define __cminpack_double__
#define __cminpack_real__ double
#endif
#define __cminpack_type_fcn_nn__ typedef int (*cminpack_func_nn)
#define __cminpack_type_fcnder_nn__ typedef int (*cminpack_funcder_nn)
#define __cminpack_type_fcn_mn__ typedef int (*cminpack_func_mn)
#define __cminpack_type_fcnder_mn__ typedef int (*cminpack_funcder_mn)
#define __cminpack_type_fcnderstr_mn__ typedef int (*cminpack_funcderstr_mn)
#define __cminpack_decl_fcn_nn__ cminpack_func_nn fcn_nn,
#define __cminpack_decl_fcnder_nn__ cminpack_funcder_nn fcnder_nn,
#define __cminpack_decl_fcn_mn__ cminpack_func_mn fcn_mn,
#define __cminpack_decl_fcnder_mn__ cminpack_funcder_mn fcnder_mn,
#define __cminpack_decl_fcnderstr_mn__ cminpack_funcderstr_mn fcnderstr_mn,
#define __cminpack_param_fcn_nn__ fcn_nn,
#define __cminpack_param_fcnder_nn__ fcnder_nn,
#define __cminpack_param_fcn_mn__ fcn_mn,
#define __cminpack_param_fcnder_mn__ fcnder_mn,
#define __cminpack_param_fcnderstr_mn__ fcnderstr_mn,
#endif
#ifdef __cminpack_double__
#define __cminpack_func__(func) func
#endif
#ifdef __cminpack_float__
#define __cminpack_func__(func) s ## func
#endif
#ifdef __cminpack_half__
#define __cminpack_func__(func) h ## func
#endif
/* Declarations for minpack */
/* Function types: */
/* The first argument can be used to store extra function parameters, thus */
/* avoiding the use of global variables. */
/* the iflag parameter is input-only (with respect to the FORTRAN */
/* version), the output iflag value is the return value of the function. */
/* If iflag=0, the function shoulkd just print the current values (see */
/* the nprint parameters below). */
/* for hybrd1 and hybrd: */
/* calculate the functions at x and */
/* return this vector in fvec. */
/* return a negative value to terminate hybrd1/hybrd */
__cminpack_type_fcn_nn__(void *p, int n, const __cminpack_real__ *x, __cminpack_real__ *fvec, int iflag );
/* for hybrj1 and hybrj */
/* if iflag = 1 calculate the functions at x and */
/* return this vector in fvec. do not alter fjac. */
/* if iflag = 2 calculate the jacobian at x and */
/* return this matrix in fjac. do not alter fvec. */
/* return a negative value to terminate hybrj1/hybrj */
__cminpack_type_fcnder_nn__(void *p, int n, const __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ *fjac,
int ldfjac, int iflag );
/* for lmdif1 and lmdif */
/* calculate the functions at x and */
/* return this vector in fvec. */
/* if iflag = 1 the result is used to compute the residuals. */
/* if iflag = 2 the result is used to compute the Jacobian by finite differences. */
/* Jacobian computation requires exactly n function calls with iflag = 2. */
/* return a negative value to terminate lmdif1/lmdif */
__cminpack_type_fcn_mn__(void *p, int m, int n, const __cminpack_real__ *x, __cminpack_real__ *fvec,
int iflag );
/* for lmder1 and lmder */
/* if iflag = 1 calculate the functions at x and */
/* return this vector in fvec. do not alter fjac. */
/* if iflag = 2 calculate the jacobian at x and */
/* return this matrix in fjac. do not alter fvec. */
/* return a negative value to terminate lmder1/lmder */
__cminpack_type_fcnder_mn__(void *p, int m, int n, const __cminpack_real__ *x, __cminpack_real__ *fvec,
__cminpack_real__ *fjac, int ldfjac, int iflag );
/* for lmstr1 and lmstr */
/* if iflag = 1 calculate the functions at x and */
/* return this vector in fvec. */
/* if iflag = i calculate the (i-1)-st row of the */
/* jacobian at x and return this vector in fjrow. */
/* return a negative value to terminate lmstr1/lmstr */
__cminpack_type_fcnderstr_mn__(void *p, int m, int n, const __cminpack_real__ *x, __cminpack_real__ *fvec,
__cminpack_real__ *fjrow, int iflag );
/* MINPACK functions: */
/* the info parameter was removed from most functions: the return */
/* value of the function is used instead. */
/* The argument 'p' can be used to store extra function parameters, thus */
/* avoiding the use of global variables. You can also think of it as a */
/* 'this' pointer a la C++. */
/* find a zero of a system of N nonlinear functions in N variables by
a modification of the Powell hybrid method (Jacobian calculated by
a forward-difference approximation) */
__cminpack_attr__
int CMINPACK_EXPORT __cminpack_func__(hybrd1)( __cminpack_decl_fcn_nn__
void *p, int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ tol,
__cminpack_real__ *wa, int lwa );
/* find a zero of a system of N nonlinear functions in N variables by
a modification of the Powell hybrid method (Jacobian calculated by
a forward-difference approximation, more general). */
__cminpack_attr__
int CMINPACK_EXPORT __cminpack_func__(hybrd)( __cminpack_decl_fcn_nn__
void *p, int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ xtol, int maxfev,
int ml, int mu, __cminpack_real__ epsfcn, __cminpack_real__ *diag, int mode,
__cminpack_real__ factor, int nprint, int *nfev,
__cminpack_real__ *fjac, int ldfjac, __cminpack_real__ *r, int lr, __cminpack_real__ *qtf,
__cminpack_real__ *wa1, __cminpack_real__ *wa2, __cminpack_real__ *wa3, __cminpack_real__ *wa4);
/* find a zero of a system of N nonlinear functions in N variables by
a modification of the Powell hybrid method (user-supplied Jacobian) */
__cminpack_attr__
int CMINPACK_EXPORT __cminpack_func__(hybrj1)( __cminpack_decl_fcnder_nn__ void *p, int n, __cminpack_real__ *x,
__cminpack_real__ *fvec, __cminpack_real__ *fjac, int ldfjac, __cminpack_real__ tol,
__cminpack_real__ *wa, int lwa );
/* find a zero of a system of N nonlinear functions in N variables by
a modification of the Powell hybrid method (user-supplied Jacobian,
more general) */
__cminpack_attr__
int CMINPACK_EXPORT __cminpack_func__(hybrj)( __cminpack_decl_fcnder_nn__ void *p, int n, __cminpack_real__ *x,
__cminpack_real__ *fvec, __cminpack_real__ *fjac, int ldfjac, __cminpack_real__ xtol,
int maxfev, __cminpack_real__ *diag, int mode, __cminpack_real__ factor,
int nprint, int *nfev, int *njev, __cminpack_real__ *r,
int lr, __cminpack_real__ *qtf, __cminpack_real__ *wa1, __cminpack_real__ *wa2,
__cminpack_real__ *wa3, __cminpack_real__ *wa4 );
/* minimize the sum of the squares of nonlinear functions in N
variables by a modification of the Levenberg-Marquardt algorithm
(Jacobian calculated by a forward-difference approximation) */
__cminpack_attr__
int CMINPACK_EXPORT __cminpack_func__(lmdif1)( __cminpack_decl_fcn_mn__
void *p, int m, int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ tol,
int *iwa, __cminpack_real__ *wa, int lwa );
/* minimize the sum of the squares of nonlinear functions in N
variables by a modification of the Levenberg-Marquardt algorithm
(Jacobian calculated by a forward-difference approximation, more
general) */
__cminpack_attr__
int CMINPACK_EXPORT __cminpack_func__(lmdif)( __cminpack_decl_fcn_mn__
void *p, int m, int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ ftol,
__cminpack_real__ xtol, __cminpack_real__ gtol, int maxfev, __cminpack_real__ epsfcn,
__cminpack_real__ *diag, int mode, __cminpack_real__ factor, int nprint,
int *nfev, __cminpack_real__ *fjac, int ldfjac, int *ipvt,
__cminpack_real__ *qtf, __cminpack_real__ *wa1, __cminpack_real__ *wa2, __cminpack_real__ *wa3,
__cminpack_real__ *wa4 );
/* minimize the sum of the squares of nonlinear functions in N
variables by a modification of the Levenberg-Marquardt algorithm
(user-supplied Jacobian) */
__cminpack_attr__
int CMINPACK_EXPORT __cminpack_func__(lmder1)( __cminpack_decl_fcnder_mn__
void *p, int m, int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ *fjac,
int ldfjac, __cminpack_real__ tol, int *ipvt,
__cminpack_real__ *wa, int lwa );
/* minimize the sum of the squares of nonlinear functions in N
variables by a modification of the Levenberg-Marquardt algorithm
(user-supplied Jacobian, more general) */
__cminpack_attr__
int CMINPACK_EXPORT __cminpack_func__(lmder)( __cminpack_decl_fcnder_mn__
void *p, int m, int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ *fjac,
int ldfjac, __cminpack_real__ ftol, __cminpack_real__ xtol, __cminpack_real__ gtol,
int maxfev, __cminpack_real__ *diag, int mode, __cminpack_real__ factor,
int nprint, int *nfev, int *njev, int *ipvt,
__cminpack_real__ *qtf, __cminpack_real__ *wa1, __cminpack_real__ *wa2, __cminpack_real__ *wa3,
__cminpack_real__ *wa4 );
/* minimize the sum of the squares of nonlinear functions in N
variables by a modification of the Levenberg-Marquardt algorithm
(user-supplied Jacobian, minimal storage) */
__cminpack_attr__
int CMINPACK_EXPORT __cminpack_func__(lmstr1)( __cminpack_decl_fcnderstr_mn__ void *p, int m, int n,
__cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ *fjac, int ldfjac,
__cminpack_real__ tol, int *ipvt, __cminpack_real__ *wa, int lwa );
/* minimize the sum of the squares of nonlinear functions in N
variables by a modification of the Levenberg-Marquardt algorithm
(user-supplied Jacobian, minimal storage, more general) */
__cminpack_attr__
int CMINPACK_EXPORT __cminpack_func__(lmstr)( __cminpack_decl_fcnderstr_mn__ void *p, int m,
int n, __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ *fjac,
int ldfjac, __cminpack_real__ ftol, __cminpack_real__ xtol, __cminpack_real__ gtol,
int maxfev, __cminpack_real__ *diag, int mode, __cminpack_real__ factor,
int nprint, int *nfev, int *njev, int *ipvt,
__cminpack_real__ *qtf, __cminpack_real__ *wa1, __cminpack_real__ *wa2, __cminpack_real__ *wa3,
__cminpack_real__ *wa4 );
__cminpack_attr__
void CMINPACK_EXPORT __cminpack_func__(chkder)( int m, int n, const __cminpack_real__ *x, __cminpack_real__ *fvec, __cminpack_real__ *fjac,
int ldfjac, __cminpack_real__ *xp, __cminpack_real__ *fvecp, int mode,
__cminpack_real__ *err );
__cminpack_attr__
__cminpack_real__ CMINPACK_EXPORT __cminpack_func__(dpmpar)( int i );
__cminpack_attr__
__cminpack_real__ CMINPACK_EXPORT __cminpack_func__(enorm)( int n, const __cminpack_real__ *x );
/* compute a forward-difference approximation to the m by n jacobian
matrix associated with a specified problem of m functions in n
variables. */
__cminpack_attr__
int CMINPACK_EXPORT __cminpack_func__(fdjac2)(__cminpack_decl_fcn_mn__
void *p, int m, int n, __cminpack_real__ *x, const __cminpack_real__ *fvec, __cminpack_real__ *fjac,
int ldfjac, __cminpack_real__ epsfcn, __cminpack_real__ *wa);
/* compute a forward-difference approximation to the n by n jacobian
matrix associated with a specified problem of n functions in n
variables. if the jacobian has a banded form, then function
evaluations are saved by only approximating the nonzero terms. */
__cminpack_attr__
int CMINPACK_EXPORT __cminpack_func__(fdjac1)(__cminpack_decl_fcn_nn__
void *p, int n, __cminpack_real__ *x, const __cminpack_real__ *fvec, __cminpack_real__ *fjac, int ldfjac,
int ml, int mu, __cminpack_real__ epsfcn, __cminpack_real__ *wa1,
__cminpack_real__ *wa2);
/* compute inverse(JtJ) after a run of lmdif or lmder. The covariance matrix is obtained
by scaling the result by enorm(y)**2/(m-n). If JtJ is singular and k = rank(J), the
pseudo-inverse is computed, and the result has to be scaled by enorm(y)**2/(m-k). */
__cminpack_attr__
void CMINPACK_EXPORT __cminpack_func__(covar)(int n, __cminpack_real__ *r, int ldr,
const int *ipvt, __cminpack_real__ tol, __cminpack_real__ *wa);
/* covar1 estimates the variance-covariance matrix:
C = sigma**2 (JtJ)**+
where (JtJ)**+ is the inverse of JtJ or the pseudo-inverse of JtJ (in case J does not have full rank),
and sigma**2 = fsumsq / (m - k)
where fsumsq is the residual sum of squares and k is the rank of J.
The function returns 0 if J has full rank, else the rank of J.
*/
__cminpack_attr__
int CMINPACK_EXPORT __cminpack_func__(covar1)(int m, int n, __cminpack_real__ fsumsq, __cminpack_real__ *r, int ldr,
const int *ipvt, __cminpack_real__ tol, __cminpack_real__ *wa);
/* internal MINPACK subroutines */
__cminpack_attr__
void __cminpack_func__(dogleg)(int n, const __cminpack_real__ *r, int lr,
const __cminpack_real__ *diag, const __cminpack_real__ *qtb, __cminpack_real__ delta, __cminpack_real__ *x,
__cminpack_real__ *wa1, __cminpack_real__ *wa2);
__cminpack_attr__
void __cminpack_func__(qrfac)(int m, int n, __cminpack_real__ *a, int
lda, int pivot, int *ipvt, int lipvt, __cminpack_real__ *rdiag,
__cminpack_real__ *acnorm, __cminpack_real__ *wa);
__cminpack_attr__
void __cminpack_func__(qrsolv)(int n, __cminpack_real__ *r, int ldr,
const int *ipvt, const __cminpack_real__ *diag, const __cminpack_real__ *qtb, __cminpack_real__ *x,
__cminpack_real__ *sdiag, __cminpack_real__ *wa);
__cminpack_attr__
void __cminpack_func__(qform)(int m, int n, __cminpack_real__ *q, int
ldq, __cminpack_real__ *wa);
__cminpack_attr__
void __cminpack_func__(r1updt)(int m, int n, __cminpack_real__ *s, int
ls, const __cminpack_real__ *u, __cminpack_real__ *v, __cminpack_real__ *w, int *sing);
__cminpack_attr__
void __cminpack_func__(r1mpyq)(int m, int n, __cminpack_real__ *a, int
lda, const __cminpack_real__ *v, const __cminpack_real__ *w);
__cminpack_attr__
void __cminpack_func__(lmpar)(int n, __cminpack_real__ *r, int ldr,
const int *ipvt, const __cminpack_real__ *diag, const __cminpack_real__ *qtb, __cminpack_real__ delta,
__cminpack_real__ *par, __cminpack_real__ *x, __cminpack_real__ *sdiag, __cminpack_real__ *wa1,
__cminpack_real__ *wa2);
__cminpack_attr__
void __cminpack_func__(rwupdt)(int n, __cminpack_real__ *r, int ldr,
const __cminpack_real__ *w, __cminpack_real__ *b, __cminpack_real__ *alpha, __cminpack_real__ *cos,
__cminpack_real__ *sin);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __CMINPACK_H__ */
cminpack-1.3.1/cminpack.sln 000644 000765 000765 00000002475 12222754721 017326 0 ustar 00devernay devernay 000000 000000
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cminpack", "cminpack.vcproj", "{DFCA12EC-B869-49B9-920D-F14FFB48529F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cminpack_dll", "cminpack_dll.vcproj", "{7A715393-C1E6-41D2-9A47-DA8501440F71}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DFCA12EC-B869-49B9-920D-F14FFB48529F}.Debug|Win32.ActiveCfg = Debug|Win32
{DFCA12EC-B869-49B9-920D-F14FFB48529F}.Debug|Win32.Build.0 = Debug|Win32
{DFCA12EC-B869-49B9-920D-F14FFB48529F}.Release|Win32.ActiveCfg = Release|Win32
{DFCA12EC-B869-49B9-920D-F14FFB48529F}.Release|Win32.Build.0 = Release|Win32
{7A715393-C1E6-41D2-9A47-DA8501440F71}.Debug|Win32.ActiveCfg = Debug|Win32
{7A715393-C1E6-41D2-9A47-DA8501440F71}.Debug|Win32.Build.0 = Debug|Win32
{7A715393-C1E6-41D2-9A47-DA8501440F71}.Release|Win32.ActiveCfg = Release|Win32
{7A715393-C1E6-41D2-9A47-DA8501440F71}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
cminpack-1.3.1/cminpack.vcproj 000644 000765 000765 00000025704 12222754721 020035 0 ustar 00devernay devernay 000000 000000
cminpack-1.3.1/cminpack.vcxproj 000644 000765 000765 00000027400 12222754721 020220 0 ustar 00devernay devernay 000000 000000
Debug DLL
Win32
Debug
Win32
Release (no sbw)
Win32
Release DLL
Win32
Release
Win32
{DFCA12EC-B869-49B9-920D-F14FFB48529F}
cminpack
Win32Proj
StaticLibrary
Dynamic
MultiByte
StaticLibrary
Dynamic
MultiByte
StaticLibrary
Dynamic
MultiByte
StaticLibrary
Dynamic
MultiByte
StaticLibrary
Dynamic
MultiByte
<_ProjectFileVersion>10.0.40219.1
$(Configuration)\
$(Configuration)\
$(Configuration)\
$(Configuration)\
$(Configuration)\
$(Configuration)\
$(Configuration)\
$(Configuration)\
$(Configuration)\
$(Configuration)\
Disabled
%(AdditionalIncludeDirectories)
WIN32;_DEBUG;_LIB;CMINPACK_NO_DLL;%(PreprocessorDefinitions)
true
EnableFastChecks
MultiThreadedDebugDLL
Level3
EditAndContinue
Full
AnySuitable
true
Speed
true
%(AdditionalIncludeDirectories)
WIN32;NDEBUG;_LIB;CMINPACK_NO_DLL;%(PreprocessorDefinitions)
MultiThreadedDLL
Level3
Full
AnySuitable
true
Speed
true
%(AdditionalIncludeDirectories)
WIN32;NDEBUG;_LIB;CMINPACK_NO_DLL;%(PreprocessorDefinitions)
MultiThreadedDLL
Level3
Disabled
%(AdditionalIncludeDirectories)
WIN32;_DEBUG;_LIB;cminpack_EXPORTS;%(PreprocessorDefinitions)
true
EnableFastChecks
MultiThreadedDebugDLL
Level3
EditAndContinue
Full
AnySuitable
true
Speed
true
%(AdditionalIncludeDirectories)
WIN32;NDEBUG;_LIB;cminpack_EXPORTS;%(PreprocessorDefinitions)
MultiThreadedDLL
Level3