2 4ti2 -- A software package for algebraic, geometric and combinatorial
3 problems on linear spaces.
5 Copyright (C) 2006 4ti2 team.
6 Main author(s): Matthias Walter.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
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.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 #include "vectorarray.h"
27 #include "linearsystem.h"
30 /*** solve-internal data ***/
32 typedef struct zsolvecontext_t
66 void (*LogCallback
)(FILE *, int level
, int type
, int var
, int sum
, int norm
, int vectors
, CPUTime alltime
, CPUTime steptime
);
67 void (*BackupCallback
)(struct zsolvecontext_t
*);
69 typedef zsolvecontext_t
*ZSolveContext
;
74 #define ZSOLVE_LOG_STARTED 0
75 #define ZSOLVE_LOG_RESUMED 1
76 #define ZSOLVE_LOG_VARIABLE_STARTED 2
77 #define ZSOLVE_LOG_VARIABLE_FINISHED 3
78 #define ZSOLVE_LOG_SUM_STARTED 4
79 #define ZSOLVE_LOG_SUM_FINISHED 5
80 #define ZSOLVE_LOG_NORM_STARTED 6
81 #define ZSOLVE_LOG_NORM_FINISHED 7
82 #define ZSOLVE_LOG_FINISHED 8
84 typedef void (*ZSolveLogCallback
)(FILE *, int level
, int type
, int var
, int sum
, int norm
, int vectors
, CPUTime alltime
, CPUTime steptime
);
85 /* (stream, loglevel, log_type, current variable, current sum, current norm, number of vectors, cumulative time, time of logged step) */
87 void zsolveLogCallbackDefault(FILE *, int, int, int, int, int, int, CPUTime
, CPUTime
);
88 /* (stream, loglevel, log_type, current variable, current sum, current norm, number of vectors, cumulative time, time of logged step) */
92 typedef void (*ZSolveBackupCallback
)(ZSolveContext
);
93 /* (pass context to backupZSolveContext after initializing the file) */
95 void backupZSolveContext(FILE *, ZSolveContext
);
96 /* (backupfile, current context) */
99 ZSolveContext
createZSolveContextFromSystem(LinearSystem
, FILE *, int, int, ZSolveLogCallback
, ZSolveBackupCallback
);
100 /* (system to solve, logfile, loglevel = 0..3, verbosity = 0..3, custom log callback or zsolveLogCallbackDefault, backup callback) */
102 ZSolveContext
createZSolveContextFromLattice(VectorArray
, FILE *, int, int, ZSolveLogCallback
, ZSolveBackupCallback
);
103 /* (lattice, logfile, loglevel = 0..3, verbosity = 0..3, custom log callback or zsolveLogCallbackDefault, backup callback) */
105 ZSolveContext
createZSolveContextFromBackup(FILE *, ZSolveLogCallback
, ZSolveBackupCallback
);
106 /* (open backup file, custom log callback or zsolveLogCallbackDefault, backup callback) */
108 void zsolveSystem(ZSolveContext
, bool);
109 /* (context created by createZSolveContext or resumeZSolveContext, append negatives? should be true for system/lattice, false for resume) */
111 void deleteZSolveContext(ZSolveContext
, bool);
112 /* (context, delete Hom and Inhom?) */