1classdef GlobalConstants
2 % GlobalConstants System-wide constants and configuration parameters
4 % GlobalConstants provides centralized access to global constants, tolerances,
5 % and configuration parameters used throughout the LINE framework. It manages
6 % numerical tolerances, verbosity levels, version information, and other
7 % system-wide settings through
static methods and global variables.
9 % @brief Centralized global constants and configuration management
11 % Key characteristics:
12 % - Centralized constant management
13 % - Numerical tolerance configuration
14 % - System-wide parameter access
15 % - Version and build information
16 % - Debugging and verbosity controls
18 % Global constants include:
19 % - Numerical tolerances (FineTol, CoarseTol)
20 % - Special values (Zero, MaxInt, Immediate)
21 % - System configuration (Verbose, DummyMode)
22 % - Version information and build details
23 % - Output stream redirection (StdOut)
25 % GlobalConstants
is used
for:
26 % - Consistent numerical precision across LINE
27 % - Global configuration management
28 % - Debugging and verbosity control
29 % - Version compatibility checking
30 % - System-wide parameter standardization
34 %
if abs(value) < GlobalConstants.FineTol()
35 % % Handle near-zero values
37 %
if GlobalConstants.Verbose() > 1
38 % fprintf(
'Debug information\n');
42 % Copyright (c) 2012-2026, Imperial College London
43 % All rights reserved.
46 function can=DummyMode()
51 function stdo=StdOut()
56 function tol=Immediate()
71 function tol=CoarseTol()
76 function tol=FineTol()
81 function verbose=Verbose()
83 verbose = LINEVerbose;
86 function ver=Version()
91 function setChecks(val)
96 function setStdOut(val)
101 function setImmediate(val)
106 function setDummyMode(val)
111 function setMaxInt(val)
116 function setZero(val)
121 function setCoarseTol(val)
126 function setFineTol(val)
131 function setVerbose(val)
136 function verbose = getVerbose()
138 verbose = LINEVerbose;
141 function setVersion(val)
146 function
bool = isLibraryAttributionShown()
147 global LINELibraryAttributionShown
148 bool = LINELibraryAttributionShown;
151 function setLibraryAttributionShown(val)
152 global LINELibraryAttributionShown
153 LINELibraryAttributionShown = val;
156 function
bool = isToolAckShown(name)
157 % Per-tool registry of the wrapper-solver acknowledgements already
158 % printed in this session. Distinct from the single
159 % LINELibraryAttributionShown flag, which covers the native solvers
160 % collectively: each external tool must be acknowledged on its own.
161 global LINEToolAckShown
162 if ~isstruct(LINEToolAckShown)
163 LINEToolAckShown = struct();
165 bool = isfield(LINEToolAckShown, matlab.lang.makeValidName(name));
168 function setToolAckShown(name)
169 global LINEToolAckShown
170 if ~isstruct(LINEToolAckShown)
171 LINEToolAckShown = struct();
173 LINEToolAckShown.(matlab.lang.makeValidName(name)) = true;