[57c38e] | 1 | |
---|
| 2 | |
---|
[d916c6] | 3 | --- This `README' file corresponds to Singular-Factory version 3.1 --- |
---|
[57c38e] | 4 | |
---|
| 5 | |
---|
[20e558] | 6 | README file for Singular-Factory |
---|
| 7 | ================================ |
---|
[57c38e] | 8 | |
---|
[20e558] | 9 | NOTE: The copyright of Singular-Factory is described in the |
---|
[ccf43d5] | 10 | file COPYING |
---|
[e4126a] | 11 | |
---|
[57c38e] | 12 | Overview |
---|
[51268e] | 13 | ======== |
---|
[e4126a] | 14 | 1. What is Factory? |
---|
| 15 | 2. Comments, Questions, Bug Reports |
---|
| 16 | 3. Installation |
---|
| 17 | 4. Distribution |
---|
| 18 | 5. Prerequisites |
---|
| 19 | 6. Memory Manager |
---|
| 20 | 7. Stream IO |
---|
| 21 | 8. Diagnostic Messages |
---|
| 22 | 9. GF(q) Tables |
---|
| 23 | 10. A Note on Singular |
---|
| 24 | 11. Configure Options, Dependencies |
---|
| 25 | 12. Linking Factory with Your Application |
---|
| 26 | 13. Factory Template Instantiation |
---|
| 27 | 14. Documentation |
---|
| 28 | 15. Examples and Tests |
---|
| 29 | 16. Editing Factory |
---|
| 30 | 17. Files in the Distribution |
---|
[51268e] | 31 | |
---|
| 32 | |
---|
| 33 | 1. What is Factory? |
---|
| 34 | =================== |
---|
[57c38e] | 35 | Factory is a C++ class library that implements a recursive representation |
---|
[51268e] | 36 | of multivariate polynomial data. It is being developed by Ruediger Stobbe |
---|
| 37 | and Jens Schmidt at the University of Kaiserslautern as an independent and |
---|
| 38 | self-contained part of the computer algebra system Singular (developed by |
---|
| 39 | G.-M. Greuel, G. Pfister and H. Schoenemann). |
---|
[57c38e] | 40 | |
---|
| 41 | Factory handles sparse multivariate polynomials over different |
---|
| 42 | coefficient domains, such as Z, Q and GF(q), as well as algebraic |
---|
[51268e] | 43 | extensions over Q and GF(q) in an efficient way. Factory includes |
---|
| 44 | algorithms for computing univariate and multivariate gcds, resultants, |
---|
[e4126a] | 45 | chinese remainders, and several algorithms to factorize univariate |
---|
[51268e] | 46 | polynomials over the integers and over finite fields. Factorization of |
---|
| 47 | multivariate polynomials over the integers is in beta test stage. |
---|
[57c38e] | 48 | |
---|
| 49 | The interface to the polynomial system of Factory is provided by a single |
---|
[e4126a] | 50 | class `CanonicalForm' which can deal with elements of the coefficient |
---|
| 51 | domain as well as polynomials. Using operator overloading, you can handle |
---|
[57c38e] | 52 | polynomial data similarly to built-in types such as the machine integers. |
---|
[e4126a] | 53 | For example, to add two polynomials one simply uses the `+' operator. |
---|
| 54 | Because of this, Factory is easy to use even if you are not familiar with |
---|
| 55 | C++ programming. |
---|
[57c38e] | 56 | |
---|
| 57 | There are a couple of utility classes provided by Factory such as lists, |
---|
| 58 | arrays, polynomial maps, etc. These make the usage more comfortable. |
---|
| 59 | |
---|
[790737] | 60 | |
---|
[e4126a] | 61 | 2. Comments, Questions, Bug Reports |
---|
[51268e] | 62 | ==================================== |
---|
| 63 | Factory is a project in evolution. That means there is no guarantee that |
---|
| 64 | Factory is bug free. I am sure that there are bugs or at least features. |
---|
| 65 | If you find bugs or if you find a strange behavior of the library, please |
---|
[8a47d24] | 66 | let me know (e-mail: singular@mathematik.uni-kl.de>). |
---|
[51268e] | 67 | Comments and questions are welcome, too. |
---|
[e4126a] | 68 | |
---|
[790737] | 69 | Factory version 1.2c and newer define an external variable |
---|
[e4126a] | 70 | `factoryVersion' describing the version of the library. The external |
---|
| 71 | variable `factoryConfiguration' (not present in versions 1.2c and 1.3a) |
---|
| 72 | describes the options Factory has been configured with. Please include the |
---|
| 73 | version number and the configuration options in your bug reports. You may |
---|
| 74 | either use the UNIX utility `what' to get this information (`what libcf.a') |
---|
| 75 | or compile and run something similar to this: |
---|
[57c38e] | 76 | |
---|
[790737] | 77 | #include <factory.h> |
---|
[e4126a] | 78 | main() { cout << factoryVersion << "; " << factoryConfiguration << endl; } |
---|
[57c38e] | 79 | |
---|
[51268e] | 80 | 3. Installation |
---|
| 81 | =============== |
---|
| 82 | NOTE: If you have received this Factory distribution together with Singular |
---|
| 83 | you do not have to worry about compilation or installation at all. The |
---|
| 84 | installation procedure for Singular should do everything for you. For more |
---|
[e4126a] | 85 | information, see the section "A Note on Singular". |
---|
[51268e] | 86 | |
---|
[e4126a] | 87 | See the `INSTALL' file for instructions on how to install Factory. The |
---|
[b7ef56] | 88 | installation procedure on UNIX platforms conforms more or less to the GNU |
---|
| 89 | standard: |
---|
[a16c0d] | 90 | |
---|
| 91 | ./configure; make; make gftables; make install; make installgftables |
---|
[57c38e] | 92 | |
---|
[a16c0d] | 93 | However, I recommend to read the instructions since there are a lot of |
---|
| 94 | non-standard options to configure. |
---|
[57c38e] | 95 | |
---|
[b7ef56] | 96 | On platforms other than UNIX, where there is no `configure', you have to |
---|
| 97 | configure and install Factory by hand. In particular, you have to |
---|
| 98 | create/edit the files `config.h', `factory.h', `factoryconf.h', and |
---|
| 99 | `GNUmakefile'. For Microsoft Windows NT 4.0 with the Microsoft Visual C++ |
---|
| 100 | 5.0 compiler there is a preconfigured environment in the `winnt/' directory |
---|
| 101 | which you may use as an example. For more information, confer to |
---|
| 102 | corresponding section in the `INSTALL' file and to the `INSTALL.nt' file in |
---|
| 103 | the `winnt/' directory. |
---|
| 104 | |
---|
| 105 | In general, this `README' as well as the `INSTALL' file are written for |
---|
| 106 | UNIX platforms. However, you may find less specific information on the |
---|
| 107 | configuration and installation process which is useful for other platforms, |
---|
| 108 | too. |
---|
| 109 | |
---|
[a16c0d] | 110 | |
---|
[51268e] | 111 | 4. Distribution |
---|
| 112 | =============== |
---|
[e4126a] | 113 | The latest version of Factory is always available by anonymous ftp from |
---|
[57c38e] | 114 | |
---|
[858757] | 115 | www.mathematik.uni-kl.de:/pub/Math/Singular/Factory |
---|
[57c38e] | 116 | |
---|
| 117 | The Factory distribution consists of three archives: |
---|
| 118 | |
---|
[e4126a] | 119 | o the Factory source code (`factory-<version>.tgz'); |
---|
| 120 | o some preliminary documentation on Factory (`factory-doc-prelim.tgz'); |
---|
| 121 | o Factory GF(q) addition tables (`factory-gftables.tgz', see below). |
---|
[57c38e] | 122 | |
---|
| 123 | |
---|
[51268e] | 124 | 5. Prerequisites |
---|
| 125 | ================ |
---|
[a16c0d] | 126 | You need GNU make to build and install Factory. Furthermore, I strongly |
---|
| 127 | recommend to build Factory with GNU CC (version 2.7 or newer). To build |
---|
| 128 | Factory and to link your programs with Factory you need the GNU Multiple |
---|
| 129 | Precision Library (GMP, version 2.0 or newer). The GMP library is |
---|
| 130 | available at ftp.gnu.ai.mit.edu or its mirrors. Alternatively, Factory may |
---|
| 131 | be linked with the so called small GMP library which comes with the full |
---|
| 132 | version of Singular (not recommended). |
---|
[57c38e] | 133 | |
---|
[a16c0d] | 134 | Configure options: |
---|
[51268e] | 135 | ------------------ |
---|
[a16c0d] | 136 | --with-gmp(=<gmp_inc_path>(,<gmp_lib_path>)) |
---|
[e4126a] | 137 | specify where to find the GMP library. |
---|
| 138 | --enable-gmp together with `--with-Singular' means: installation |
---|
| 139 | in process, be graceful when there is no `gmp.h' |
---|
[a16c0d] | 140 | |
---|
| 141 | If <gmp_lib_path> is not given, but <gmp_inc_path> is, |
---|
[e4126a] | 142 | `<gmp_inc_path>/../lib/' is used as <gmp_lib_path>. If neither |
---|
| 143 | <gmp_lib_path> nor <gmp_inc_path> is specified, `configure' looks in the |
---|
[a16c0d] | 144 | standard system locations for GMP. |
---|
| 145 | |
---|
[e4126a] | 146 | Furthermore, you may specify the symbolic directory `$(includedir)' for |
---|
[a16c0d] | 147 | <gmp_inc_path>: |
---|
| 148 | |
---|
| 149 | --with-gmp='$(includedir)' |
---|
| 150 | |
---|
[e4126a] | 151 | Do not forget the single quotes or otherwise your shell might complain. |
---|
| 152 | |
---|
[50901d] | 153 | This is useful when Factory is delivered as part of a larger package |
---|
[a16c0d] | 154 | which also provides the GMP library. In this case, at configuration time |
---|
[e4126a] | 155 | there would not be any `gmp.h'. Without this option, Factory's `configure' |
---|
[50901d] | 156 | script would exit with an error message. If this symbolic directory is |
---|
[e4126a] | 157 | given, the `configure' script does not look for `gmp.h' and `libgmp.a'. |
---|
| 158 | Rather, it adds the option `-I$(includedir)' to its `$(CXXFLAGS)' and the |
---|
| 159 | option `-L$(libdir)' to its `$(LDFLAGS)' assuming that at compilation-time |
---|
| 160 | `gmp.h' and `libgmp.a' will reside in these directories. |
---|
| 161 | The option `--enable-gmp' does the same, but it is a special (and ugly) |
---|
| 162 | gift to Singular, so it may be used with option `--with-Singular' only. |
---|
[a16c0d] | 163 | |
---|
| 164 | |
---|
[e4126a] | 165 | 6. Memory Manager |
---|
[51268e] | 166 | ================= |
---|
| 167 | You can use one of the memory management tools provided with Factory. |
---|
[e4126a] | 168 | There are the "new" and the "old" memory manager. In fact, on some systems |
---|
| 169 | the old memory management seems to be faster then the new one, but so far |
---|
[51268e] | 170 | there have not been systematic timings. If you configure Factory with |
---|
[e4126a] | 171 | `--with-memman=no' it will use the standard C++ operators `new'/`delete', |
---|
| 172 | which is not recommended. |
---|
| 173 | You may trace the actions (allocate/free) of the new memory manager by |
---|
[51268e] | 174 | enabling memory management debugging. This produces a *lot* of output. |
---|
[a16c0d] | 175 | |
---|
| 176 | Configure options: |
---|
[51268e] | 177 | ------------------ |
---|
| 178 | --with-memman(=<memman>) specify Factory memory manager. |
---|
[e4126a] | 179 | <memman> is either `old' (default), `new', or `no'. |
---|
[51268e] | 180 | --enable-memdebug=<level> switch on memory management debugging. Meaningful |
---|
[e4126a] | 181 | with `--with-memman=new' only. <level> may be either |
---|
| 182 | `no' (default), `normal', or `full'. |
---|
[a16c0d] | 183 | |
---|
| 184 | |
---|
[51268e] | 185 | 7. Stream IO |
---|
| 186 | ============ |
---|
| 187 | For use with other systems which have their own IO routines to print |
---|
[50901d] | 188 | polynomials it is possible to switch off Factory's stream IO. In this |
---|
| 189 | case, you do not need to link libg++ or libiostream with Factory. |
---|
[a16c0d] | 190 | |
---|
| 191 | Configure options: |
---|
[51268e] | 192 | ------------------ |
---|
| 193 | --disable-streamio build Factory without stream IO |
---|
[a16c0d] | 194 | |
---|
| 195 | |
---|
[e4126a] | 196 | 8. Diagnostic Messages |
---|
[51268e] | 197 | ====================== |
---|
[a16c0d] | 198 | Factory has three types of diagnostic messages: |
---|
[650f2d8] | 199 | o Assertions (implemented by the "ASSERT macros" in `cf_assert.h') are used to |
---|
[51268e] | 200 | ensure preconditions before running some algorithm. A typical example is |
---|
[a16c0d] | 201 | to test f != 0 before dividing by f. |
---|
[e4126a] | 202 | o Debug output (implemented by the "DEBOUT macros" in `debug.h'/`debug.cc') |
---|
| 203 | is used to trace complex algorithms, e.g. factorization. |
---|
| 204 | o Timing information may be accumulated and printed using the "TIMING macros" |
---|
| 205 | in `timing.h'. |
---|
[a16c0d] | 206 | |
---|
| 207 | Since all diagnostic messages are implemented using preprocessor macros, |
---|
[50901d] | 208 | they will completely cease when disabled, thus avoiding any impact on |
---|
[e4126a] | 209 | speed. For more information, see section "Configuring and building Factory |
---|
| 210 | for different configurations" in the `INSTALL' file. By default, all |
---|
[50901d] | 211 | diagnostic messages are disabled. |
---|
[a16c0d] | 212 | |
---|
| 213 | Configure options: |
---|
[51268e] | 214 | ------------------ |
---|
| 215 | --enable-assertions build Factory with assertions activated |
---|
| 216 | --enable-timing build Factory so it will print timing information |
---|
| 217 | --enable-debugoutput build Factory so it will print debugging information |
---|
[a16c0d] | 218 | |
---|
| 219 | |
---|
[e4126a] | 220 | 9. GF(q) Tables |
---|
[51268e] | 221 | =============== |
---|
[a16c0d] | 222 | |
---|
| 223 | NOTE: Since the format of the GF(q) tables changed from Factory Version |
---|
| 224 | 1.2b to Factory Version 1.3a you should get/create them by new! |
---|
| 225 | |
---|
[e4126a] | 226 | Factory uses addition tables to calculate in GF(p^n) in an efficient way. |
---|
| 227 | |
---|
[57c38e] | 228 | There are two possibilities to get these tables: |
---|
[e4126a] | 229 | o get them from the net (`factory-gftables.tgz') where you got Factory |
---|
| 230 | from. The files unpack into a directory `gftables/'. |
---|
| 231 | o create them with `gengftables' which is a part of Factory. Building |
---|
[57c38e] | 232 | the tables takes quite a while! |
---|
[e4126a] | 233 | See the `INSTALL' file for more information. |
---|
[57c38e] | 234 | |
---|
| 235 | |
---|
[e4126a] | 236 | 10. A Note on Singular |
---|
[51268e] | 237 | ===================== |
---|
[57c38e] | 238 | If you have received this Factory distribution together with Singular you |
---|
| 239 | do not have to worry about compilation or installation at all. The |
---|
| 240 | installation procedure for Singular should do everything for you. If you |
---|
| 241 | want to configure/build the package on your own instead of letting |
---|
[e4126a] | 242 | Singular's `configure' do the work you should: |
---|
[57c38e] | 243 | |
---|
[a16c0d] | 244 | ./configure --with-Singular --enable-gmp |
---|
[57c38e] | 245 | (or, equivalently: ) |
---|
[a16c0d] | 246 | ./configure --with-Singular --with-gmp='${includedir}' |
---|
[57c38e] | 247 | |
---|
[e4126a] | 248 | Furthermore, you should specify `--prefix' so `make install' will install |
---|
[57c38e] | 249 | the files in the places where Singular looks for them. By default, this is |
---|
| 250 | the top directory of the Singular distribution. In this case you have to |
---|
[e4126a] | 251 | specify `--prefix=..'. |
---|
[57c38e] | 252 | |
---|
[a16c0d] | 253 | The Singular GF(q) tables are the same as the Factory GF(q) tables. |
---|
| 254 | However, Singular uses a different naming scheme. Therefore, a Factory |
---|
[e4126a] | 255 | configured with `--without-Singular' will not find Singular's GF(q) tables |
---|
| 256 | as well as a Factory configured with `--with-Singular' will not find the |
---|
[51268e] | 257 | GF(q) tables created by gengftables. But this is not a major drawback |
---|
| 258 | since Singular is distributed with ready-to-use GF(q) tables. |
---|
| 259 | |
---|
[e4126a] | 260 | The latest version of Singular is always available at |
---|
[51268e] | 261 | www.mathematik.uni-kl.de:/pub/Math/Singular. |
---|
[a16c0d] | 262 | |
---|
| 263 | Configure options: |
---|
[51268e] | 264 | ------------------ |
---|
[a16c0d] | 265 | --with-Singular build for use with computer algebra system Singular. |
---|
| 266 | |
---|
[e4126a] | 267 | Except from setting the `#define SINGULAR', this option only changes the |
---|
| 268 | defaults to: `--with-memman=no --disable-streamio'. |
---|
[a16c0d] | 269 | |
---|
| 270 | |
---|
[e4126a] | 271 | 11. Configure Options, Dependencies |
---|
[51268e] | 272 | =================================== |
---|
[e4126a] | 273 | o do not configure `--with-Singular --with-memman'. In this case |
---|
[51268e] | 274 | both Singular and the library will try to initialize their own memory |
---|
| 275 | management. |
---|
[a16c0d] | 276 | |
---|
[e4126a] | 277 | o do not configure `--disable-streamio --enable-debugoutput'. The |
---|
| 278 | "DEBOUT macros" need stream IO. |
---|
[a16c0d] | 279 | |
---|
[e4126a] | 280 | o you may configure `--with-Singular --enable-streamio', but this |
---|
[a16c0d] | 281 | is not supported by Singular. You will have to change manually |
---|
[e4126a] | 282 | Singular's `Makefile'. The same is true for `--with-Singular |
---|
[50901d] | 283 | --enable-streamio --enable-debugoutput'. |
---|
[a16c0d] | 284 | |
---|
[e4126a] | 285 | o you may configure `--with-Singular --enable-timing', but this |
---|
[a16c0d] | 286 | will not have any visible effect (except from a slightly slower |
---|
| 287 | running time) because Singular will not print the timing |
---|
| 288 | results. |
---|
| 289 | |
---|
[e4126a] | 290 | o `--enable-gmp' has an effect only together with `--with-Singular' |
---|
| 291 | |
---|
| 292 | o `--with-memdebug' has an effect only together with |
---|
| 293 | `--with-memman=new' |
---|
| 294 | |
---|
| 295 | |
---|
| 296 | 12. Linking Factory With Your Application |
---|
| 297 | ========================================= |
---|
| 298 | To translate your application you need (apart from your |
---|
| 299 | application, of course): |
---|
| 300 | |
---|
| 301 | o the Factory user interface header file (`factory.h') |
---|
| 302 | |
---|
| 303 | To link your application with Factory you need: |
---|
| 304 | |
---|
| 305 | o the Factory library (`libcf.a') |
---|
| 306 | o unless you configured Factory `--without-memman' you need one of the |
---|
| 307 | Factory memory manager libraries (`libcfmem.a') |
---|
| 308 | |
---|
| 309 | o the instantiated Factory templates (`ftmpl_inst.o'). |
---|
| 310 | |
---|
| 311 | o unless you configured Factory `--without-streamio' you need the stream IO |
---|
| 312 | libraries. With GNU CC, you do not need to care about this because they |
---|
| 313 | are linked automatically to your application if you call the compiler |
---|
| 314 | either as `g++' or as `c++'. Otherwise, you need to link with library |
---|
| 315 | `libiostream.a'. |
---|
| 316 | o The GNU Multiple Precision Library (`libgmp.a'). See section |
---|
| 317 | "Prerequisites" in this file for more information. |
---|
| 318 | o The standard mathematical library (`libm.a') |
---|
| 319 | |
---|
| 320 | `factory.h', `libcf.a', and `libcfmem.a' are created when you build |
---|
| 321 | Factory and installed by `make install'. `libiostream.a', `libgmp.a', and |
---|
| 322 | `libm.a' should be already installed on your system, otherwise your |
---|
| 323 | application will fail to link. `ftmpl_inst.o' is not installed by Factory. |
---|
| 324 | Instead, its source file `ftmpl_inst.cc' is installed and you have to build |
---|
| 325 | `ftmpl_inst.o' when you are building your application. For more |
---|
| 326 | information on template instantiation and `ftmpl_inst.cc', see the |
---|
| 327 | following section "Factory Template Instantiation". |
---|
| 328 | |
---|
| 329 | To give an example, look at the following one-shot solution to the |
---|
| 330 | problem "linking Factory with your application" where the "application" is |
---|
[b7ef56] | 331 | a small test program (`application.cc') from the subdirectory `examples/' |
---|
[e4126a] | 332 | of the Factory source directory ('\' at the end of a line denotes line |
---|
| 333 | continuation): |
---|
| 334 | |
---|
| 335 | g++ -c /usr/local/include/templates/ftmpl_inst.cc \ |
---|
| 336 | -fno-implicit-templates -O2 -fomit-frame-pointer -o ftmpl_inst.o |
---|
| 337 | g++ -c application.cc -fno-implicit-templates -O2 -fomit-frame-pointer \ |
---|
| 338 | ftmpl_inst.o -lcf -lcfmem -lm -lgmp |
---|
| 339 | |
---|
| 340 | This should work fine provided that you installed Factory in a location |
---|
| 341 | where `g++' may find it (here I have assumed `/usr/local/') and all the |
---|
| 342 | other files mentioned above are installed properly and where `g++' looks |
---|
| 343 | for them. |
---|
| 344 | |
---|
| 345 | You may find a small `GNUmakefile' which translates `application.cc' and |
---|
| 346 | other examples in the `examples/' subdirectory of the Factory source |
---|
| 347 | directory. For more information, see the section "Examples and Tests". |
---|
| 348 | |
---|
| 349 | |
---|
| 350 | 13. Factory Template Instantiation |
---|
| 351 | ================================== |
---|
| 352 | There are a couple of classes provided by Factory such as lists, arrays, |
---|
| 353 | etc, which may be used to derive new abstract data types from already |
---|
| 354 | existing ones. Factory uses them itself, e.g. to return the result of a |
---|
| 355 | factorization (a list of factors), and you may use them to create new |
---|
| 356 | derived abstract data types. These classes are realized using C++ |
---|
| 357 | "templates", which you need to "instantiate" befor you use them (refer to |
---|
| 358 | some introduction to C++ if you do not know these terms). |
---|
| 359 | |
---|
| 360 | With GNU CC the most reliable way to instantiate templates is to |
---|
| 361 | |
---|
| 362 | o explicitely instantiate all necessary templates, and compile with option |
---|
| 363 | `-fno-implicit-templates' and to |
---|
| 364 | o collect all explicit template instantiations in one single file. |
---|
| 365 | |
---|
| 366 | This approach is the one Factory uses. All object files of the library |
---|
| 367 | are generated with option `--fno-implicit-templates' and the explicit |
---|
| 368 | template instantiations are collected in `ftmpl_inst.cc'. You could |
---|
| 369 | translate this file using the `make' target `ftmpl_inst.o' (see section |
---|
| 370 | "Building Factory" in the `INSTALL' file). |
---|
| 371 | |
---|
| 372 | The consequence of this approach: since you may want to add template |
---|
| 373 | instantiations of Factory's or your own templates after the installation of |
---|
| 374 | Factory, it is necessary to install `ftmpl_inst.cc' as well as the template |
---|
| 375 | source files together with the library. They are automatically installed |
---|
| 376 | in `$(includedir)/templates/' when you type `make install'. |
---|
| 377 | |
---|
| 378 | To join your own template instantiations with the ones from |
---|
| 379 | `ftmpl_inst.cc' there are several possibilities: |
---|
| 380 | |
---|
| 381 | o you copy `ftmpl_inst.cc' file from the directory where it was installed |
---|
| 382 | into your working directory and add your template instantiations after |
---|
| 383 | the corresponig comment at the end of the file; |
---|
| 384 | o you cut the template instantiations from `ftmpl_inst.cc' and paste |
---|
| 385 | them into your own template instantiation file. |
---|
| 386 | |
---|
| 387 | Both methods suffer from one disadvantage: each time `ftmpl_inst.cc' |
---|
| 388 | changes in a new version of Factory you will have to redo these steps. The |
---|
| 389 | best method therefore is maybe this one: |
---|
| 390 | |
---|
| 391 | o you write your own template instantiation file with a |
---|
| 392 | `#include <templates/ftmpl_inst.cc>' statement at the beginning of it. |
---|
[a16c0d] | 393 | |
---|
[e4126a] | 394 | |
---|
| 395 | 14. Documentation |
---|
[51268e] | 396 | ================= |
---|
[a16c0d] | 397 | So far there are only preliminary versions of a user/reference manual and |
---|
[e4126a] | 398 | a tutorial ("A quick start into Factory"). Please do not expect them to |
---|
| 399 | be error-free or even complete. For this reason, the documentation is not |
---|
| 400 | included in the source code archive (`factory-<version>.tgz'). Instead, the |
---|
| 401 | sources and compiled DVI files reside in `factory-doc-prelim.tgz'. They will |
---|
| 402 | unpack into a directory `factory-doc-prelim/'. |
---|
[a16c0d] | 403 | |
---|
| 404 | |
---|
[e4126a] | 405 | 15. Examples and Tests |
---|
[51268e] | 406 | ====================== |
---|
[e4126a] | 407 | The directory `examples/' in the Factory source directory contains some |
---|
| 408 | example applications for Factory and a `GNUmakefile' to build them. The |
---|
| 409 | main purpose of the examples is to show how to link applications with an |
---|
| 410 | installed version of Factory. This means that you have to install Factory |
---|
| 411 | before you can build the examples (but it is not necessary to install the |
---|
| 412 | GF(q) tables). For the same reason, the `GNUmakefile' is not configured |
---|
| 413 | automatically by `configure'. You will have to change some of the |
---|
| 414 | variables manually. |
---|
| 415 | |
---|
| 416 | Furthermore, you may have a look at `gengftables.cc' in the Factory |
---|
| 417 | source directory which is another application of the most basic Factory |
---|
| 418 | features. |
---|
[a16c0d] | 419 | |
---|
[e4126a] | 420 | To test whether Factory (including GF(q) tables) has been installed |
---|
| 421 | properly, use `make' target `installtest'. |
---|
[e41784] | 422 | |
---|
[e4126a] | 423 | |
---|
| 424 | 16. Editing Factory |
---|
[e41784] | 425 | =================== |
---|
[e4126a] | 426 | Parts of Factory are written using GNU Emacs' `folding-mode'. You may |
---|
| 427 | load this mode from Emacs with |
---|
| 428 | |
---|
| 429 | M-x load-file RET factory-<version>/bin/folding.el RET |
---|
| 430 | |
---|
| 431 | To switch it on, say `M-x folding-mode RET'. Alternatively, you may load |
---|
| 432 | `factory-<version>/bin/fold-docu.el' which contains some additional functions |
---|
[33592c8] | 433 | to fold only the documentation. If you add the following lines to your |
---|
[e4126a] | 434 | `.emacs' file, all this would be done automatically for you: |
---|
[33592c8] | 435 | |
---|
[790737] | 436 | (load-file "factory-<version>/bin/folding.el") |
---|
| 437 | (load-file "factory-<version>/bin/fold-docu.el") |
---|
[33592c8] | 438 | (add-hook 'c-mode-common-hook 'folding-mode) |
---|
| 439 | (setq fold-fold-on-startup nil |
---|
| 440 | fold-mode-marks-alist '((c++-mode "//{{{" "//}}}"))) |
---|
| 441 | (set-default 'fold-internal-margins nil) |
---|
| 442 | |
---|
| 443 | For more information, see the respective files. |
---|
[e41784] | 444 | |
---|
[a16c0d] | 445 | |
---|
[e4126a] | 446 | 17. Files in the Distribution |
---|
[51268e] | 447 | ============================= |
---|
[57c38e] | 448 | ChangeLog - history of changes |
---|
| 449 | INSTALL - installation instructions |
---|
| 450 | NEWS - new Factory features |
---|
[e4126a] | 451 | README - this file |
---|
[57c38e] | 452 | |
---|
[e4126a] | 453 | bin/install-sh - a script version of the BSD `install' program |
---|
| 454 | bin/makeheader - creates headers from header templates (`*.template') |
---|
| 455 | bin/mkinstalldirs - recursive `mkdir' |
---|
| 456 | bin/folding.el - Emacs `folding-mode' |
---|
[e41784] | 457 | bin/fold-docu.el - some extensions to it |
---|
[57c38e] | 458 | |
---|
| 459 | GNUmakefile.in - master makefile and |
---|
[e4126a] | 460 | config.h.in - configuration include file. Run `configure' to create |
---|
| 461 | `GNUmakefile' and `config.h', resp. |
---|
[57c38e] | 462 | configure |
---|
[e4126a] | 463 | configure.in - `configure' script generated with Autoconf 2.10 |
---|
| 464 | from `configure.in' |
---|
[57c38e] | 465 | |
---|
| 466 | factory.template |
---|
| 467 | factoryconf.template - header templates for the user interface header |
---|
[e4126a] | 468 | files. Run `makeheader' to create `factory.h' and |
---|
| 469 | `factoryconf.h', resp. |
---|
[57c38e] | 470 | |
---|
| 471 | ffops.cc |
---|
| 472 | ffops.h |
---|
| 473 | gf_tabutil.cc |
---|
| 474 | gf_tabutil.h |
---|
| 475 | gfops.cc |
---|
| 476 | gfops.h |
---|
| 477 | imm.h |
---|
| 478 | int_*.cc |
---|
| 479 | int_*.h - low level classes and functions |
---|
| 480 | |
---|
| 481 | canonicalform.cc |
---|
| 482 | canonicalform.h |
---|
| 483 | cf_*.cc |
---|
| 484 | cf_*.h |
---|
| 485 | variable.cc |
---|
| 486 | variable.h - high level classes and functions. User interface to |
---|
| 487 | the polynomial (and other) arithmetic. |
---|
| 488 | |
---|
[51268e] | 489 | templates/ - Factory templates |
---|
| 490 | ftmpl_inst.cc - template instantiation for Factory templates |
---|
[57c38e] | 491 | |
---|
| 492 | fac_*.cc |
---|
| 493 | fac_*.h - high level algorithms (factorization, gcd, sqfr |
---|
| 494 | computation, etc.) |
---|
| 495 | sm_*.c |
---|
| 496 | sm_*.h - sparse modular gcd. Contributed by Marion Bruder |
---|
| 497 | <bruder@math.uni-sb.de> |
---|
| 498 | |
---|
| 499 | parseutil.cc |
---|
| 500 | parseutil.h |
---|
| 501 | readcf.cc |
---|
[e4126a] | 502 | readcf.y - Factory parser to read canonical forms. `readcf.cc' |
---|
| 503 | translated with Bison 1.18 from `readcf.y'. |
---|
[57c38e] | 504 | |
---|
| 505 | gmpext.h |
---|
| 506 | initgmp.cc - Factories interface to GNU MP |
---|
| 507 | singext.cc |
---|
| 508 | singext.h - Factories interface to Singular |
---|
| 509 | |
---|
[8a47d24] | 510 | NTLconvert.* - some conversion routines for using NTL |
---|
| 511 | |
---|
[57c38e] | 512 | memutil.c |
---|
[e4126a] | 513 | memutil.h - "old" Factory memory manager |
---|
[57c38e] | 514 | memman.h |
---|
| 515 | mm*.c |
---|
[e4126a] | 516 | mm*.h - "new" Factory memory manager |
---|
[57c38e] | 517 | newdelete.cc - C++ interface to the memory managers |
---|
| 518 | |
---|
[650f2d8] | 519 | cf_assert.h - the "ASSERT macros" |
---|
[57c38e] | 520 | debug.h |
---|
[e4126a] | 521 | debug.cc - the "DEBOUT macros" |
---|
| 522 | timing.h - the "TIMING macros" |
---|
[57c38e] | 523 | |
---|
[e4126a] | 524 | examples/ - some example applications for Factory and a `GNUmakefile' |
---|
| 525 | to build them |
---|
| 526 | gengftables.cc - run `gengftables' to create the GF(q) addition tables |
---|
[57c38e] | 527 | necessary to work with Factory |
---|
[e4126a] | 528 | test_install.cc - a small program to test whether installation has |
---|
| 529 | been successful. Built and called by `make' target |
---|
| 530 | `installtest' |
---|