source: ThirdParty/levmar/src/lmbleic.c@ 93ea13d

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_levmar Subpackage_vmg TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 93ea13d was 8ce1a9, checked in by Frederik Heber <heber@…>, 8 years ago

Merge commit '5443b10a06f0c125d0ae0500abb09901fda9666b' as 'ThirdParty/levmar'

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/////////////////////////////////////////////////////////////////////////////////
2//
3// Levenberg - Marquardt non-linear minimization algorithm
4// Copyright (C) 2009 Manolis Lourakis (lourakis at ics forth gr)
5// Institute of Computer Science, Foundation for Research & Technology - Hellas
6// Heraklion, Crete, Greece.
7//
8// This program is free software; you can redistribute it and/or modify
9// it under the terms of the GNU General Public License as published by
10// the Free Software Foundation; either version 2 of the License, or
11// (at your option) any later version.
12//
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18/////////////////////////////////////////////////////////////////////////////////
19
20/*******************************************************************************
21 * Wrappers for linear inequality constrained Levenberg-Marquardt minimization.
22 * The same core code is used with appropriate #defines to derive single and
23 * double precision versions, see also lmbleic_core.c
24 *******************************************************************************/
25
26#include <stdio.h>
27#include <stdlib.h>
28#include <math.h>
29#include <float.h>
30
31#include "levmar.h"
32#include "misc.h"
33
34
35#ifndef HAVE_LAPACK
36
37#ifdef _MSC_VER
38#pragma message("Linear inequalities constrained optimization requires LAPACK and was not compiled!")
39#else
40#warning Linear inequalities constrained optimization requires LAPACK and was not compiled!
41#endif // _MSC_VER
42
43#else // LAPACK present
44
45#if !defined(LM_DBL_PREC) && !defined(LM_SNGL_PREC)
46#error At least one of LM_DBL_PREC, LM_SNGL_PREC should be defined!
47#endif
48
49
50#ifdef LM_SNGL_PREC
51/* single precision (float) definitions */
52#define LM_REAL float
53#define LM_PREFIX s
54
55#define LM_REAL_MAX FLT_MAX
56#define LM_REAL_MIN -FLT_MAX
57#define __SUBCNST(x) x##F
58#define LM_CNST(x) __SUBCNST(x) // force substitution
59
60#include "lmbleic_core.c" // read in core code
61
62#undef LM_REAL
63#undef LM_PREFIX
64#undef LM_REAL_MAX
65#undef LM_REAL_MIN
66#undef __SUBCNST
67#undef LM_CNST
68#endif /* LM_SNGL_PREC */
69
70#ifdef LM_DBL_PREC
71/* double precision definitions */
72#define LM_REAL double
73#define LM_PREFIX d
74
75#define LM_REAL_MAX DBL_MAX
76#define LM_REAL_MIN -DBL_MAX
77#define LM_CNST(x) (x)
78
79#include "lmbleic_core.c" // read in core code
80
81#undef LM_REAL
82#undef LM_PREFIX
83#undef LM_REAL_MAX
84#undef LM_REAL_MIN
85#undef LM_CNST
86#endif /* LM_DBL_PREC */
87
88#endif /* HAVE_LAPACK */
89
Note: See TracBrowser for help on using the repository browser.