http://apcocoa.uni-passau.de/wiki/api.php?action=feedcontributions&user=Bigatti&feedformat=atomCoCoAWiki - User contributions [en]2020-06-04T20:11:15ZUser contributionsMediaWiki 1.34.0http://apcocoa.uni-passau.de/wiki/index.php?title=CoCoALib:KnownIssues&diff=4165CoCoALib:KnownIssues2007-03-14T11:42:03Z<p>Bigatti: </p>
<hr />
<div>== CoCoALib 0.98.0 release ==<br />
<br />
* compile failure with '''gcc 3.3.1 on SuSE 9.0''': The compilation of CoCoALib fail due to issues in the header containing SmartPtr. This cannot be fixed by us in a reasonable amount of time, so please update your compiler. Updating to another 3.3.x release does not fix the problem since the same headers are picked up again. 3.4.x as well as 4.0.x and 4.1.x work fine even on that rather old distribution.<br />
* link failure with '''Intel C++ on Linux''': Files in TmpFactorDir is compiled as C code due to having lower case .c extensions. This leads to a link failure in test-factor.C. The solutions is to rename the file extension from lower case c to an upper case C. This will hopefully be fixed in a future release. FIXME: add script to do this.<br />
* crashes in InterreduceGB or F5: This has only been observed with '''MSVC''' 2005 and MSVC 2005 SP1. Both are bugs in the CoCoALib 0.98.0 release, a patch can be found [http://fsmath.mathematik.uni-dortmund.de/~mabshoff/patches/0.98.00-fix-iterator-and-delete-version.patch here]. It applies cleanly against 0.98.0.<br />
<br />
== earlier releases ==<br />
<br />
Please update to 0.98.0 because it fixes a number of issues. If you have problems porting your code please contact us in the forum.</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoALib:Examples&diff=4159CoCoALib:Examples2007-02-28T15:30:12Z<p>Bigatti: </p>
<hr />
<div>This page contains the file "LongIndex.txt" in the directory "CoCoALib/examples/".<br />
<br />
This is created by "make examples" in "CoCoALib/".<br />
<br />
<br />
DO NOT EDIT UNDER THIS LINE (automatically generated).<br />
Send edits and comments to Anna Bigatti.<br />
<br />
----<br />
<br />
==[ ex-empty.C ]==<br />
This is a template file for example programs. <br />
The program itself does nothing whatsoever. <br />
<br />
=== long description ===<br />
Make a copy "foo.C" of this file and put your code in "program" <br />
Compile it in the examples directory like this: <br />
make foo <br />
<br />
<br />
==[ ex-BuildInfo.C ]==<br />
This is a very short example showing what you can do with BuildInfo. <br />
<br />
=== long description ===<br />
BuildInfo::PrintAll gives important information in the (enormously <br />
unlikely :-) event that you need to report a bug in CoCoALib. <br />
<br />
<br />
==[ ex-ZZ1.C ]==<br />
Program to calculate the modular inverse of a number. <br />
You must give as input the modulus and the residue; <br />
the residue need not be reduced. <br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
Contrast this example with ex-RingZ1. <br />
<br />
<br />
==[ ex-ZZ-prime1.C ]==<br />
Program to find a 'big' prime number, suitable for use in <br />
cryptographic applications (with some more primality testing).<br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
It shows use of some more advanced functions for ZZ values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
<br />
<br />
==[ ex-ring1.C ]==<br />
This example program shows how to create various types of ring, and <br />
several operations one can perform on rings (e.g. querying their <br />
properties).<br />
<br />
=== long description ===<br />
It creates several different sorts of ring, <br />
and then calls PrintRingInfo on each one. <br />
Note the considerable overhead needed to create a (non-standard) PolyRing:<br />
first you must make a PPOrdering, <br />
then you must make a PPMonoid from that ordering, <br />
and finally you can make a PolyRing. <br />
The tedious part is specifying the names of the indeterminates. <br />
We hope to make this less cumbersome soon. <br />
<br />
<br />
==[ ex-RingZ1.C ]==<br />
This is a basic example about the creation and use of the ring of integers.<br />
It illustrates the CoCoALib "philosophy" of first creating a ring, and <br />
then computing with values in that ring. <br />
The C++ commands for performing arithmetic on RingElems have a natural <br />
syntax (except we cannot use ^ for powers). <br />
It warns about "mixed ring arithmetic", which is forbidden in CoCoALib. <br />
<br />
=== long description ===<br />
To calculate with elements of a ring we must first create the <br />
the ring, then we can create C++ objects of type RingElem which <br />
belong to the ring -- a RingElem can change its value but not <br />
the ring to which it belongs. <br />
<br />
<br />
==[ ex-RingQ1.C ]==<br />
Some simple computations with rational numbers. <br />
This example illustrates how to create the field of rational numbers. <br />
It shows that we can compute 7/2 in Q but not in Z. <br />
It shows how to map an integer into a rational number. <br />
<br />
=== long description ===<br />
Familiarize yourself with the example ex-RingZ1.C before proceeding. <br />
As C++ does not natively have any rings, we must construct them from <br />
scratch. <br />
<br />
<br />
==[ ex-RingFloat1.C ]==<br />
Example showing some features of RingFloat.<br />
Program to explore the precision offered by RingFloat<br />
<br />
==[ ex-RingFloat2.C ]==<br />
Program exhibiting a way of using ever higher precisions...<br />
This example shows how failure can be a success: this computation<br />
is proven to give a wrong result for any given precision!<br />
=== long description ===<br />
Example showing iterative increase of precision using RingFloat until <br />
the answer is found (or an arbitrary limit on precision is reached). <br />
This program will always fail to find the limit: J-M Muller's sequence <br />
actually converges to 6 (rather slowly), however it is pathological <br />
because it converges to 100 using any finite precision arithmetic. <br />
RingFloat detects the onset of pathological convergence to 100, and <br />
throws an InsufficientPrecision exception. <br />
<br />
<br />
==[ ex-RingFloat3.C ]==<br />
Program showing how some RingFloat values can have more precision <br />
than that requested. <br />
<br />
=== long description ===<br />
Example showing that certain RingFloat values may have a precision <br />
higher than that requested. In this case we request 64 bits (i.e. <br />
about 19 decimal digits), but are able to remove the nine most <br />
significant digits and still have a result with the requested precision.<br />
So the original value of the variable third did in fact have at <br />
least 93 bits correct (i.e. about 28 decimal digits). <br />
<br />
<br />
==[ ex-RingFp1.C ]==<br />
Inefficient program to compute sqrt(2) modulo a given number. <br />
Simple example using finite fields or integers modulo N.<br />
<br />
=== long description ===<br />
The program asks the user for the value of N, it creates the <br />
ring of integers mod N, and finally uses "brute force" to find <br />
all square-roots of 2 modulo N. <br />
<br />
<br />
==[ ex-RingFp2.C ]==<br />
Example program showing how to create small prime finite fields <br />
implemented in a specific manner -- normally it is best to let <br />
the function NewZmod choose automatically the best implementation. <br />
<br />
=== long description ===<br />
The program asks the user for the characteristic N, and then tries <br />
different ways of making Z mod N.<br />
<br />
<br />
==[ ex-PPMonoidElem1.C ]==<br />
Example of use of power products and PPMonoids. <br />
Program exhibiting most functions on power products.<br />
<br />
==[ ex-RingElem1.C ]==<br />
Example showing operations on RingElem for a ring or a PolyRing.<br />
<br />
=== long description ===<br />
This is a long list of function calls from different rings. <br />
<br />
<br />
==[ ex-RingHom1.C ]==<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. <br />
<br />
=== long description ===<br />
We compute these polynomials (with parameters) in some rings: <br />
f = (2*a/3-1)*x[0] + 1/a; g = x[0]-a; <br />
<br />
<br />
==[ ex-RingHom2.C ]==<br />
Operations between elements of different rings are not allowed <br />
but we can use homomorphisms to map the elements into the <br />
same ring. <br />
<br />
=== long description ===<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. In particular, it gives a simple <br />
example of mixed ring arithmetic: the user must map all values <br />
into a single ring before combining them arithmetically. <br />
<br />
<br />
==[ ex-RingHom3.C ]==<br />
This program shows how we can use ring homomorphism <br />
to perform a change of coordinates in a polynomial ring. <br />
<br />
==[ ex-RingHom4.C ]==<br />
This program shows how we can use ring homomorphism <br />
to evaluate polynomials. <br />
<br />
==[ ex-matrix1.C ]==<br />
Example program illustrating the creation of matrices, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the matrix code is still rather young. <br />
<br />
<br />
==[ ex-module1.C ]==<br />
Example program illustrating the creation of free modules, and <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the module code is still rather young. <br />
<br />
<br />
==[ ex-PolyInput1.C ]==<br />
This program shows a way to read a polynomial from the input.<br />
<br />
==[ ex-OrderingGrading1.C ]==<br />
Predefined and user-defined orderings and gradings <br />
on PPMonoid and PolyRing. <br />
<br />
=== long description ===<br />
Each ordering is degree-compatible with grading over Z^GradingDim <br />
i.e. the grading is given by the first GradingDim rows <br />
of the ordering matrix. <br />
<br />
<br />
==[ ex-GMPAllocator.C ]==<br />
Program to find lengths of 3n+1 sequences. (uses CoCoA::GMPAllocator) <br />
<br />
=== long description ===<br />
This example shows how a CoCoA::GMPAllocator can be used. If you do <br />
computations involving many small big-integers (up to about 40 decimal <br />
digits) then the custom allocator may give slightly better run-time <br />
performance -- you must compile with debugging turned off! <br />
The crucial command is the very first line of "program" just comment it <br />
out and recompile to use the default system allocator for GMP values. <br />
<br />
<br />
==[ ex-PolyIterator1.C ]==<br />
Program showing how to iterate through "sparse" polynomials.<br />
<br />
==[ ex-PolyIterator2.C ]==<br />
Program showing how to homogenize a sparse polynomial using iterators.<br />
<br />
=== long description ===<br />
This is just an example! If you want to homogenize polynomials <br />
you should use the library function "homog". <br />
<br />
<br />
==[ ex-NF.C ]==<br />
Example program illustrating an implementation of Normal Remainder <br />
wrt a list of polynomials. <br />
If the list is a Groebner Basis, NR returns the Normal Form. <br />
<br />
=== long description ===<br />
This is just an example! If you want to compute Normal Forms <br />
you should use the library function "NF". <br />
<br />
<br />
==[ ex-PolyRing1.C ]==<br />
Example of how to create some simple polynomial rings, and use of some <br />
of the operations specific to elements of PolyRings.<br />
<br />
==[ ex-ApproxPts1.C ]==<br />
A short example showing how to use the ApproxPt preprocessing algorithms.<br />
See the file ex-ApproxPt1.in for a sample input.<br />
<br />
==[ ex-AlexanderDual.C ]==<br />
Program showing how to compute the Alexander Dual of a mon'l sqfr ideal.<br />
<br />
=== long description ===<br />
It offers the function "PrimaryDecomposition" for a mon'l sqfr ideal<br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-QuotientBasis.C ]==<br />
Program showing how to compute a quotient basis of a 0-dimensional ideal.<br />
<br />
=== long description ===<br />
It offers the function "QuotientBasisRec" <br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-hilbert1.C ]==<br />
This example is just for testing the Hilbert code. <br />
It might disappear as soon as HilbertSeries is included in CoCoALib. <br />
<br />
=== long description ===<br />
This code also shows how to create the "chess examples". <br />
<br />
<br />
==[ ex-RingWeyl1.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
All these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl2.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl3.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl4.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl5.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-FGLM.C ]==<br />
Example of how to use the implementation of the <br />
FGLM algorithm to do Groebner Basis conversion. <br />
<br />
==[ ex-OrderIdeal.C ]==<br />
Example of how to use the [OrderIdeal] CoCoALib class.<br />
<br />
==[ ex-BorderBasis.C ]==<br />
Example of how to use the implementation of the <br />
Border Basis Algorithm to compute a O_\\sigma{Id(gens)}-border basis.<br />
<br />
<br />
<br />
----<br />
<br />
<br />
[[Category:CoCoALib]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoALib:Examples&diff=4154CoCoALib:Examples2007-02-12T19:29:07Z<p>Bigatti: </p>
<hr />
<div>This page contains the file "LongIndex.txt" in the directory "CoCoALib/examples/".<br />
<br />
This is created by "make examples" in "CoCoALib/".<br />
<br />
<br />
DO NOT EDIT UNDER THIS LINE (automatically generated).<br />
Send edits and comments to Anna Bigatti.<br />
<br />
----<br />
<br />
<br />
==[ ex-empty.C ]==<br />
This is a template file for example programs. <br />
The program itself does nothing whatsoever. <br />
<br />
=== long description ===<br />
Make a copy "foo.C" of this file and put your code in "program" <br />
Compile it in the examples directory like this: <br />
"make foo" <br />
<br />
<br />
==[ ex-BuildInfo.C ]==<br />
This is a very short example showing what you can do with BuildInfo. <br />
<br />
=== long description ===<br />
BuildInfo::PrintAll gives important information in the (enormously <br />
unlikely :-) event that you need to report a bug in CoCoALib. <br />
<br />
<br />
==[ ex-ZZ1.C ]==<br />
Program to calculate the modular inverse of a number. <br />
You must give as input the modulus and the residue; <br />
the residue need not be reduced. <br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
Contrast this example with ex-RingZ1. <br />
<br />
<br />
==[ ex-ZZ-prime1.C ]==<br />
Program to find a 'big' prime number, suitable for use in <br />
cryptographic applications (with some more primality testing).<br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
It shows use of some more advanced functions for ZZ values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
<br />
<br />
==[ ex-ring1.C ]==<br />
This example program shows how to create various types of ring, and <br />
several operations one can perform on rings (e.g. querying their <br />
properties).<br />
<br />
=== long description ===<br />
It creates several different sorts of ring, <br />
and then calls PrintRingInfo on each one. <br />
Note the considerable overhead needed to create a (non-standard) PolyRing:<br />
first you must make a PPOrdering, <br />
then you must make a PPMonoid from that ordering, <br />
and finally you can make a PolyRing. <br />
The tedious part is specifying the names of the indeterminates. <br />
We hope to make this less cumbersome soon. <br />
<br />
<br />
==[ ex-RingZ1.C ]==<br />
This is a basic example about the creation and use of the ring of integers.<br />
It illustrates the CoCoALib "philosophy" of first creating a ring, and <br />
then computing with values in that ring. <br />
The C++ commands for performing arithmetic on RingElems have a natural <br />
syntax (except we cannot use ^ for powers). <br />
It warns about "mixed ring arithmetic", which is forbidden in CoCoALib. <br />
<br />
=== long description ===<br />
To calculate with elements of a ring we must first create the <br />
the ring, then we can create C++ objects of type RingElem which <br />
belong to the ring -- a RingElem can change its value but not <br />
the ring to which it belongs. <br />
<br />
<br />
==[ ex-RingQ1.C ]==<br />
Some simple computations with rational numbers. <br />
This example illustrates how to create the field of rational numbers. <br />
It shows that we can compute 7/2 in Q but not in Z. <br />
It shows how to map an integer into a rational number. <br />
<br />
=== long description ===<br />
Familiarize yourself with the example ex-RingZ1.C before proceeding. <br />
As C++ does not natively have any rings, we must construct them from <br />
scratch. <br />
<br />
<br />
==[ ex-RingFloat1.C ]==<br />
Example showing some features of RingFloat.<br />
Program to explore the precision offered by RingFloat<br />
<br />
==[ ex-RingFloat2.C ]==<br />
Program exhibiting a way of using ever higher precisions...<br />
<br />
=== long description ===<br />
Example showing iterative increase of precision using RingFloat until <br />
the answer is found (or an arbitrary limit on precision is reached). <br />
This program will always fail to find the limit: J-M Muller's sequence <br />
actually converges to 6 (rather slowly), however it is pathological <br />
because it converges to 100 using any finite precision arithmetic. <br />
RingFloat detects the onset of pathological convergence to 100, and <br />
throws an InsufficientPrecision exception. <br />
<br />
<br />
==[ ex-RingFloat3.C ]==<br />
Program showing how some RingFloat values can have more precision <br />
than that requested. <br />
<br />
=== long description ===<br />
Example showing that certain RingFloat values may have a precision <br />
higher than that requested. In this case we request 64 bits (i.e. <br />
about 19 decimal digits), but are able to remove the nine most <br />
significant digits and still have a result with the requested precision.<br />
So the original value of the variable third did in fact have at <br />
least 93 bits correct (i.e. about 28 decimal digits). <br />
<br />
<br />
==[ ex-RingFp1.C ]==<br />
Inefficient program to compute sqrt(2) modulo a given number. <br />
Simple example using finite fields or integers modulo N.<br />
<br />
=== long description ===<br />
The program asks the user for the value of N, it creates the <br />
ring of integers mod N, and finally uses "brute force" to find <br />
all square-roots of 2 modulo N. <br />
<br />
<br />
==[ ex-RingFp2.C ]==<br />
Example program showing how to create small prime finite fields <br />
implemented in a specific manner -- normally it is best to let <br />
the function NewZmod choose automatically the best implementation. <br />
<br />
=== long description ===<br />
The program asks the user for the characteristic N, and then tries <br />
different ways of making Z mod N.<br />
<br />
<br />
==[ ex-PPMonoidElem1.C ]==<br />
Example of use of power products and PPMonoids. <br />
Program exhibiting most functions on power products.<br />
<br />
==[ ex-RingElem1.C ]==<br />
Example showing operations on RingElem for a ring or a PolyRing.<br />
<br />
=== long description ===<br />
This is a long list of function calls from different rings. <br />
<br />
<br />
==[ ex-RingHom1.C ]==<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. <br />
<br />
=== long description ===<br />
We compute these polynomials (with parameters) in some rings: <br />
f = (2*a/3-1)*x[0] + 1/a; g = x[0]-a; <br />
<br />
<br />
==[ ex-RingHom2.C ]==<br />
Operations between elements of different rings are not allowed <br />
but we can use homomorphisms to map the elements into the <br />
same ring. <br />
<br />
=== long description ===<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. In particular, it gives a simple <br />
example of mixed ring arithmetic: the user must map all values <br />
into a single ring before combining them arithmetically. <br />
<br />
<br />
==[ ex-RingHom3.C ]==<br />
This program shows how we can use ring homomorphism <br />
to perform a change of coordinates in a polynomial ring. <br />
<br />
==[ ex-RingHom4.C ]==<br />
This program shows how we can use ring homomorphism <br />
to evaluate polynomials. <br />
<br />
==[ ex-matrix1.C ]==<br />
Example program illustrating the creation of matrices, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the matrix code is still rather young. <br />
<br />
<br />
==[ ex-module1.C ]==<br />
Example program illustrating the creation of free modules, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the module code is still rather young. <br />
<br />
<br />
==[ ex-PolyInput1.C ]==<br />
This program shows a way to read a polynomial from the input.<br />
<br />
==[ ex-OrderingGrading1.C ]==<br />
Predefined and user-defined orderings and gradings <br />
on PPMonoid and PolyRing. <br />
<br />
=== long description ===<br />
Each ordering is degree-compatible with grading over Z^GradingDim <br />
i.e. the grading is given by the first GradingDim rows <br />
of the ordering matrix. <br />
<br />
<br />
==[ ex-GMPAllocator.C ]==<br />
Program to find lengths of 3n+1 sequences. (uses CoCoA::GMPAllocator) <br />
<br />
=== long description ===<br />
This example shows how a CoCoA::GMPAllocator can be used. If you do <br />
computations involving many small big-integers (up to about 40 decimal <br />
digits) then the custom allocator may give slightly better run-time <br />
performance -- you must compile with debugging turned off! <br />
The crucial command is the very first line of "program" just comment it <br />
out and recompile to use the default system allocator for GMP values. <br />
<br />
<br />
==[ ex-PolyIterator1.C ]==<br />
Program showing how to iterate through "sparse" polynomials.<br />
<br />
==[ ex-PolyIterator2.C ]==<br />
Program showing how to homogenize a sparse polynomial using iterators.<br />
<br />
=== long description ===<br />
This is just an example! If you want to homogenize polynomials <br />
you should use the library function "homog". <br />
<br />
<br />
==[ ex-NF.C ]==<br />
Example program illustrating an implementation of Normal Remainder <br />
wrt a list of polynomials. <br />
If the list is a Groebner Basis, NR returns the Normal Form. <br />
<br />
=== long description ===<br />
This is just an example! If you want to compute Normal Forms <br />
you should use the library function "NF". <br />
<br />
<br />
==[ ex-PolyRing1.C ]==<br />
Example of how to create some simple polynomial rings, and use of some <br />
of the operations specific to elements of PolyRings.<br />
<br />
==[ ex-ApproxPts1.C ]==<br />
A short example showing how to use the ApproxPt preprocessing algorithms.<br />
See the file ex-ApproxPt1.in for a sample input.<br />
<br />
==[ ex-AlexanderDual.C ]==<br />
Program showing how to compute the Alexander Dual of a mon'l sqfr ideal.<br />
<br />
=== long description ===<br />
It offers the function "PrimaryDecomposition" for a mon'l sqfr ideal<br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-QuotientBasis.C ]==<br />
Program showing how to compute a quotient basis of a 0-dimensional ideal.<br />
<br />
=== long description ===<br />
It offers the function "QuotientBasisRec" <br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-hilbert1.C ]==<br />
This example is just for testing the Hilbert code. <br />
It might disappear as soon as HilbertSeries is included in CoCoALib. <br />
<br />
=== long description ===<br />
This code also shows how to create the "chess examples". <br />
<br />
<br />
==[ ex-RingWeyl1.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
All these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl2.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl3.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl4.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl5.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-FGLM.C ]==<br />
Example of how to use the implementation of the <br />
FGLM algorithm to do Groebner Basis conversion. <br />
<br />
==[ ex-OrderIdeal.C ]==<br />
Example of how to use the [OrderIdeal] CoCoALib class.<br />
<br />
==[ ex-BorderBasis.C ]==<br />
Example of how to use the implementation of the <br />
Border Basis Algorithm to compute a O_\sigma{Id(gens)}-border basis.<br />
<br />
<br />
----<br />
<br />
<br />
[[Category:CoCoALib]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoALib:Examples&diff=4153CoCoALib:Examples2007-02-12T19:18:58Z<p>Bigatti: </p>
<hr />
<div>This page contains the file "LongIndex.txt" in the directory "examples/" of the CoCoALib.<br />
<br />
<br />
DO NOT EDIT UNDER THIS LINE (automatically generated).<br />
Send edits and comments to Anna Bigatti.<br />
<br />
----<br />
<br />
<br />
==[ ex-empty.C ]==<br />
This is a template file for example programs. <br />
The program itself does nothing whatsoever. <br />
<br />
=== long description ===<br />
Make a copy "foo.C" of this file and put your code in "program" <br />
Compile it in the examples directory like this: <br />
"make foo" <br />
<br />
<br />
==[ ex-BuildInfo.C ]==<br />
This is a very short example showing what you can do with BuildInfo. <br />
<br />
=== long description ===<br />
BuildInfo::PrintAll gives important information in the (enormously <br />
unlikely :-) event that you need to report a bug in CoCoALib. <br />
<br />
<br />
==[ ex-ZZ1.C ]==<br />
Program to calculate the modular inverse of a number. <br />
You must give as input the modulus and the residue; <br />
the residue need not be reduced. <br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
Contrast this example with ex-RingZ1. <br />
<br />
<br />
==[ ex-ZZ-prime1.C ]==<br />
Program to find a 'big' prime number, suitable for use in <br />
cryptographic applications (with some more primality testing).<br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
It shows use of some more advanced functions for ZZ values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
<br />
<br />
==[ ex-ring1.C ]==<br />
This example program shows how to create various types of ring, and <br />
several operations one can perform on rings (e.g. querying their <br />
properties).<br />
<br />
=== long description ===<br />
It creates several different sorts of ring, <br />
and then calls PrintRingInfo on each one. <br />
Note the considerable overhead needed to create a (non-standard) PolyRing:<br />
first you must make a PPOrdering, <br />
then you must make a PPMonoid from that ordering, <br />
and finally you can make a PolyRing. <br />
The tedious part is specifying the names of the indeterminates. <br />
We hope to make this less cumbersome soon. <br />
<br />
<br />
==[ ex-RingZ1.C ]==<br />
This is a basic example about the creation and use of the ring of integers.<br />
It illustrates the CoCoALib "philosophy" of first creating a ring, and <br />
then computing with values in that ring. <br />
The C++ commands for performing arithmetic on RingElems have a natural <br />
syntax (except we cannot use ^ for powers). <br />
It warns about "mixed ring arithmetic", which is forbidden in CoCoALib. <br />
<br />
=== long description ===<br />
To calculate with elements of a ring we must first create the <br />
the ring, then we can create C++ objects of type RingElem which <br />
belong to the ring -- a RingElem can change its value but not <br />
the ring to which it belongs. <br />
<br />
<br />
==[ ex-RingQ1.C ]==<br />
Some simple computations with rational numbers. <br />
This example illustrates how to create the field of rational numbers. <br />
It shows that we can compute 7/2 in Q but not in Z. <br />
It shows how to map an integer into a rational number. <br />
<br />
=== long description ===<br />
Familiarize yourself with the example ex-RingZ1.C before proceeding. <br />
As C++ does not natively have any rings, we must construct them from <br />
scratch. <br />
<br />
<br />
==[ ex-RingFloat1.C ]==<br />
Example showing some features of RingFloat.<br />
Program to explore the precision offered by RingFloat<br />
<br />
==[ ex-RingFloat2.C ]==<br />
Program exhibiting a way of using ever higher precisions...<br />
<br />
=== long description ===<br />
Example showing iterative increase of precision using RingFloat until <br />
the answer is found (or an arbitrary limit on precision is reached). <br />
This program will always fail to find the limit: J-M Muller's sequence <br />
actually converges to 6 (rather slowly), however it is pathological <br />
because it converges to 100 using any finite precision arithmetic. <br />
RingFloat detects the onset of pathological convergence to 100, and <br />
throws an InsufficientPrecision exception. <br />
<br />
<br />
==[ ex-RingFloat3.C ]==<br />
Program showing how some RingFloat values can have more precision <br />
than that requested. <br />
<br />
=== long description ===<br />
Example showing that certain RingFloat values may have a precision <br />
higher than that requested. In this case we request 64 bits (i.e. <br />
about 19 decimal digits), but are able to remove the nine most <br />
significant digits and still have a result with the requested precision.<br />
So the original value of the variable third did in fact have at <br />
least 93 bits correct (i.e. about 28 decimal digits). <br />
<br />
<br />
==[ ex-RingFp1.C ]==<br />
Inefficient program to compute sqrt(2) modulo a given number. <br />
Simple example using finite fields or integers modulo N.<br />
<br />
=== long description ===<br />
The program asks the user for the value of N, it creates the <br />
ring of integers mod N, and finally uses "brute force" to find <br />
all square-roots of 2 modulo N. <br />
<br />
<br />
==[ ex-RingFp2.C ]==<br />
Example program showing how to create small prime finite fields <br />
implemented in a specific manner -- normally it is best to let <br />
the function NewZmod choose automatically the best implementation. <br />
<br />
=== long description ===<br />
The program asks the user for the characteristic N, and then tries <br />
different ways of making Z mod N.<br />
<br />
<br />
==[ ex-PPMonoidElem1.C ]==<br />
Example of use of power products and PPMonoids. <br />
Program exhibiting most functions on power products.<br />
<br />
==[ ex-RingElem1.C ]==<br />
Example showing operations on RingElem for a ring or a PolyRing.<br />
<br />
=== long description ===<br />
This is a long list of function calls from different rings. <br />
<br />
<br />
==[ ex-RingHom1.C ]==<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. <br />
<br />
=== long description ===<br />
We compute these polynomials (with parameters) in some rings: <br />
f = (2*a/3-1)*x[0] + 1/a; g = x[0]-a; <br />
<br />
<br />
==[ ex-RingHom2.C ]==<br />
Operations between elements of different rings are not allowed <br />
but we can use homomorphisms to map the elements into the <br />
same ring. <br />
<br />
=== long description ===<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. In particular, it gives a simple <br />
example of mixed ring arithmetic: the user must map all values <br />
into a single ring before combining them arithmetically. <br />
<br />
<br />
==[ ex-RingHom3.C ]==<br />
This program shows how we can use ring homomorphism <br />
to perform a change of coordinates in a polynomial ring. <br />
<br />
==[ ex-RingHom4.C ]==<br />
This program shows how we can use ring homomorphism <br />
to evaluate polynomials. <br />
<br />
==[ ex-matrix1.C ]==<br />
Example program illustrating the creation of matrices, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the matrix code is still rather young. <br />
<br />
<br />
==[ ex-module1.C ]==<br />
Example program illustrating the creation of free modules, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the module code is still rather young. <br />
<br />
<br />
==[ ex-PolyInput1.C ]==<br />
This program shows a way to read a polynomial from the input.<br />
<br />
==[ ex-OrderingGrading1.C ]==<br />
Predefined and user-defined orderings and gradings <br />
on PPMonoid and PolyRing. <br />
<br />
=== long description ===<br />
Each ordering is degree-compatible with grading over Z^GradingDim <br />
i.e. the grading is given by the first GradingDim rows <br />
of the ordering matrix. <br />
<br />
<br />
==[ ex-GMPAllocator.C ]==<br />
Program to find lengths of 3n+1 sequences. (uses CoCoA::GMPAllocator) <br />
<br />
=== long description ===<br />
This example shows how a CoCoA::GMPAllocator can be used. If you do <br />
computations involving many small big-integers (up to about 40 decimal <br />
digits) then the custom allocator may give slightly better run-time <br />
performance -- you must compile with debugging turned off! <br />
The crucial command is the very first line of "program" just comment it <br />
out and recompile to use the default system allocator for GMP values. <br />
<br />
<br />
==[ ex-PolyIterator1.C ]==<br />
Program showing how to iterate through "sparse" polynomials.<br />
<br />
==[ ex-PolyIterator2.C ]==<br />
Program showing how to homogenize a sparse polynomial using iterators.<br />
<br />
=== long description ===<br />
This is just an example! If you want to homogenize polynomials <br />
you should use the library function "homog". <br />
<br />
<br />
==[ ex-NF.C ]==<br />
Example program illustrating an implementation of Normal Remainder <br />
wrt a list of polynomials. <br />
If the list is a Groebner Basis, NR returns the Normal Form. <br />
<br />
=== long description ===<br />
This is just an example! If you want to compute Normal Forms <br />
you should use the library function "NF". <br />
<br />
<br />
==[ ex-PolyRing1.C ]==<br />
Example of how to create some simple polynomial rings, and use of some <br />
of the operations specific to elements of PolyRings.<br />
<br />
==[ ex-ApproxPts1.C ]==<br />
A short example showing how to use the ApproxPt preprocessing algorithms.<br />
See the file ex-ApproxPt1.in for a sample input.<br />
<br />
==[ ex-AlexanderDual.C ]==<br />
Program showing how to compute the Alexander Dual of a mon'l sqfr ideal.<br />
<br />
=== long description ===<br />
It offers the function "PrimaryDecomposition" for a mon'l sqfr ideal<br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-QuotientBasis.C ]==<br />
Program showing how to compute a quotient basis of a 0-dimensional ideal.<br />
<br />
=== long description ===<br />
It offers the function "QuotientBasisRec" <br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-hilbert1.C ]==<br />
This example is just for testing the Hilbert code. <br />
It might disappear as soon as HilbertSeries is included in CoCoALib. <br />
<br />
=== long description ===<br />
This code also shows how to create the "chess examples". <br />
<br />
<br />
==[ ex-RingWeyl1.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
All these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl2.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl3.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl4.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl5.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-FGLM.C ]==<br />
Example of how to use the implementation of the <br />
FGLM algorithm to do Groebner Basis conversion. <br />
<br />
==[ ex-OrderIdeal.C ]==<br />
Example of how to use the [OrderIdeal] CoCoALib class.<br />
<br />
==[ ex-BorderBasis.C ]==<br />
Example of how to use the implementation of the <br />
Border Basis Algorithm to compute a O_\sigma{Id(gens)}-border basis.<br />
<br />
<br />
----<br />
<br />
<br />
[[Category:CoCoALib]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoALib:Examples&diff=4152CoCoALib:Examples2007-02-12T16:23:47Z<p>Bigatti: </p>
<hr />
<div>This page contains the file "LongIndex.txt" in the directory "examples/" of the CoCoALib.<br />
<br />
<br />
DO NOT EDIT UNDER THIS LINE (automatically generated).<br />
Send edits and comments to Anna Bigatti.<br />
<br />
----<br />
<br />
<br />
==[ ex-empty.C ]==<br />
This is a template file for example programs. <br />
The program itself does nothing whatsoever. <br />
<br />
=== long description ===<br />
Make a copy "foo.C" of this file and put your code in "program" <br />
Compile it in the examples directory like this: <br />
"make foo" <br />
<br />
<br />
==[ ex-BuildInfo.C ]==<br />
This is a very short example showing what you can do with BuildInfo. <br />
<br />
=== long description ===<br />
BuildInfo::PrintAll gives important information in the (enormously <br />
unlikely :-) event that you need to report a bug in CoCoALib. <br />
<br />
<br />
==[ ex-ZZ1.C ]==<br />
Program to calculate the modular inverse of a number. <br />
You must give as input the modulus and the residue; <br />
the residue need not be reduced. <br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
Contrast this example with ex-RingZ1. <br />
<br />
<br />
==[ ex-ZZ-prime1.C ]==<br />
Program to find a 'big' prime number, suitable for use in <br />
cryptographic applications (with some more primality testing).<br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
It shows use of some more advanced functions for ZZ values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
<br />
<br />
==[ ex-ring1.C ]==<br />
This example program shows how to create various types of ring, and <br />
several operations one can perform on rings (e.g. querying their <br />
properties).<br />
<br />
=== long description ===<br />
It creates several different sorts of ring, <br />
and then calls PrintRingInfo on each one. <br />
Note the considerable overhead needed to create a (non-standard) PolyRing:<br />
first you must make a PPOrdering, <br />
then you must make a PPMonoid from that ordering, <br />
and finally you can make a PolyRing. <br />
The tedious part is specifying the names of the indeterminates. <br />
We hope to make this less cumbersome soon. <br />
<br />
<br />
==[ ex-RingZ1.C ]==<br />
This is a basic example about the creation and use of the ring of integers.<br />
It illustrates the CoCoALib "philosophy" of first creating a ring, and <br />
then computing with values in that ring. <br />
The C++ commands for performing arithmetic on RingElems have a natural <br />
syntax (except we cannot use ^ for powers). <br />
It warns about "mixed ring arithmetic", which is forbidden in CoCoALib. <br />
<br />
=== long description ===<br />
To calculate with elements of a ring we must first create the <br />
the ring, then we can create C++ objects of type RingElem which <br />
belong to the ring -- a RingElem can change its value but not <br />
the ring to which it belongs. <br />
<br />
<br />
==[ ex-RingQ1.C ]==<br />
Some simple computations with rational numbers. <br />
This example illustrates how to create the field of rational numbers. <br />
It shows that we can compute 7/2 in Q but not in Z. <br />
It shows how to map an integer into a rational number. <br />
<br />
=== long description ===<br />
Familiarize yourself with the example ex-RingZ1.C before proceeding. <br />
As C++ does not natively have any rings, we must construct them from <br />
scratch. <br />
<br />
<br />
==[ ex-RingFloat1.C ]==<br />
Example showing some features of RingFloat.<br />
Program to explore the precision offered by RingFloat<br />
<br />
==[ ex-RingFloat2.C ]==<br />
Program exhibiting a way of using ever higher precisions...<br />
<br />
=== long description ===<br />
Example showing iterative increase of precision using RingFloat until <br />
the answer is found (or an arbitrary limit on precision is reached). <br />
This program will always fail to find the limit: J-M Muller's sequence <br />
actually converges to 6 (rather slowly), however it is pathological <br />
because it converges to 100 using any finite precision arithmetic. <br />
RingFloat detects the onset of pathological convergence to 100, and <br />
throws an InsufficientPrecision exception. <br />
<br />
<br />
==[ ex-RingFloat3.C ]==<br />
Program showing how some RingFloat values can have more precision <br />
than that requested. <br />
<br />
=== long description ===<br />
Example showing that certain RingFloat values may have a precision <br />
higher than that requested. In this case we request 64 bits (i.e. <br />
about 19 decimal digits), but are able to remove the nine most <br />
significant digits and still have a result with the requested precision.<br />
So the original value of the variable third did in fact have at <br />
least 93 bits correct (i.e. about 28 decimal digits). <br />
<br />
<br />
==[ ex-RingFp1.C ]==<br />
Inefficient program to compute sqrt(2) modulo a given number. <br />
Simple example using finite fields or integers modulo N.<br />
<br />
=== long description ===<br />
The program asks the user for the value of N, it creates the <br />
ring of integers mod N, and finally uses "brute force" to find <br />
all square-roots of 2 modulo N. <br />
<br />
<br />
==[ ex-RingFp2.C ]==<br />
Example program showing how to create small prime finite fields <br />
implemented in a specific manner -- normally it is best to let <br />
the function NewZmod choose automatically the best implementation. <br />
<br />
=== long description ===<br />
The program asks the user for the characteristic N, and then tries <br />
different ways of making Z mod N.<br />
<br />
<br />
==[ ex-PPMonoidElem1.C ]==<br />
Example of use of power products and PPMonoids. <br />
Program exhibiting most functions on power products.<br />
<br />
==[ ex-RingElem1.C ]==<br />
Example showing operations on RingElem for a ring or a PolyRing.<br />
<br />
=== long description ===<br />
This is a long list of function calls from different rings. <br />
<br />
<br />
==[ ex-RingHom1.C ]==<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. <br />
<br />
=== long description ===<br />
We compute these polynomials (with parameters) in some rings: <br />
f = (2*a/3-1)*x[0] + 1/a; g = x[0]-a; <br />
<br />
<br />
==[ ex-RingHom2.C ]==<br />
Operations between elements of different rings are not allowed <br />
but we can use homomorphisms to map the elements into the <br />
same ring. <br />
<br />
=== long description ===<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. In particular, it gives a simple <br />
example of mixed ring arithmetic: the user must map all values <br />
into a single ring before combining them arithmetically. <br />
<br />
<br />
==[ ex-RingHom3.C ]==<br />
This program shows how we can use ring homomorphism <br />
to perform a change of coordinates in a polynomial ring. <br />
<br />
==[ ex-RingHom4.C ]==<br />
This program shows how we can use ring homomorphism <br />
to evaluate polynomials. <br />
<br />
==[ ex-matrix1.C ]==<br />
Example program illustrating the creation of matrices, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the matrix code is still rather young. <br />
<br />
<br />
==[ ex-module1.C ]==<br />
Example program illustrating the creation of free modules, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the module code is still rather young. <br />
<br />
<br />
==[ ex-PolyInput1.C ]==<br />
This program shows a way to read a polynomial from the input.<br />
<br />
==[ ex-OrderingGrading1.C ]==<br />
Predefined and user-defined orderings and gradings <br />
on PPMonoid and PolyRing. <br />
<br />
=== long description ===<br />
Each ordering is degree-compatible with grading over Z^GradingDim <br />
i.e. the grading is given by the first GradingDim rows <br />
of the ordering matrix. <br />
<br />
<br />
==[ ex-GMPAllocator.C ]==<br />
Program to find lengths of 3n+1 sequences. (uses CoCoA::GMPAllocator) <br />
<br />
=== long description ===<br />
This example shows how a CoCoA::GMPAllocator can be used. If you do <br />
computations involving many small big-integers (up to about 40 decimal <br />
digits) then the custom allocator may give slightly better run-time <br />
performance -- you must compile with debugging turned off! <br />
The crucial command is the very first line of "program" just comment it <br />
out and recompile to use the default system allocator for GMP values. <br />
<br />
<br />
==[ ex-PolyIterator1.C ]==<br />
Program showing how to iterate through "sparse" polynomials.<br />
<br />
==[ ex-PolyIterator2.C ]==<br />
Program showing how to homogenize a sparse polynomial using iterators.<br />
<br />
=== long description ===<br />
This is just an example! If you want to homogenize polynomials <br />
you should use the library function "homog". <br />
<br />
<br />
==[ ex-NF.C ]==<br />
Example program illustrating an implementation of Normal Remainder <br />
wrt a list of polynomials. <br />
If the list is a Groebner Basis, NR returns the Normal Form. <br />
<br />
=== long description ===<br />
This is just an example! If you want to compute Normal Forms <br />
you should use the library function "NF". <br />
<br />
<br />
==[ ex-PolyRing1.C ]==<br />
Example of how to create some simple polynomial rings, and use of some <br />
of the operations specific to elements of PolyRings.<br />
<br />
==[ ex-ApproxPts1.C ]==<br />
A short example showing how to use the ApproxPt preprocessing algorithms.<br />
See the file ex-ApproxPt1.in for a sample input.<br />
<br />
==[ ex-AlexanderDual.C ]==<br />
Program showing how to compute the Alexander Dual of a mon'l sqfr ideal.<br />
<br />
=== long description ===<br />
It offers the function "PrimaryDecomposition" for a mon'l sqfr ideal<br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-QuotientBasis.C ]==<br />
Program showing how to compute a quotient basis of a 0-dimensional ideal.<br />
<br />
=== long description ===<br />
It offers the function "QuotientBasisRec" <br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-hilbert1.C ]==<br />
This example is just for testing the Hilbert code. <br />
It might disappear as soon as HilbertSeries is included in CoCoALib. <br />
<br />
=== long description ===<br />
This code also shows how to create the "chess examples". <br />
<br />
<br />
==[ ex-RingWeyl1.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
All these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl2.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl3.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl4.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl5.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-FGLM.C ]==<br />
Example of how to use the implementation of the <br />
FGLM algorithm to do Groebner Basis conversion. <br />
<br />
==[ ex-OrderIdeal.C ]==<br />
Example of how to use the [OrderIdeal] CoCoALib class.<br />
<br />
==[ ex-BorderBasis.C ]==<br />
Example of how to use the implementation of the <br />
Border Basis Algorithm to compute a O_\sigma{Id(gens)}-border basis.<br />
<br />
<br />
----<br />
<br />
<br />
<br />
[[Category:CoCoALib]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoALib:Examples&diff=4151CoCoALib:Examples2007-02-12T16:22:39Z<p>Bigatti: </p>
<hr />
<div>This page contains the file "LongIndex.txt" in the directory "examples/" of the CoCoALib.<br />
<br />
<br />
DO NOT EDIT UNDER THIS LINE (automatically generated).<br />
Send edits and comments to Anna Bigatti.<br />
<br />
----<br />
<br />
<br />
==[ ex-empty.C ]==<br />
This is a template file for example programs. <br />
The program itself does nothing whatsoever. <br />
<br />
=== long description ===<br />
Make a copy "foo.C" of this file and put your code in "program" <br />
Compile it in the examples directory like this: <br />
"make foo" <br />
<br />
<br />
==[ ex-BuildInfo.C ]==<br />
This is a very short example showing what you can do with BuildInfo. <br />
<br />
=== long description ===<br />
BuildInfo::PrintAll gives important information in the (enormously <br />
unlikely :-) event that you need to report a bug in CoCoALib. <br />
<br />
<br />
==[ ex-ZZ1.C ]==<br />
Program to calculate the modular inverse of a number. <br />
You must give as input the modulus and the residue; <br />
the residue need not be reduced. <br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
Contrast this example with ex-RingZ1. <br />
<br />
<br />
==[ ex-ZZ-prime1.C ]==<br />
Program to find a 'big' prime number, suitable for use in <br />
cryptographic applications (with some more primality testing).<br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
It shows use of some more advanced functions for ZZ values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
<br />
<br />
==[ ex-ring1.C ]==<br />
This example program shows how to create various types of ring, and <br />
several operations one can perform on rings (e.g. querying their <br />
properties).<br />
<br />
=== long description ===<br />
It creates several different sorts of ring, <br />
and then calls PrintRingInfo on each one. <br />
Note the considerable overhead needed to create a (non-standard) PolyRing:<br />
first you must make a PPOrdering, <br />
then you must make a PPMonoid from that ordering, <br />
and finally you can make a PolyRing. <br />
The tedious part is specifying the names of the indeterminates. <br />
We hope to make this less cumbersome soon. <br />
<br />
<br />
==[ ex-RingZ1.C ]==<br />
This is a basic example about the creation and use of the ring of integers.<br />
It illustrates the CoCoALib "philosophy" of first creating a ring, and <br />
then computing with values in that ring. <br />
The C++ commands for performing arithmetic on RingElems have a natural <br />
syntax (except we cannot use ^ for powers). <br />
It warns about "mixed ring arithmetic", which is forbidden in CoCoALib. <br />
<br />
=== long description ===<br />
To calculate with elements of a ring we must first create the <br />
the ring, then we can create C++ objects of type RingElem which <br />
belong to the ring -- a RingElem can change its value but not <br />
the ring to which it belongs. <br />
<br />
<br />
==[ ex-RingQ1.C ]==<br />
Some simple computations with rational numbers. <br />
This example illustrates how to create the field of rational numbers. <br />
It shows that we can compute 7/2 in Q but not in Z. <br />
It shows how to map an integer into a rational number. <br />
<br />
=== long description ===<br />
Familiarize yourself with the example ex-RingZ1.C before proceeding. <br />
As C++ does not natively have any rings, we must construct them from <br />
scratch. <br />
<br />
<br />
==[ ex-RingFloat1.C ]==<br />
Example showing some features of RingFloat.<br />
Program to explore the precision offered by RingFloat<br />
<br />
==[ ex-RingFloat2.C ]==<br />
Program exhibiting a way of using ever higher precisions...<br />
<br />
=== long description ===<br />
Example showing iterative increase of precision using RingFloat until <br />
the answer is found (or an arbitrary limit on precision is reached). <br />
This program will always fail to find the limit: J-M Muller's sequence <br />
actually converges to 6 (rather slowly), however it is pathological <br />
because it converges to 100 using any finite precision arithmetic. <br />
RingFloat detects the onset of pathological convergence to 100, and <br />
throws an InsufficientPrecision exception. <br />
<br />
<br />
==[ ex-RingFloat3.C ]==<br />
Program showing how some RingFloat values can have more precision <br />
than that requested. <br />
<br />
=== long description ===<br />
Example showing that certain RingFloat values may have a precision <br />
higher than that requested. In this case we request 64 bits (i.e. <br />
about 19 decimal digits), but are able to remove the nine most <br />
significant digits and still have a result with the requested precision.<br />
So the original value of the variable third did in fact have at <br />
least 93 bits correct (i.e. about 28 decimal digits). <br />
<br />
<br />
==[ ex-RingFp1.C ]==<br />
Inefficient program to compute sqrt(2) modulo a given number. <br />
Simple example using finite fields or integers modulo N.<br />
<br />
=== long description ===<br />
The program asks the user for the value of N, it creates the <br />
ring of integers mod N, and finally uses "brute force" to find <br />
all square-roots of 2 modulo N. <br />
<br />
<br />
==[ ex-RingFp2.C ]==<br />
Example program showing how to create small prime finite fields <br />
implemented in a specific manner -- normally it is best to let <br />
the function NewZmod choose automatically the best implementation. <br />
<br />
=== long description ===<br />
The program asks the user for the characteristic N, and then tries <br />
different ways of making Z mod N.<br />
<br />
<br />
==[ ex-PPMonoidElem1.C ]==<br />
Example of use of power products and PPMonoids. <br />
Program exhibiting most functions on power products.<br />
<br />
==[ ex-RingElem1.C ]==<br />
Example showing operations on RingElem for a ring or a PolyRing.<br />
<br />
=== long description ===<br />
This is a long list of function calls from different rings. <br />
<br />
<br />
==[ ex-RingHom1.C ]==<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. <br />
<br />
=== long description ===<br />
We compute these polynomials (with parameters) in some rings: <br />
f = (2*a/3-1)*x[0] + 1/a; g = x[0]-a; <br />
<br />
<br />
==[ ex-RingHom2.C ]==<br />
Operations between elements of different rings are not allowed <br />
but we can use homomorphisms to map the elements into the <br />
same ring. <br />
<br />
=== long description ===<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. In particular, it gives a simple <br />
example of mixed ring arithmetic: the user must map all values <br />
into a single ring before combining them arithmetically. <br />
<br />
<br />
==[ ex-RingHom3.C ]==<br />
This program shows how we can use ring homomorphism <br />
to perform a change of coordinates in a polynomial ring. <br />
<br />
==[ ex-RingHom4.C ]==<br />
This program shows how we can use ring homomorphism <br />
to evaluate polynomials. <br />
<br />
==[ ex-matrix1.C ]==<br />
Example program illustrating the creation of matrices, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the matrix code is still rather young. <br />
<br />
<br />
==[ ex-module1.C ]==<br />
Example program illustrating the creation of free modules, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the module code is still rather young. <br />
<br />
<br />
==[ ex-PolyInput1.C ]==<br />
This program shows a way to read a polynomial from the input.<br />
<br />
==[ ex-OrderingGrading1.C ]==<br />
Predefined and user-defined orderings and gradings <br />
on PPMonoid and PolyRing. <br />
<br />
=== long description ===<br />
Each ordering is degree-compatible with grading over Z^GradingDim <br />
i.e. the grading is given by the first GradingDim rows <br />
of the ordering matrix. <br />
<br />
<br />
==[ ex-GMPAllocator.C ]==<br />
Program to find lengths of 3n+1 sequences. (uses CoCoA::GMPAllocator) <br />
<br />
=== long description ===<br />
This example shows how a CoCoA::GMPAllocator can be used. If you do <br />
computations involving many small big-integers (up to about 40 decimal <br />
digits) then the custom allocator may give slightly better run-time <br />
performance -- you must compile with debugging turned off! <br />
The crucial command is the very first line of "program" just comment it <br />
out and recompile to use the default system allocator for GMP values. <br />
<br />
<br />
==[ ex-PolyIterator1.C ]==<br />
Program showing how to iterate through "sparse" polynomials.<br />
<br />
==[ ex-PolyIterator2.C ]==<br />
Program showing how to homogenize a sparse polynomial using iterators.<br />
<br />
=== long description ===<br />
This is just an example! If you want to homogenize polynomials <br />
you should use the library function "homog". <br />
<br />
<br />
==[ ex-NF.C ]==<br />
Example program illustrating an implementation of Normal Remainder <br />
wrt a list of polynomials. <br />
If the list is a Groebner Basis, NR returns the Normal Form. <br />
<br />
=== long description ===<br />
This is just an example! If you want to compute Normal Forms <br />
you should use the library function "NF". <br />
<br />
<br />
==[ ex-PolyRing1.C ]==<br />
Example of how to create some simple polynomial rings, and use of some <br />
of the operations specific to elements of PolyRings.<br />
<br />
==[ ex-ApproxPts1.C ]==<br />
A short example showing how to use the ApproxPt preprocessing algorithms.<br />
See the file ex-ApproxPt1.in for a sample input.<br />
<br />
==[ ex-AlexanderDual.C ]==<br />
Program showing how to compute the Alexander Dual of a mon'l sqfr ideal.<br />
<br />
=== long description ===<br />
It offers the function "PrimaryDecomposition" for a mon'l sqfr ideal<br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-QuotientBasis.C ]==<br />
Program showing how to compute a quotient basis of a 0-dimensional ideal.<br />
<br />
=== long description ===<br />
It offers the function "QuotientBasisRec" <br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-hilbert1.C ]==<br />
This example is just for testing the Hilbert code. <br />
It might disappear as soon as HilbertSeries is included in CoCoALib. <br />
<br />
=== long description ===<br />
This code also shows how to create the "chess examples". <br />
<br />
<br />
==[ ex-RingWeyl1.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
All these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl2.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl3.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl4.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl5.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-FGLM.C ]==<br />
Example of how to use the implementation of the <br />
FGLM algorithm to do Groebner Basis conversion. <br />
<br />
==[ ex-OrderIdeal.C ]==<br />
Example of how to use the [OrderIdeal] CoCoALib class.<br />
<br />
==[ ex-BorderBasis.C ]==<br />
Example of how to use the implementation of the <br />
Border Basis Algorithm to compute a O_\sigma{Id(gens)}-border basis.<br />
<br />
<br />
----<br />
<br />
<br />
<br />
[[Category:CoCoALib]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoALib:Examples&diff=4150CoCoALib:Examples2007-02-12T14:45:08Z<p>Bigatti: </p>
<hr />
<div>This page contains the file "LongIndex.txt" in the directory "examples/" of the CoCoALib.<br />
<br />
<br />
DO NOT EDIT UNDER THIS LINE (automatically generated).<br />
Send edits and comments to Anna Bigatti.<br />
<br />
----<br />
<br />
<br />
==[ ex-empty.C ]==<br />
This is a template file for example programs. <br />
The program itself does nothing whatsoever. <br />
<br />
=== long description ===<br />
Make a copy of this file and put your code in "program" <br />
<br />
<br />
==[ ex-BuildInfo.C ]==<br />
This is a very short example showing what you can do with BuildInfo. <br />
<br />
=== long description ===<br />
BuildInfo::PrintAll gives important information in the (enormously <br />
unlikely :-) event that you need to report a bug in CoCoALib. <br />
<br />
<br />
==[ ex-ZZ1.C ]==<br />
Program to calculate the modular inverse of a number. <br />
You must give as input the modulus and the residue; <br />
the residue need not be reduced. <br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
Contrast this example with ex-RingZ1. <br />
<br />
<br />
==[ ex-ZZ-prime1.C ]==<br />
Program to find a 'big' prime number, suitable for use in <br />
cryptographic applications (with some more primality testing).<br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
It shows use of some more advanced functions for ZZ values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
<br />
<br />
==[ ex-ring1.C ]==<br />
This example program shows how to create various types of ring, and <br />
several operations one can perform on rings (e.g. querying their <br />
properties).<br />
<br />
=== long description ===<br />
It creates several different sorts of ring, <br />
and then calls PrintRingInfo on each one. <br />
Note the considerable overhead needed to create a (non-standard) PolyRing:<br />
first you must make a PPOrdering, <br />
then you must make a PPMonoid from that ordering, <br />
and finally you can make a PolyRing. <br />
The tedious part is specifying the names of the indeterminates. <br />
We hope to make this less cumbersome soon. <br />
<br />
<br />
==[ ex-RingZ1.C ]==<br />
This is a basic example about the creation and use of the ring of integers.<br />
It illustrates the CoCoALib "philosophy" of first creating a ring, and <br />
then computing with values in that ring. <br />
The C++ commands for performing arithmetic on RingElems have a natural <br />
syntax (except we cannot use ^ for powers). <br />
It warns about "mixed ring arithmetic", which is forbidden in CoCoALib. <br />
<br />
=== long description ===<br />
To calculate with elements of a ring we must first create the <br />
the ring, then we can create C++ objects of type RingElem which <br />
belong to the ring -- a RingElem can change its value but not <br />
the ring to which it belongs. <br />
<br />
<br />
==[ ex-RingQ1.C ]==<br />
Some simple computations with rational numbers. <br />
This example illustrates how to create the field of rational numbers. <br />
It shows that we can compute 7/2 in Q but not in Z. <br />
It shows how to map an integer into a rational number. <br />
<br />
=== long description ===<br />
Familiarize yourself with the example ex-RingZ1.C before proceeding. <br />
As C++ does not natively have any rings, we must construct them from <br />
scratch. <br />
<br />
<br />
==[ ex-RingFloat1.C ]==<br />
Example showing some features of RingFloat.<br />
Program to explore the precision offered by RingFloat<br />
<br />
==[ ex-RingFloat2.C ]==<br />
Program exhibiting a way of using ever higher precisions...<br />
<br />
=== long description ===<br />
Example showing iterative increase of precision using RingFloat until <br />
the answer is found (or an arbitrary limit on precision is reached). <br />
This program will always fail to find the limit: J-M Muller's sequence <br />
actually converges to 6 (rather slowly), however it is pathological <br />
because it converges to 100 using any finite precision arithmetic. <br />
RingFloat detects the onset of pathological convergence to 100, and <br />
throws an InsufficientPrecision exception. <br />
<br />
<br />
==[ ex-RingFloat3.C ]==<br />
Program showing how some RingFloat values can have more precision <br />
than that requested. <br />
<br />
=== long description ===<br />
Example showing that certain RingFloat values may have a precision <br />
higher than that requested. In this case we request 64 bits (i.e. <br />
about 19 decimal digits), but are able to remove the nine most <br />
significant digits and still have a result with the requested precision.<br />
So the original value of the variable third did in fact have at <br />
least 93 bits correct (i.e. about 28 decimal digits). <br />
<br />
<br />
==[ ex-RingFp1.C ]==<br />
Inefficient program to compute sqrt(2) modulo a given number. <br />
Simple example using finite fields or integers modulo N.<br />
<br />
=== long description ===<br />
The program asks the user for the value of N, it creates the <br />
ring of integers mod N, and finally uses "brute force" to find <br />
all square-roots of 2 modulo N. <br />
<br />
<br />
==[ ex-RingFp2.C ]==<br />
Example program showing how to create small prime finite fields <br />
implemented in a specific manner -- normally it is best to let <br />
the function NewZmod choose automatically the best implementation. <br />
<br />
=== long description ===<br />
The program asks the user for the characteristic N, and then tries <br />
different ways of making Z mod N.<br />
<br />
<br />
==[ ex-PPMonoidElem1.C ]==<br />
Example of use of power products and PPMonoids. <br />
Program exhibiting most functions on power products.<br />
<br />
==[ ex-RingElem1.C ]==<br />
Example showing operations on RingElem for a ring or a PolyRing.<br />
<br />
=== long description ===<br />
This is a long list of function calls from different rings. <br />
<br />
<br />
==[ ex-RingHom1.C ]==<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. <br />
<br />
=== long description ===<br />
We compute these polynomials (with parameters) in some rings: <br />
f = (2*a/3-1)*x[0] + 1/a; g = x[0]-a; <br />
<br />
<br />
==[ ex-RingHom2.C ]==<br />
Operations between elements of different rings are not allowed <br />
but we can use homomorphisms to map the elements into the <br />
same ring. <br />
<br />
=== long description ===<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. In particular, it gives a simple <br />
example of mixed ring arithmetic: the user must map all values <br />
into a single ring before combining them arithmetically. <br />
<br />
<br />
==[ ex-RingHom3.C ]==<br />
This program shows how we can use ring homomorphism <br />
to perform a change of coordinates in a polynomial ring. <br />
<br />
==[ ex-RingHom4.C ]==<br />
This program shows how we can use ring homomorphism <br />
to evaluate polynomials. <br />
<br />
==[ ex-matrix1.C ]==<br />
Example program illustrating the creation of matrices, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the matrix code is still rather young. <br />
<br />
<br />
==[ ex-module1.C ]==<br />
Example program illustrating the creation of free modules, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the module code is still rather young. <br />
<br />
<br />
==[ ex-PolyInput1.C ]==<br />
This program shows a way to read a polynomial from the input.<br />
<br />
==[ ex-OrderingGrading1.C ]==<br />
predefined and user-defined orderings and gradings <br />
on PPMonoid and PolyRing. <br />
<br />
=== long description ===<br />
Each ordering is degree-compatible with grading over Z^GradingDim <br />
i.e. the grading is given by the first GradingDim rows <br />
of the ordering matrix. <br />
<br />
<br />
==[ ex-GMPAllocator.C ]==<br />
Program to find lengths of 3n+1 sequences. (uses CoCoA::GMPAllocator) <br />
<br />
=== long description ===<br />
This example shows how a CoCoA::GMPAllocator can be used. If you do <br />
computations involving many small big-integers (up to about 40 decimal <br />
digits) then the custom allocator may give slightly better run-time <br />
performance -- you must compile with debugging turned off! <br />
The crucial command is the very first line of "program" just comment it <br />
out and recompile to use the default system allocator for GMP values. <br />
<br />
<br />
==[ ex-PolyIterator1.C ]==<br />
Program showing how to iterate through "sparse" polynomials.<br />
<br />
==[ ex-PolyIterator2.C ]==<br />
Program showing how to homogenize a sparse polynomial using iterators.<br />
<br />
=== long description ===<br />
This is just an example! If you want to homogenize polynomials <br />
you should use the library function "homog". <br />
<br />
<br />
==[ ex-NF.C ]==<br />
Example program illustrating an implementation of Normal Remainder <br />
wrt a list of polynomials. <br />
If the list is a Groebner Basis, NR returns the Normal Form. <br />
<br />
=== long description ===<br />
This is just an example! If you want to compute Normal Forms <br />
you should use the library function "NF". <br />
<br />
<br />
==[ ex-PolyRing1.C ]==<br />
Example of how to create some simple polynomial rings, and use of some <br />
of the operations specific to elements of PolyRings.<br />
<br />
==[ ex-ApproxPts1.C ]==<br />
A short example showing how to use the ApproxPt preprocessing algorithms.<br />
See the file ex-ApproxPt1.in for a sample input.<br />
<br />
==[ ex-AlexanderDual.C ]==<br />
Program showing how to compute the Alexander Dual of a mon'l sqfr ideal.<br />
<br />
=== long description ===<br />
It offers the function "PrimaryDecomposition" for a mon'l sqfr ideal<br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-QuotientBasis.C ]==<br />
Program showing how to compute a quotient basis of a 0-dimensional ideal.<br />
<br />
=== long description ===<br />
It offers the function "QuotientBasisRec" <br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-hilbert1.C ]==<br />
This example is just for testing the Hilbert code. <br />
It might disappear as soon as HilbertSeries is included in CoCoALib. <br />
<br />
==[ ex-RingWeyl1.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
All these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl2.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl3.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl4.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl5.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-FGLM.C ]==<br />
Example of how to use the implementation of the <br />
FGLM algorithm to do Groebner Basis conversion. <br />
<br />
==[ ex-OrderIdeal.C ]==<br />
Example of how to use the [OrderIdeal] CoCoALib class.<br />
<br />
==[ ex-BorderBasis.C ]==<br />
Example of how to use the implementation of the <br />
Border Basis Algorithm to compute a O_\sigma{Id(gens)}-border basis.<br />
<br />
<br />
<br />
<br />
[[Category:CoCoALib]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoALib:Examples&diff=4149CoCoALib:Examples2007-02-12T14:43:18Z<p>Bigatti: </p>
<hr />
<div>DO NOT EDIT UNDER THIS LINE (automatically generated).<br />
Send edits and comments to Anna Bigatti.<br />
<br />
----<br />
<br />
<br />
==[ ex-empty.C ]==<br />
This is a template file for example programs. <br />
The program itself does nothing whatsoever. <br />
<br />
=== long description ===<br />
Make a copy of this file and put your code in "program" <br />
<br />
<br />
==[ ex-BuildInfo.C ]==<br />
This is a very short example showing what you can do with BuildInfo. <br />
<br />
=== long description ===<br />
BuildInfo::PrintAll gives important information in the (enormously <br />
unlikely :-) event that you need to report a bug in CoCoALib. <br />
<br />
<br />
==[ ex-ZZ1.C ]==<br />
Program to calculate the modular inverse of a number. <br />
You must give as input the modulus and the residue; <br />
the residue need not be reduced. <br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
Contrast this example with ex-RingZ1. <br />
<br />
<br />
==[ ex-ZZ-prime1.C ]==<br />
Program to find a 'big' prime number, suitable for use in <br />
cryptographic applications (with some more primality testing).<br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
It shows use of some more advanced functions for ZZ values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
<br />
<br />
==[ ex-ring1.C ]==<br />
This example program shows how to create various types of ring, and <br />
several operations one can perform on rings (e.g. querying their <br />
properties).<br />
<br />
=== long description ===<br />
It creates several different sorts of ring, <br />
and then calls PrintRingInfo on each one. <br />
Note the considerable overhead needed to create a (non-standard) PolyRing:<br />
first you must make a PPOrdering, <br />
then you must make a PPMonoid from that ordering, <br />
and finally you can make a PolyRing. <br />
The tedious part is specifying the names of the indeterminates. <br />
We hope to make this less cumbersome soon. <br />
<br />
<br />
==[ ex-RingZ1.C ]==<br />
This is a basic example about the creation and use of the ring of integers.<br />
It illustrates the CoCoALib "philosophy" of first creating a ring, and <br />
then computing with values in that ring. <br />
The C++ commands for performing arithmetic on RingElems have a natural <br />
syntax (except we cannot use ^ for powers). <br />
It warns about "mixed ring arithmetic", which is forbidden in CoCoALib. <br />
<br />
=== long description ===<br />
To calculate with elements of a ring we must first create the <br />
the ring, then we can create C++ objects of type RingElem which <br />
belong to the ring -- a RingElem can change its value but not <br />
the ring to which it belongs. <br />
<br />
<br />
==[ ex-RingQ1.C ]==<br />
Some simple computations with rational numbers. <br />
This example illustrates how to create the field of rational numbers. <br />
It shows that we can compute 7/2 in Q but not in Z. <br />
It shows how to map an integer into a rational number. <br />
<br />
=== long description ===<br />
Familiarize yourself with the example ex-RingZ1.C before proceeding. <br />
As C++ does not natively have any rings, we must construct them from <br />
scratch. <br />
<br />
<br />
==[ ex-RingFloat1.C ]==<br />
Example showing some features of RingFloat.<br />
Program to explore the precision offered by RingFloat<br />
<br />
==[ ex-RingFloat2.C ]==<br />
Program exhibiting a way of using ever higher precisions...<br />
<br />
=== long description ===<br />
Example showing iterative increase of precision using RingFloat until <br />
the answer is found (or an arbitrary limit on precision is reached). <br />
This program will always fail to find the limit: J-M Muller's sequence <br />
actually converges to 6 (rather slowly), however it is pathological <br />
because it converges to 100 using any finite precision arithmetic. <br />
RingFloat detects the onset of pathological convergence to 100, and <br />
throws an InsufficientPrecision exception. <br />
<br />
<br />
==[ ex-RingFloat3.C ]==<br />
Program showing how some RingFloat values can have more precision <br />
than that requested. <br />
<br />
=== long description ===<br />
Example showing that certain RingFloat values may have a precision <br />
higher than that requested. In this case we request 64 bits (i.e. <br />
about 19 decimal digits), but are able to remove the nine most <br />
significant digits and still have a result with the requested precision.<br />
So the original value of the variable third did in fact have at <br />
least 93 bits correct (i.e. about 28 decimal digits). <br />
<br />
<br />
==[ ex-RingFp1.C ]==<br />
Inefficient program to compute sqrt(2) modulo a given number. <br />
Simple example using finite fields or integers modulo N.<br />
<br />
=== long description ===<br />
The program asks the user for the value of N, it creates the <br />
ring of integers mod N, and finally uses "brute force" to find <br />
all square-roots of 2 modulo N. <br />
<br />
<br />
==[ ex-RingFp2.C ]==<br />
Example program showing how to create small prime finite fields <br />
implemented in a specific manner -- normally it is best to let <br />
the function NewZmod choose automatically the best implementation. <br />
<br />
=== long description ===<br />
The program asks the user for the characteristic N, and then tries <br />
different ways of making Z mod N.<br />
<br />
<br />
==[ ex-PPMonoidElem1.C ]==<br />
Example of use of power products and PPMonoids. <br />
Program exhibiting most functions on power products.<br />
<br />
==[ ex-RingElem1.C ]==<br />
Example showing operations on RingElem for a ring or a PolyRing.<br />
<br />
=== long description ===<br />
This is a long list of function calls from different rings. <br />
<br />
<br />
==[ ex-RingHom1.C ]==<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. <br />
<br />
=== long description ===<br />
We compute these polynomials (with parameters) in some rings: <br />
f = (2*a/3-1)*x[0] + 1/a; g = x[0]-a; <br />
<br />
<br />
==[ ex-RingHom2.C ]==<br />
Operations between elements of different rings are not allowed <br />
but we can use homomorphisms to map the elements into the <br />
same ring. <br />
<br />
=== long description ===<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. In particular, it gives a simple <br />
example of mixed ring arithmetic: the user must map all values <br />
into a single ring before combining them arithmetically. <br />
<br />
<br />
==[ ex-RingHom3.C ]==<br />
This program shows how we can use ring homomorphism <br />
to perform a change of coordinates in a polynomial ring. <br />
<br />
==[ ex-RingHom4.C ]==<br />
This program shows how we can use ring homomorphism <br />
to evaluate polynomials. <br />
<br />
==[ ex-matrix1.C ]==<br />
Example program illustrating the creation of matrices, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the matrix code is still rather young. <br />
<br />
<br />
==[ ex-module1.C ]==<br />
Example program illustrating the creation of free modules, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the module code is still rather young. <br />
<br />
<br />
==[ ex-PolyInput1.C ]==<br />
This program shows a way to read a polynomial from the input.<br />
<br />
==[ ex-OrderingGrading1.C ]==<br />
predefined and user-defined orderings and gradings <br />
on PPMonoid and PolyRing. <br />
<br />
=== long description ===<br />
Each ordering is degree-compatible with grading over Z^GradingDim <br />
i.e. the grading is given by the first GradingDim rows <br />
of the ordering matrix. <br />
<br />
<br />
==[ ex-GMPAllocator.C ]==<br />
Program to find lengths of 3n+1 sequences. (uses CoCoA::GMPAllocator) <br />
<br />
=== long description ===<br />
This example shows how a CoCoA::GMPAllocator can be used. If you do <br />
computations involving many small big-integers (up to about 40 decimal <br />
digits) then the custom allocator may give slightly better run-time <br />
performance -- you must compile with debugging turned off! <br />
The crucial command is the very first line of "program" just comment it <br />
out and recompile to use the default system allocator for GMP values. <br />
<br />
<br />
==[ ex-PolyIterator1.C ]==<br />
Program showing how to iterate through "sparse" polynomials.<br />
<br />
==[ ex-PolyIterator2.C ]==<br />
Program showing how to homogenize a sparse polynomial using iterators.<br />
<br />
=== long description ===<br />
This is just an example! If you want to homogenize polynomials <br />
you should use the library function "homog". <br />
<br />
<br />
==[ ex-NF.C ]==<br />
Example program illustrating an implementation of Normal Remainder <br />
wrt a list of polynomials. <br />
If the list is a Groebner Basis, NR returns the Normal Form. <br />
<br />
=== long description ===<br />
This is just an example! If you want to compute Normal Forms <br />
you should use the library function "NF". <br />
<br />
<br />
==[ ex-PolyRing1.C ]==<br />
Example of how to create some simple polynomial rings, and use of some <br />
of the operations specific to elements of PolyRings.<br />
<br />
==[ ex-ApproxPts1.C ]==<br />
A short example showing how to use the ApproxPt preprocessing algorithms.<br />
See the file ex-ApproxPt1.in for a sample input.<br />
<br />
==[ ex-AlexanderDual.C ]==<br />
Program showing how to compute the Alexander Dual of a mon'l sqfr ideal.<br />
<br />
=== long description ===<br />
It offers the function "PrimaryDecomposition" for a mon'l sqfr ideal<br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-QuotientBasis.C ]==<br />
Program showing how to compute a quotient basis of a 0-dimensional ideal.<br />
<br />
=== long description ===<br />
It offers the function "QuotientBasisRec" <br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-hilbert1.C ]==<br />
This example is just for testing the Hilbert code. <br />
It might disappear as soon as HilbertSeries is included in CoCoALib. <br />
<br />
==[ ex-RingWeyl1.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
All these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl2.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl3.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl4.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl5.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-FGLM.C ]==<br />
Example of how to use the implementation of the <br />
FGLM algorithm to do Groebner Basis conversion. <br />
<br />
==[ ex-OrderIdeal.C ]==<br />
Example of how to use the [OrderIdeal] CoCoALib class.<br />
<br />
==[ ex-BorderBasis.C ]==<br />
Example of how to use the implementation of the <br />
Border Basis Algorithm to compute a O_\sigma{Id(gens)}-border basis.<br />
<br />
<br />
<br />
<br />
[[Category:CoCoALib]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoALib:Examples&diff=4147CoCoALib:Examples2007-02-12T14:14:40Z<p>Bigatti: </p>
<hr />
<div> DO NOT EDIT THIS FILE.<br />
AUTOMATICALLY GENERATED.<br />
SEND EDITS AND COMMENT TO ANNA BIGATTI<br />
<br />
==[ ex-empty.C ]==<br />
This is a template file for example programs. <br />
The program itself does nothing whatsoever. <br />
<br />
=== long description ===<br />
Make a copy of this file and put your code in "program" <br />
<br />
<br />
==[ ex-BuildInfo.C ]==<br />
This is a very short example showing what you can do with BuildInfo. <br />
<br />
=== long description ===<br />
BuildInfo::PrintAll gives important information in the (enormously <br />
unlikely :-) event that you need to report a bug in CoCoALib. <br />
<br />
<br />
==[ ex-ZZ1.C ]==<br />
Program to calculate the modular inverse of a number. <br />
You must give as input the modulus and the residue; <br />
the residue need not be reduced. <br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
Contrast this example with ex-RingZ1. <br />
<br />
<br />
==[ ex-ZZ-prime1.C ]==<br />
Program to find a 'big' prime number, suitable for use in <br />
cryptographic applications (with some more primality testing).<br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
It shows use of some more advanced functions for ZZ values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
<br />
<br />
==[ ex-ring1.C ]==<br />
This example program shows how to create various types of ring, and <br />
several operations one can perform on rings (e.g. querying their <br />
properties).<br />
<br />
=== long description ===<br />
It creates several different sorts of ring, <br />
and then calls PrintRingInfo on each one. <br />
Note the considerable overhead needed to create a (non-standard) PolyRing:<br />
first you must make a PPOrdering, <br />
then you must make a PPMonoid from that ordering, <br />
and finally you can make a PolyRing. <br />
The tedious part is specifying the names of the indeterminates. <br />
We hope to make this less cumbersome soon. <br />
<br />
<br />
==[ ex-RingZ1.C ]==<br />
This is a basic example about the creation and use of the ring of integers.<br />
It illustrates the CoCoALib "philosophy" of first creating a ring, and <br />
then computing with values in that ring. <br />
The C++ commands for performing arithmetic on RingElems have a natural <br />
syntax (except we cannot use ^ for powers). <br />
It warns about "mixed ring arithmetic", which is forbidden in CoCoALib. <br />
<br />
=== long description ===<br />
To calculate with elements of a ring we must first create the <br />
the ring, then we can create C++ objects of type RingElem which <br />
belong to the ring -- a RingElem can change its value but not <br />
the ring to which it belongs. <br />
<br />
<br />
==[ ex-RingQ1.C ]==<br />
Some simple computations with rational numbers. <br />
This example illustrates how to create the field of rational numbers. <br />
It shows that we can compute 7/2 in Q but not in Z. <br />
It shows how to map an integer into a rational number. <br />
<br />
=== long description ===<br />
Familiarize yourself with the example ex-RingZ1.C before proceeding. <br />
As C++ does not natively have any rings, we must construct them from <br />
scratch. <br />
<br />
<br />
==[ ex-RingFloat1.C ]==<br />
Example showing some features of RingFloat.<br />
Program to explore the precision offered by RingFloat<br />
<br />
==[ ex-RingFloat2.C ]==<br />
Program exhibiting a way of using ever higher precisions...<br />
<br />
=== long description ===<br />
Example showing iterative increase of precision using RingFloat until <br />
the answer is found (or an arbitrary limit on precision is reached). <br />
This program will always fail to find the limit: J-M Muller's sequence <br />
actually converges to 6 (rather slowly), however it is pathological <br />
because it converges to 100 using any finite precision arithmetic. <br />
RingFloat detects the onset of pathological convergence to 100, and <br />
throws an InsufficientPrecision exception. <br />
<br />
<br />
==[ ex-RingFloat3.C ]==<br />
Program showing how some RingFloat values can have more precision <br />
than that requested. <br />
<br />
=== long description ===<br />
Example showing that certain RingFloat values may have a precision <br />
higher than that requested. In this case we request 64 bits (i.e. <br />
about 19 decimal digits), but are able to remove the nine most <br />
significant digits and still have a result with the requested precision.<br />
So the original value of the variable third did in fact have at <br />
least 93 bits correct (i.e. about 28 decimal digits). <br />
<br />
<br />
==[ ex-RingFp1.C ]==<br />
Inefficient program to compute sqrt(2) modulo a given number. <br />
Simple example using finite fields or integers modulo N.<br />
<br />
=== long description ===<br />
The program asks the user for the value of N, it creates the <br />
ring of integers mod N, and finally uses "brute force" to find <br />
all square-roots of 2 modulo N. <br />
<br />
<br />
==[ ex-RingFp2.C ]==<br />
Example program showing how to create small prime finite fields <br />
implemented in a specific manner -- normally it is best to let <br />
the function NewZmod choose automatically the best implementation. <br />
<br />
=== long description ===<br />
The program asks the user for the characteristic N, and then tries <br />
different ways of making Z mod N.<br />
<br />
<br />
==[ ex-PPMonoidElem1.C ]==<br />
Example of use of power products and PPMonoids. <br />
Program exhibiting most functions on power products.<br />
<br />
==[ ex-RingElem1.C ]==<br />
Example showing operations on RingElem for a ring or a PolyRing.<br />
<br />
=== long description ===<br />
This is a long list of function calls from different rings. <br />
<br />
<br />
==[ ex-RingHom1.C ]==<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. <br />
<br />
=== long description ===<br />
We compute these polynomials (with parameters) in some rings: <br />
f = (2*a/3-1)*x[0] + 1/a; g = x[0]-a; <br />
<br />
<br />
==[ ex-RingHom2.C ]==<br />
Operations between elements of different rings are not allowed <br />
but we can use homomorphisms to map the elements into the <br />
same ring. <br />
<br />
=== long description ===<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. In particular, it gives a simple <br />
example of mixed ring arithmetic: the user must map all values <br />
into a single ring before combining them arithmetically. <br />
<br />
<br />
==[ ex-RingHom3.C ]==<br />
This program shows how we can use ring homomorphism <br />
to perform a change of coordinates in a polynomial ring. <br />
<br />
==[ ex-RingHom4.C ]==<br />
This program shows how we can use ring homomorphism <br />
to evaluate polynomials. <br />
<br />
==[ ex-matrix1.C ]==<br />
Example program illustrating the creation of matrices, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the matrix code is still rather young. <br />
<br />
<br />
==[ ex-module1.C ]==<br />
Example program illustrating the creation of free modules, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the module code is still rather young. <br />
<br />
<br />
==[ ex-PolyInput1.C ]==<br />
This program shows a way to read a polynomial from the input.<br />
<br />
==[ ex-OrderingGrading1.C ]==<br />
predefined and user-defined orderings and gradings <br />
on PPMonoid and PolyRing. <br />
<br />
=== long description ===<br />
Each ordering is degree-compatible with grading over Z^GradingDim <br />
i.e. the grading is given by the first GradingDim rows <br />
of the ordering matrix. <br />
<br />
<br />
==[ ex-GMPAllocator.C ]==<br />
Program to find lengths of 3n+1 sequences. (uses CoCoA::GMPAllocator) <br />
<br />
=== long description ===<br />
This example shows how a CoCoA::GMPAllocator can be used. If you do <br />
computations involving many small big-integers (up to about 40 decimal <br />
digits) then the custom allocator may give slightly better run-time <br />
performance -- you must compile with debugging turned off! <br />
The crucial command is the very first line of "program" just comment it <br />
out and recompile to use the default system allocator for GMP values. <br />
<br />
<br />
==[ ex-PolyIterator1.C ]==<br />
Program showing how to iterate through "sparse" polynomials.<br />
<br />
==[ ex-PolyIterator2.C ]==<br />
Program showing how to homogenize a sparse polynomial using iterators.<br />
<br />
=== long description ===<br />
This is just an example! If you want to homogenize polynomials <br />
you should use the library function "homog". <br />
<br />
<br />
==[ ex-NF.C ]==<br />
Example program illustrating an implementation of Normal Remainder <br />
wrt a list of polynomials. <br />
If the list is a Groebner Basis, NR returns the Normal Form. <br />
<br />
=== long description ===<br />
This is just an example! If you want to compute Normal Forms <br />
you should use the library function "NF". <br />
<br />
<br />
==[ ex-PolyRing1.C ]==<br />
Example of how to create some simple polynomial rings, and use of some <br />
of the operations specific to elements of PolyRings.<br />
<br />
==[ ex-ApproxPts1.C ]==<br />
A short example showing how to use the ApproxPt preprocessing algorithms.<br />
See the file ex-ApproxPt1.in for a sample input.<br />
<br />
==[ ex-AlexanderDual.C ]==<br />
Program showing how to compute the Alexander Dual of a mon'l sqfr ideal.<br />
<br />
=== long description ===<br />
It offers the function "PrimaryDecomposition" for a mon'l sqfr ideal<br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-QuotientBasis.C ]==<br />
Program showing how to compute a quotient basis of a 0-dimensional ideal.<br />
<br />
=== long description ===<br />
It offers the function "QuotientBasisRec" <br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-hilbert1.C ]==<br />
This example is just for testing the Hilbert code. <br />
It might disappear as soon as HilbertSeries is included in CoCoALib. <br />
<br />
==[ ex-RingWeyl1.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
All these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl2.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl3.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl4.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl5.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-FGLM.C ]==<br />
Example of how to use the implementation of the <br />
FGLM algorithm to do Groebner Basis conversion. <br />
<br />
==[ ex-OrderIdeal.C ]==<br />
Example of how to use the [OrderIdeal] CoCoALib class.<br />
<br />
==[ ex-BorderBasis.C ]==<br />
Example of how to use the implementation of the <br />
Border Basis Algorithm to compute a O_\sigma{Id(gens)}-border basis.<br />
<br />
<br />
<br />
<br />
[[Category:CoCoALib]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoALib:Examples&diff=4145CoCoALib:Examples2007-02-12T14:10:57Z<p>Bigatti: CoCoALibExamples moved to Examples-CoCoALib: Stands out better in index</p>
<hr />
<div>==[ ex-empty.C ]==<br />
This is a template file for example programs. <br />
The program itself does nothing whatsoever. <br />
<br />
=== long description ===<br />
Make a copy of this file and put your code in "program" <br />
<br />
<br />
==[ ex-BuildInfo.C ]==<br />
This is a very short example showing what you can do with BuildInfo. <br />
<br />
=== long description ===<br />
BuildInfo::PrintAll gives important information in the (enormously <br />
unlikely :-) event that you need to report a bug in CoCoALib. <br />
<br />
<br />
==[ ex-ZZ1.C ]==<br />
Program to calculate the modular inverse of a number. <br />
You must give as input the modulus and the residue; <br />
the residue need not be reduced. <br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
Contrast this example with ex-RingZ1. <br />
<br />
<br />
==[ ex-ZZ-prime1.C ]==<br />
Program to find a 'big' prime number, suitable for use in <br />
cryptographic applications (with some more primality testing).<br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
It shows use of some more advanced functions for ZZ values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
<br />
<br />
==[ ex-ring1.C ]==<br />
This example program shows how to create various types of ring, and <br />
several operations one can perform on rings (e.g. querying their <br />
properties).<br />
<br />
=== long description ===<br />
It creates several different sorts of ring, <br />
and then calls PrintRingInfo on each one. <br />
Note the considerable overhead needed to create a (non-standard) PolyRing:<br />
first you must make a PPOrdering, <br />
then you must make a PPMonoid from that ordering, <br />
and finally you can make a PolyRing. <br />
The tedious part is specifying the names of the indeterminates. <br />
We hope to make this less cumbersome soon. <br />
<br />
<br />
==[ ex-RingZ1.C ]==<br />
This is a basic example about the creation and use of the ring of integers.<br />
It illustrates the CoCoALib "philosophy" of first creating a ring, and <br />
then computing with values in that ring. <br />
The C++ commands for performing arithmetic on RingElems have a natural <br />
syntax (except we cannot use ^ for powers). <br />
It warns about "mixed ring arithmetic", which is forbidden in CoCoALib. <br />
<br />
=== long description ===<br />
To calculate with elements of a ring we must first create the <br />
the ring, then we can create C++ objects of type RingElem which <br />
belong to the ring -- a RingElem can change its value but not <br />
the ring to which it belongs. <br />
<br />
<br />
==[ ex-RingQ1.C ]==<br />
Some simple computations with rational numbers. <br />
This example illustrates how to create the field of rational numbers. <br />
It shows that we can compute 7/2 in Q but not in Z. <br />
It shows how to map an integer into a rational number. <br />
<br />
=== long description ===<br />
Familiarize yourself with the example ex-RingZ1.C before proceeding. <br />
As C++ does not natively have any rings, we must construct them from <br />
scratch. <br />
<br />
<br />
==[ ex-RingFloat1.C ]==<br />
Example showing some features of RingFloat.<br />
Program to explore the precision offered by RingFloat<br />
<br />
==[ ex-RingFloat2.C ]==<br />
Program exhibiting a way of using ever higher precisions...<br />
<br />
=== long description ===<br />
Example showing iterative increase of precision using RingFloat until <br />
the answer is found (or an arbitrary limit on precision is reached). <br />
This program will always fail to find the limit: J-M Muller's sequence <br />
actually converges to 6 (rather slowly), however it is pathological <br />
because it converges to 100 using any finite precision arithmetic. <br />
RingFloat detects the onset of pathological convergence to 100, and <br />
throws an InsufficientPrecision exception. <br />
<br />
<br />
==[ ex-RingFloat3.C ]==<br />
Program showing how some RingFloat values can have more precision <br />
than that requested. <br />
<br />
=== long description ===<br />
Example showing that certain RingFloat values may have a precision <br />
higher than that requested. In this case we request 64 bits (i.e. <br />
about 19 decimal digits), but are able to remove the nine most <br />
significant digits and still have a result with the requested precision.<br />
So the original value of the variable third did in fact have at <br />
least 93 bits correct (i.e. about 28 decimal digits). <br />
<br />
<br />
==[ ex-RingFp1.C ]==<br />
Inefficient program to compute sqrt(2) modulo a given number. <br />
Simple example using finite fields or integers modulo N.<br />
<br />
=== long description ===<br />
The program asks the user for the value of N, it creates the <br />
ring of integers mod N, and finally uses "brute force" to find <br />
all square-roots of 2 modulo N. <br />
<br />
<br />
==[ ex-RingFp2.C ]==<br />
Example program showing how to create small prime finite fields <br />
implemented in a specific manner -- normally it is best to let <br />
the function NewZmod choose automatically the best implementation. <br />
<br />
=== long description ===<br />
The program asks the user for the characteristic N, and then tries <br />
different ways of making Z mod N.<br />
<br />
<br />
==[ ex-PPMonoidElem1.C ]==<br />
Example of use of power products and PPMonoids. <br />
Program exhibiting most functions on power products.<br />
<br />
==[ ex-RingElem1.C ]==<br />
Example showing operations on RingElem for a ring or a PolyRing.<br />
<br />
=== long description ===<br />
This is a long list of function calls from different rings. <br />
<br />
<br />
==[ ex-RingHom1.C ]==<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. <br />
<br />
=== long description ===<br />
We compute these polynomials (with parameters) in some rings: <br />
f = (2*a/3-1)*x[0] + 1/a; g = x[0]-a; <br />
<br />
<br />
==[ ex-RingHom2.C ]==<br />
Operations between elements of different rings are not allowed <br />
but we can use homomorphisms to map the elements into the <br />
same ring. <br />
<br />
=== long description ===<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. In particular, it gives a simple <br />
example of mixed ring arithmetic: the user must map all values <br />
into a single ring before combining them arithmetically. <br />
<br />
<br />
==[ ex-RingHom3.C ]==<br />
This program shows how we can use ring homomorphism <br />
to perform a change of coordinates in a polynomial ring. <br />
<br />
==[ ex-RingHom4.C ]==<br />
This program shows how we can use ring homomorphism <br />
to evaluate polynomials. <br />
<br />
==[ ex-matrix1.C ]==<br />
Example program illustrating the creation of matrices, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the matrix code is still rather young. <br />
<br />
<br />
==[ ex-module1.C ]==<br />
Example program illustrating the creation of free modules, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the module code is still rather young. <br />
<br />
<br />
==[ ex-PolyInput1.C ]==<br />
This program shows a way to read a polynomial from the input.<br />
<br />
==[ ex-OrderingGrading1.C ]==<br />
predefined and user-defined orderings and gradings <br />
on PPMonoid and PolyRing. <br />
<br />
=== long description ===<br />
Each ordering is degree-compatible with grading over Z^GradingDim <br />
i.e. the grading is given by the first GradingDim rows <br />
of the ordering matrix. <br />
<br />
<br />
==[ ex-GMPAllocator.C ]==<br />
Program to find lengths of 3n+1 sequences. (uses CoCoA::GMPAllocator) <br />
<br />
=== long description ===<br />
This example shows how a CoCoA::GMPAllocator can be used. If you do <br />
computations involving many small big-integers (up to about 40 decimal <br />
digits) then the custom allocator may give slightly better run-time <br />
performance -- you must compile with debugging turned off! <br />
The crucial command is the very first line of "program" just comment it <br />
out and recompile to use the default system allocator for GMP values. <br />
<br />
<br />
==[ ex-PolyIterator1.C ]==<br />
Program showing how to iterate through "sparse" polynomials.<br />
<br />
==[ ex-PolyIterator2.C ]==<br />
Program showing how to homogenize a sparse polynomial using iterators.<br />
<br />
=== long description ===<br />
This is just an example! If you want to homogenize polynomials <br />
you should use the library function "homog". <br />
<br />
<br />
==[ ex-NF.C ]==<br />
Example program illustrating an implementation of Normal Remainder <br />
wrt a list of polynomials. <br />
If the list is a Groebner Basis, NR returns the Normal Form. <br />
<br />
=== long description ===<br />
This is just an example! If you want to compute Normal Forms <br />
you should use the library function "NF". <br />
<br />
<br />
==[ ex-PolyRing1.C ]==<br />
Example of how to create some simple polynomial rings, and use of some <br />
of the operations specific to elements of PolyRings.<br />
<br />
==[ ex-ApproxPts1.C ]==<br />
A short example showing how to use the ApproxPt preprocessing algorithms.<br />
See the file ex-ApproxPt1.in for a sample input.<br />
<br />
==[ ex-AlexanderDual.C ]==<br />
Program showing how to compute the Alexander Dual of a mon'l sqfr ideal.<br />
<br />
=== long description ===<br />
It offers the function "PrimaryDecomposition" for a mon'l sqfr ideal<br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-QuotientBasis.C ]==<br />
Program showing how to compute a quotient basis of a 0-dimensional ideal.<br />
<br />
=== long description ===<br />
It offers the function "QuotientBasisRec" <br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-hilbert1.C ]==<br />
This example is just for testing the Hilbert code. <br />
It might disappear as soon as HilbertSeries is included in CoCoALib. <br />
<br />
==[ ex-RingWeyl1.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
All these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl2.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl3.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl4.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl5.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-FGLM.C ]==<br />
Example of how to use the implementation of the <br />
FGLM algorithm to do Groebner Basis conversion. <br />
<br />
==[ ex-OrderIdeal.C ]==<br />
Example of how to use the [OrderIdeal] CoCoALib class.<br />
<br />
==[ ex-BorderBasis.C ]==<br />
Example of how to use the implementation of the <br />
Border Basis Algorithm to compute a O_\sigma{Id(gens)}-border basis.<br />
<br />
<br />
<br />
<br />
[[Category:CoCoALib]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoALib:Examples&diff=4144CoCoALib:Examples2007-02-12T14:08:48Z<p>Bigatti: </p>
<hr />
<div>==[ ex-empty.C ]==<br />
This is a template file for example programs. <br />
The program itself does nothing whatsoever. <br />
<br />
=== long description ===<br />
Make a copy of this file and put your code in "program" <br />
<br />
<br />
==[ ex-BuildInfo.C ]==<br />
This is a very short example showing what you can do with BuildInfo. <br />
<br />
=== long description ===<br />
BuildInfo::PrintAll gives important information in the (enormously <br />
unlikely :-) event that you need to report a bug in CoCoALib. <br />
<br />
<br />
==[ ex-ZZ1.C ]==<br />
Program to calculate the modular inverse of a number. <br />
You must give as input the modulus and the residue; <br />
the residue need not be reduced. <br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
Contrast this example with ex-RingZ1. <br />
<br />
<br />
==[ ex-ZZ-prime1.C ]==<br />
Program to find a 'big' prime number, suitable for use in <br />
cryptographic applications (with some more primality testing).<br />
<br />
=== long description ===<br />
This program illustrates that ZZ values can be used much like normal C++ ints <br />
except that there is a almost no limit on the magnitude of the values. <br />
It shows use of some more advanced functions for ZZ values. <br />
NB If you need extreme efficiency then use the GMP library directly. <br />
<br />
<br />
==[ ex-ring1.C ]==<br />
This example program shows how to create various types of ring, and <br />
several operations one can perform on rings (e.g. querying their <br />
properties).<br />
<br />
=== long description ===<br />
It creates several different sorts of ring, <br />
and then calls PrintRingInfo on each one. <br />
Note the considerable overhead needed to create a (non-standard) PolyRing:<br />
first you must make a PPOrdering, <br />
then you must make a PPMonoid from that ordering, <br />
and finally you can make a PolyRing. <br />
The tedious part is specifying the names of the indeterminates. <br />
We hope to make this less cumbersome soon. <br />
<br />
<br />
==[ ex-RingZ1.C ]==<br />
This is a basic example about the creation and use of the ring of integers.<br />
It illustrates the CoCoALib "philosophy" of first creating a ring, and <br />
then computing with values in that ring. <br />
The C++ commands for performing arithmetic on RingElems have a natural <br />
syntax (except we cannot use ^ for powers). <br />
It warns about "mixed ring arithmetic", which is forbidden in CoCoALib. <br />
<br />
=== long description ===<br />
To calculate with elements of a ring we must first create the <br />
the ring, then we can create C++ objects of type RingElem which <br />
belong to the ring -- a RingElem can change its value but not <br />
the ring to which it belongs. <br />
<br />
<br />
==[ ex-RingQ1.C ]==<br />
Some simple computations with rational numbers. <br />
This example illustrates how to create the field of rational numbers. <br />
It shows that we can compute 7/2 in Q but not in Z. <br />
It shows how to map an integer into a rational number. <br />
<br />
=== long description ===<br />
Familiarize yourself with the example ex-RingZ1.C before proceeding. <br />
As C++ does not natively have any rings, we must construct them from <br />
scratch. <br />
<br />
<br />
==[ ex-RingFloat1.C ]==<br />
Example showing some features of RingFloat.<br />
Program to explore the precision offered by RingFloat<br />
<br />
==[ ex-RingFloat2.C ]==<br />
Program exhibiting a way of using ever higher precisions...<br />
<br />
=== long description ===<br />
Example showing iterative increase of precision using RingFloat until <br />
the answer is found (or an arbitrary limit on precision is reached). <br />
This program will always fail to find the limit: J-M Muller's sequence <br />
actually converges to 6 (rather slowly), however it is pathological <br />
because it converges to 100 using any finite precision arithmetic. <br />
RingFloat detects the onset of pathological convergence to 100, and <br />
throws an InsufficientPrecision exception. <br />
<br />
<br />
==[ ex-RingFloat3.C ]==<br />
Program showing how some RingFloat values can have more precision <br />
than that requested. <br />
<br />
=== long description ===<br />
Example showing that certain RingFloat values may have a precision <br />
higher than that requested. In this case we request 64 bits (i.e. <br />
about 19 decimal digits), but are able to remove the nine most <br />
significant digits and still have a result with the requested precision.<br />
So the original value of the variable third did in fact have at <br />
least 93 bits correct (i.e. about 28 decimal digits). <br />
<br />
<br />
==[ ex-RingFp1.C ]==<br />
Inefficient program to compute sqrt(2) modulo a given number. <br />
Simple example using finite fields or integers modulo N.<br />
<br />
=== long description ===<br />
The program asks the user for the value of N, it creates the <br />
ring of integers mod N, and finally uses "brute force" to find <br />
all square-roots of 2 modulo N. <br />
<br />
<br />
==[ ex-RingFp2.C ]==<br />
Example program showing how to create small prime finite fields <br />
implemented in a specific manner -- normally it is best to let <br />
the function NewZmod choose automatically the best implementation. <br />
<br />
=== long description ===<br />
The program asks the user for the characteristic N, and then tries <br />
different ways of making Z mod N.<br />
<br />
<br />
==[ ex-PPMonoidElem1.C ]==<br />
Example of use of power products and PPMonoids. <br />
Program exhibiting most functions on power products.<br />
<br />
==[ ex-RingElem1.C ]==<br />
Example showing operations on RingElem for a ring or a PolyRing.<br />
<br />
=== long description ===<br />
This is a long list of function calls from different rings. <br />
<br />
<br />
==[ ex-RingHom1.C ]==<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. <br />
<br />
=== long description ===<br />
We compute these polynomials (with parameters) in some rings: <br />
f = (2*a/3-1)*x[0] + 1/a; g = x[0]-a; <br />
<br />
<br />
==[ ex-RingHom2.C ]==<br />
Operations between elements of different rings are not allowed <br />
but we can use homomorphisms to map the elements into the <br />
same ring. <br />
<br />
=== long description ===<br />
The example in this file shows how to create and use some <br />
homomorphisms between rings. In particular, it gives a simple <br />
example of mixed ring arithmetic: the user must map all values <br />
into a single ring before combining them arithmetically. <br />
<br />
<br />
==[ ex-RingHom3.C ]==<br />
This program shows how we can use ring homomorphism <br />
to perform a change of coordinates in a polynomial ring. <br />
<br />
==[ ex-RingHom4.C ]==<br />
This program shows how we can use ring homomorphism <br />
to evaluate polynomials. <br />
<br />
==[ ex-matrix1.C ]==<br />
Example program illustrating the creation of matrices, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the matrix code is still rather young. <br />
<br />
<br />
==[ ex-module1.C ]==<br />
Example program illustrating the creation of free modules, and some <br />
some operations on them. <br />
<br />
=== long description ===<br />
Please note that the module code is still rather young. <br />
<br />
<br />
==[ ex-PolyInput1.C ]==<br />
This program shows a way to read a polynomial from the input.<br />
<br />
==[ ex-OrderingGrading1.C ]==<br />
predefined and user-defined orderings and gradings <br />
on PPMonoid and PolyRing. <br />
<br />
=== long description ===<br />
Each ordering is degree-compatible with grading over Z^GradingDim <br />
i.e. the grading is given by the first GradingDim rows <br />
of the ordering matrix. <br />
<br />
<br />
==[ ex-GMPAllocator.C ]==<br />
Program to find lengths of 3n+1 sequences. (uses CoCoA::GMPAllocator) <br />
<br />
=== long description ===<br />
This example shows how a CoCoA::GMPAllocator can be used. If you do <br />
computations involving many small big-integers (up to about 40 decimal <br />
digits) then the custom allocator may give slightly better run-time <br />
performance -- you must compile with debugging turned off! <br />
The crucial command is the very first line of "program" just comment it <br />
out and recompile to use the default system allocator for GMP values. <br />
<br />
<br />
==[ ex-PolyIterator1.C ]==<br />
Program showing how to iterate through "sparse" polynomials.<br />
<br />
==[ ex-PolyIterator2.C ]==<br />
Program showing how to homogenize a sparse polynomial using iterators.<br />
<br />
=== long description ===<br />
This is just an example! If you want to homogenize polynomials <br />
you should use the library function "homog". <br />
<br />
<br />
==[ ex-NF.C ]==<br />
Example program illustrating an implementation of Normal Remainder <br />
wrt a list of polynomials. <br />
If the list is a Groebner Basis, NR returns the Normal Form. <br />
<br />
=== long description ===<br />
This is just an example! If you want to compute Normal Forms <br />
you should use the library function "NF". <br />
<br />
<br />
==[ ex-PolyRing1.C ]==<br />
Example of how to create some simple polynomial rings, and use of some <br />
of the operations specific to elements of PolyRings.<br />
<br />
==[ ex-ApproxPts1.C ]==<br />
A short example showing how to use the ApproxPt preprocessing algorithms.<br />
See the file ex-ApproxPt1.in for a sample input.<br />
<br />
==[ ex-AlexanderDual.C ]==<br />
Program showing how to compute the Alexander Dual of a mon'l sqfr ideal.<br />
<br />
=== long description ===<br />
It offers the function "PrimaryDecomposition" for a mon'l sqfr ideal<br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-QuotientBasis.C ]==<br />
Program showing how to compute a quotient basis of a 0-dimensional ideal.<br />
<br />
=== long description ===<br />
It offers the function "QuotientBasisRec" <br />
which will be included in CoCoALib (sooner or later).<br />
<br />
<br />
==[ ex-hilbert1.C ]==<br />
This example is just for testing the Hilbert code. <br />
It might disappear as soon as HilbertSeries is included in CoCoALib. <br />
<br />
==[ ex-RingWeyl1.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
All these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl2.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl3.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl4.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-RingWeyl5.C ]==<br />
An example about RingWeyl, the interface is not quite settled yet.<br />
<br />
=== long description ===<br />
This shows a computation of a Groebner BasisAll these examples about RingWeyl will probably be merged into one.<br />
<br />
<br />
==[ ex-FGLM.C ]==<br />
Example of how to use the implementation of the <br />
FGLM algorithm to do Groebner Basis conversion. <br />
<br />
==[ ex-OrderIdeal.C ]==<br />
Example of how to use the [OrderIdeal] CoCoALib class.<br />
<br />
==[ ex-BorderBasis.C ]==<br />
Example of how to use the implementation of the <br />
Border Basis Algorithm to compute a O_\sigma{Id(gens)}-border basis.<br />
<br />
<br />
<br />
<br />
[[Category:CoCoALib]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=Category:CoCoALib&diff=2690Category:CoCoALib2006-11-21T16:28:29Z<p>Bigatti: /* Contributions to the Library */</p>
<hr />
<div>==About==<br />
<br />
The CoCoALib is a C++ library, implementing all basic routines from CoCoA.<br />
It is licensed under the GPL-license and free to use.<br />
<br />
At the moment the library is still in an alpha release (the actual version is 0.92).<br />
If you want to become an alpha tester please mail to the developers of CoCoA and ask them<br />
and you will get access to the source code.<br />
<br />
To get an overview over the library please have a look at the [http://cocoa.dima.unige.it/cocoalib/doc/UserDox/inherits.html Class Diagram] of the library, or read the<br />
[[Libraries Overview]] article.<br />
<br />
==Supported Platforms ==<br />
The CoCoALib is tested on the following plattforms:<br />
* MacOSX 10.3 and 10.4 on PowerPC and x86 (using the g++ provided by Apple)<br />
* Linux running on x86, x86-64 and PPC (g++ or Intel C++)<br />
* Windows 2000, XP and 2003 on x86 (using MSVC 2003, MSVC 2005 or [http://www.cygwin.com/ Cygwin]) and x86-64 (using MSVC 2005)<br />
* Sun Solaris 9 on Sparc (using the Sun Forte Compiler or g++)<br />
<br />
All unix platforms that offer a gmp 4.1.4 or higher and a g++ of at least revision 3.2 should build the CoCoALib without problems.<br />
<br />
== Contributions to the Library==<br />
In case you want to contribute something (Code, Examples, Documentation or simply Bugfixes)<br />
please read the article [[Contribute to the Library]].<br />
In case you encounter any bugs or problems with the library please tell us, e.g.<br />
at the [http://cocoa.mathematik.uni-dortmund.de/forum/index.php CoCoA discussion board].<br />
<br />
== Development ==<br />
<br />
After the following link you will find a summary of who's currently doing what in CoCoALib (and some imminent tasks) [http://www.dima.unige.it/~abbott/CoCoALib-tasks.html CoCoALib Task Table]<br />
<br />
[[Category:CoCoA5]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=Main_Page&diff=2689Main Page2006-11-21T16:22:54Z<p>Bigatti: </p>
<hr />
<div>This is a Wiki about the computer algebra system CoCoA.<br />
<br />
'''[http://cocoa.dima.unige.it/ CoCoA]''' official web page<br />
<br />
'''[[:Category:CoCoA4|CoCoA 4]]''', '''[[:Category:CoCoAL|CoCoALanguage]]''', and '''[[:Category:HowTo|How To's]]'''<br />
<br />
'''[[:Category:CoCoA5|CoCoA 5]]''' and '''[[:Category:CoCoALib|CoCoALib]]'''<br />
<br />
A computer algebra system is a special software, that offers special mathematical methods to treat certain problems.<br />
There is a nice article about computer algera systems that can be found [http://en.wikipedia.org/wiki/Computer_algebra_system here].<br />
This article is part of [http://www.wikipedia.org Wikipedia] and contains a list of other computer algebra systems.<br />
<br />
[http://cocoa.dima.unige.it/ CoCoA] is being developed at the University of Genova (Italy).<br />
In addition to this wiki there is a [http://cocoa.mathematik.uni-dortmund.de/forum/ discussion board] for users of CoCoA and the [[:Category:CoCoALib|CoCoAlib]].<br />
<br />
At the moment there are two releases of CoCoA, namely [[:Category:CoCoA4|CoCoA 4]] and [[:Category:CoCoA5|CoCoA 5]]. You can also find some information about [[Releases|releases]] of CoCoA and its [[History|history]] here, as well as some [[:Category:HowTo|How To's]], describing how to solve special problems with CoCoA. Also, there is a list of articles, containing some [[:Category:documentation|documentation]] for the recent versions of CoCoA.<br />
<br />
Most versions of CoCoA have a graphical user interface, utilizing [[:Category:CoCoAL|CoCoALanguage]] as computing language. <br />
With [[:Category:CoCoALib|CoCoALib]], a C++ library, it is possible to use the CoCoA computing engine for the development of your own applications.</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=Category:CoCoA4&diff=2688Category:CoCoA42006-11-21T16:19:41Z<p>Bigatti: </p>
<hr />
<div>==About==<br />
<br />
CoCoA 4 is no longer in development, but is still being maintained. The current release is CoCoA 4.6.<br />
It can be downloaded at <br />
<br />
* [http://cocoa.dima.unige.it/download/ http://cocoa.dima.unige.it/download/]<br />
* [ftp://ftp.reed.edu/mirrors/cocoa/]<br />
<br />
CoCoA 4 uses and is programmed in [[:Category:CoCoAL|CoCoALanguage]].<br />
<br />
==Interfaces==<br />
<br />
There are three different CoCoA 4 clients:<br />
<br />
* cocoa-text: provides a bare bones interface. Most users won't use this version, but it can be useful when running computations in batch mode on a shell.<br />
* Emacs-plugin: provides an Emacs interfaces that is a lot more comfortable than the bare bones cocoa-text. This client is more popular with the Linux/MacOSX/Unix crowd.<br />
* cocoa-qt: provides a GUI written in Qt, multiple input windows and integrated html-help. This client is more popular with the Windows crowd. <br />
<br />
All clients use the same computing engince so you should get the same result regardless of the client. On certain corner cases the clients show different behauviour, i.e. very long strings (2Megabytes+) seem to upset certain version of Emacs, while the Qt-client can handle strings pretty much the size of your RAM and then some. Each client has its own limitations and strength, so use the one that you are comfortable with and does the job for you.<br />
<br />
==Supported Plattforms==<br />
<br />
At the moment the following operating systems are supported:<br />
<br />
* MacOSX<br />
* PowerPC running LinuxPPC<br />
* Pc running Linux<br />
* Pc running Windows<br />
* Sun<br />
* DEC Alpha workstations (version 4.2)<br />
* ARM (version 4.2)<br />
<br />
For some more information on currently available releases of CoCoA-4 check out the [http://cocoa.dima.unige.it/download/ dowload page] and [[CoCoA4 Builds]].</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=Main_Page&diff=2687Main Page2006-11-21T16:18:49Z<p>Bigatti: </p>
<hr />
<div>This is a Wiki about the computer algebra system CoCoA.<br />
<br />
'''[http://cocoa.dima.unige.it/ CoCoA]''' official web page.<br />
<br />
'''[[:Category:CoCoA4|CoCoA 4]]''' and '''[[:Category:CoCoAL|CoCoALanguage]]'''<br />
<br />
'''[[:Category:CoCoA5|CoCoA 5]]''' and '''[[:Category:CoCoALib|CoCoALib]]'''<br />
<br />
A computer algebra system is a special software, that offers special mathematical methods to treat certain problems.<br />
There is a nice article about computer algera systems that can be found [http://en.wikipedia.org/wiki/Computer_algebra_system here].<br />
This article is part of [http://www.wikipedia.org Wikipedia] and contains a list of other computer algebra systems.<br />
<br />
[http://cocoa.dima.unige.it/ CoCoA] is being developed at the University of Genova (Italy).<br />
In addition to this wiki there is a [http://cocoa.mathematik.uni-dortmund.de/forum/ discussion board] for users of CoCoA and the [[:Category:CoCoALib|CoCoAlib]].<br />
<br />
At the moment there are two releases of CoCoA, namely [[:Category:CoCoA4|CoCoA 4]] and [[:Category:CoCoA5|CoCoA 5]]. You can also find some information about [[Releases|releases]] of CoCoA and its [[History|history]] here, as well as some [[:Category:HowTo|How To's]], describing how to solve special problems with CoCoA. Also, there is a list of articles, containing some [[:Category:documentation|documentation]] for the recent versions of CoCoA.<br />
<br />
Most versions of CoCoA have a graphical user interface, utilizing [[:Category:CoCoAL|CoCoALanguage]] as computing language. <br />
With [[:Category:CoCoALib|CoCoALib]], a C++ library, it is possible to use the CoCoA computing engine for the development of your own applications.</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=Main_Page&diff=2686Main Page2006-11-21T16:18:07Z<p>Bigatti: </p>
<hr />
<div>This is a Wiki about the computer algebra system CoCoA.<br />
<br />
'''[http://cocoa.dima.unige.it/ CoCoA]''' official web page.<br />
<br />
'''[[:Category:CoCoA4|CoCoA 4]]''' and '''[[:Category:CoCoAL|CoCoALanguage]]'''<br />
<br />
'''[[:Category:CoCoA5|CoCoA 5]]''' and '''[[:Category:CoCoALib|CoCoALib]]'''<br />
<br />
A computer algebra system is a special software, that offers special mathematical methods to treat certain problems.<br />
There is a nice article about computer algera systems that can be found [http://en.wikipedia.org/wiki/Computer_algebra_system here].<br />
This article is part of [http://www.wikipedia.org Wikipedia] and contains a list of other computer algebra systems.<br />
<br />
[http://cocoa.dima.unige.it/ CoCoA] is being developed at the University of Genova (Italy).<br />
In addition to this wiki there is a [http://cocoa.mathematik.uni-dortmund.de/forum/ discussion board] for users of CoCoA and the [[:Category:CoCoALib|CoCoAlib]].<br />
<br />
At the moment there are two releases of CoCoA, namely [[:Category:CoCoA4|CoCoA 4]] and [[:Category:CoCoA5|CoCoA 5]]. You can also find some information about [[Releases|releases]] of CoCoA and its [[History|history]] here, as well as some [[:Category:HowTo|How To's]], describing how to solve special problems with CoCoA. Also, there is a list of articles, containing some [[:Category:documentation|documentation]] for the recent versions of CoCoA.<br />
<br />
Most versions of CoCoA have a graphical user interface, utilizing [[:Category:CoCoAL|CoCoAL]] as computing language. <br />
With [[:Category:CoCoALib|CoCoALib]], a C++ library, it is possible to use the CoCoA computing engine for the development of your own applications.</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoA:CoCoA4.6.90_ReleasePlan&diff=2161CoCoA:CoCoA4.6.90 ReleasePlan2006-10-02T14:46:24Z<p>Bigatti: /* CoCoALib 0.97.4 */</p>
<hr />
<div>=Overview=<br />
CoCoA 4.6.90 is a preview release of the upcoming CoCoA 4.7. The release of CoCoA 4.6.90 is scheduled for Oct. 7th, 2006. The release is intented as a test for many of the new features that will ship with CoCoA 4.7. <br />
<br />
As the number of people who contribute to CoCoA 4.X and the CoCoALib grows it has become more difficult to coordinate among the contributors. So what used to be handled in a very informal manner between a group of 2 or 3 people residing in close physical proximity in Genova has become a more difficult due to the distributed nature of the new contributors. We hope that this wiki page as well as the CoCoA forum in general will lead to a better release experience.<br />
<br />
=Status of CoCoA 4.6.90 & CoCoALib 0.97.4 subprojects=<br />
<br />
While most development happens on the side of the CoCoALib, many subprojects are also integrated into the current CoCoA client, i.e. CoCoA 4.X. Due to this many sub projects appear for both CoCoA 4.6.90 and the CoCoALib 0.97.4.<br />
<br />
==CoCoA 4.6.90==<br />
<br />
FIXME: add (more) details<br />
<br />
# Weyl-algebras<br />
# Preprocessing<br />
# Multiple parameters: fixed, manual updated<br />
# FGLM<br />
# Border bases<br />
# SVD & QR <br />
# Eigenvalue solver: maybe - time permitting.<br />
# approx BM<br />
# Universal binaries for MacOSX<br />
# non-commutative monoids/polynomials <br />
# optimization of WinSockets<br />
# print warning for "<<" instead of "Source" and "Use Q[xy]" instead of "Use Q[x,y]"<br />
# test that the CoCoAServer matches the CoCoAClient<br />
<br />
==CoCoALib 0.97.4==<br />
<br />
FIXME: add (more) details<br />
<br />
# SUGAR: something is already there. Probably done in November 2006.<br />
# Hilbert-functions: done. So far it's only an example in ex-hilbert1.C. Will not do multigradings until fully integrated, so Hilbert in CoCoA-4 is still better ==> no point in adding it to the CoCoAServer.<br />
# Weyl-algebras: done, samples in examples/. Still unstable interface: now does something funny to make an elimination ordering. Nothing in the CoCoAServer.<br />
# Preprocessing<br />
# FGLM<br />
# Border bases<br />
# SVD & QR <br />
# Eigenvalue solver: maybe - time permitting.<br />
# approx BM<br />
# Universal binaries for MacOSX .... should this be for CoCoA-4? are we talking of CoCoALib or CoCoAServer?<br />
# non-commutative monoids/polynomials <br />
# optimization of WinSockets<br />
# LAPACK/BLAS abstraction-layer <br />
# CoCoALib build-support for VS 2003/2005</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoA:CoCoA4.6.90_ReleasePlan&diff=2160CoCoA:CoCoA4.6.90 ReleasePlan2006-10-02T14:36:00Z<p>Bigatti: /* CoCoALib 0.97.4 */</p>
<hr />
<div>=Overview=<br />
CoCoA 4.6.90 is a preview release of the upcoming CoCoA 4.7. The release of CoCoA 4.6.90 is scheduled for Oct. 7th, 2006. The release is intented as a test for many of the new features that will ship with CoCoA 4.7. <br />
<br />
As the number of people who contribute to CoCoA 4.X and the CoCoALib grows it has become more difficult to coordinate among the contributors. So what used to be handled in a very informal manner between a group of 2 or 3 people residing in close physical proximity in Genova has become a more difficult due to the distributed nature of the new contributors. We hope that this wiki page as well as the CoCoA forum in general will lead to a better release experience.<br />
<br />
=Status of CoCoA 4.6.90 & CoCoALib 0.97.4 subprojects=<br />
<br />
While most development happens on the side of the CoCoALib, many subprojects are also integrated into the current CoCoA client, i.e. CoCoA 4.X. Due to this many sub projects appear for both CoCoA 4.6.90 and the CoCoALib 0.97.4.<br />
<br />
==CoCoA 4.6.90==<br />
<br />
FIXME: add (more) details<br />
<br />
# Weyl-algebras<br />
# Preprocessing<br />
# Multiple parameters: fixed, manual updated<br />
# FGLM<br />
# Border bases<br />
# SVD & QR <br />
# Eigenvalue solver: maybe - time permitting.<br />
# approx BM<br />
# Universal binaries for MacOSX<br />
# non-commutative monoids/polynomials <br />
# optimization of WinSockets<br />
# print warning for "<<" instead of "Source" and "Use Q[xy]" instead of "Use Q[x,y]"<br />
# test that the CoCoAServer matches the CoCoAClient<br />
<br />
==CoCoALib 0.97.4==<br />
<br />
FIXME: add (more) details<br />
<br />
# SUGAR<br />
# Hilbert-functions: done. So far it's only an example in ex-hilbert1.C. Will not do multigradings until fully integrated, so Hilbert in CoCoA-4 is still better.<br />
# Weyl-algebras: done, samples in examples/. Still unstable interface: now does something funny to make an elimination ordering<br />
# Preprocessing<br />
# FGLM<br />
# Border bases<br />
# SVD & QR <br />
# Eigenvalue solver: maybe - time permitting.<br />
# approx BM<br />
# Universal binaries for MacOSX .... should this be for CoCoA-4? are we talking of CoCoALib or CoCoAServer?<br />
# non-commutative monoids/polynomials <br />
# optimization of WinSockets<br />
# LAPACK/BLAS abstraction-layer <br />
# CoCoALib build-support for VS 2003/2005</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoA:CoCoA4.6.90_ReleasePlan&diff=2159CoCoA:CoCoA4.6.90 ReleasePlan2006-10-02T14:34:34Z<p>Bigatti: /* CoCoA 4.6.90 */</p>
<hr />
<div>=Overview=<br />
CoCoA 4.6.90 is a preview release of the upcoming CoCoA 4.7. The release of CoCoA 4.6.90 is scheduled for Oct. 7th, 2006. The release is intented as a test for many of the new features that will ship with CoCoA 4.7. <br />
<br />
As the number of people who contribute to CoCoA 4.X and the CoCoALib grows it has become more difficult to coordinate among the contributors. So what used to be handled in a very informal manner between a group of 2 or 3 people residing in close physical proximity in Genova has become a more difficult due to the distributed nature of the new contributors. We hope that this wiki page as well as the CoCoA forum in general will lead to a better release experience.<br />
<br />
=Status of CoCoA 4.6.90 & CoCoALib 0.97.4 subprojects=<br />
<br />
While most development happens on the side of the CoCoALib, many subprojects are also integrated into the current CoCoA client, i.e. CoCoA 4.X. Due to this many sub projects appear for both CoCoA 4.6.90 and the CoCoALib 0.97.4.<br />
<br />
==CoCoA 4.6.90==<br />
<br />
FIXME: add (more) details<br />
<br />
# Weyl-algebras<br />
# Preprocessing<br />
# Multiple parameters: fixed, manual updated<br />
# FGLM<br />
# Border bases<br />
# SVD & QR <br />
# Eigenvalue solver: maybe - time permitting.<br />
# approx BM<br />
# Universal binaries for MacOSX<br />
# non-commutative monoids/polynomials <br />
# optimization of WinSockets<br />
# print warning for "<<" instead of "Source" and "Use Q[xy]" instead of "Use Q[x,y]"<br />
# test that the CoCoAServer matches the CoCoAClient<br />
<br />
==CoCoALib 0.97.4==<br />
<br />
FIXME: add (more) details<br />
<br />
# SUGAR<br />
# Hilbert-functions: done. So far it's only an example in ex-hilbert1.C. Will not do multigradings until fully integrated, so Hilbert in CoCoA-4 is still better.<br />
# Weyl-algebras: done, samples in examples/. Still unstable interface: now does something funny to make an elimination ordering<br />
# Preprocessing<br />
# FGLM<br />
# Border bases<br />
# SVD & QR <br />
# Eigenvalue solver: maybe - time permitting.<br />
# approx BM<br />
# Universal binaries for MacOSX .... should this be for CoCoA-4?<br />
# non-commutative monoids/polynomials <br />
# optimization of WinSockets<br />
# LAPACK/BLAS abstraction-layer <br />
# CoCoALib build-support for VS 2003/2005</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoA:CoCoA4.6.90_ReleasePlan&diff=2158CoCoA:CoCoA4.6.90 ReleasePlan2006-10-02T14:33:29Z<p>Bigatti: /* CoCoALib 0.97.4 */</p>
<hr />
<div>=Overview=<br />
CoCoA 4.6.90 is a preview release of the upcoming CoCoA 4.7. The release of CoCoA 4.6.90 is scheduled for Oct. 7th, 2006. The release is intented as a test for many of the new features that will ship with CoCoA 4.7. <br />
<br />
As the number of people who contribute to CoCoA 4.X and the CoCoALib grows it has become more difficult to coordinate among the contributors. So what used to be handled in a very informal manner between a group of 2 or 3 people residing in close physical proximity in Genova has become a more difficult due to the distributed nature of the new contributors. We hope that this wiki page as well as the CoCoA forum in general will lead to a better release experience.<br />
<br />
=Status of CoCoA 4.6.90 & CoCoALib 0.97.4 subprojects=<br />
<br />
While most development happens on the side of the CoCoALib, many subprojects are also integrated into the current CoCoA client, i.e. CoCoA 4.X. Due to this many sub projects appear for both CoCoA 4.6.90 and the CoCoALib 0.97.4.<br />
<br />
==CoCoA 4.6.90==<br />
<br />
FIXME: add (more) details<br />
<br />
# Weyl-algebras<br />
# Preprocessing<br />
# Multiple parameters<br />
# FGLM<br />
# Border bases<br />
# SVD & QR <br />
# Eigenvalue solver: maybe - time permitting.<br />
# approx BM<br />
# Universal binaries for MacOSX<br />
# non-commutative monoids/polynomials <br />
# optimization of WinSockets<br />
# print warning for "<<" instead of "Source" and "Use Q[xy]" instead of "Use Q[x,y]"<br />
# test that the CoCoAServer matches the CoCoAClient<br />
<br />
==CoCoALib 0.97.4==<br />
<br />
FIXME: add (more) details<br />
<br />
# SUGAR<br />
# Hilbert-functions: done. So far it's only an example in ex-hilbert1.C. Will not do multigradings until fully integrated, so Hilbert in CoCoA-4 is still better.<br />
# Weyl-algebras: done, samples in examples/. Still unstable interface: now does something funny to make an elimination ordering<br />
# Preprocessing<br />
# FGLM<br />
# Border bases<br />
# SVD & QR <br />
# Eigenvalue solver: maybe - time permitting.<br />
# approx BM<br />
# Universal binaries for MacOSX .... should this be for CoCoA-4?<br />
# non-commutative monoids/polynomials <br />
# optimization of WinSockets<br />
# LAPACK/BLAS abstraction-layer <br />
# CoCoALib build-support for VS 2003/2005</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoA:CoCoA4.6.90_ReleasePlan&diff=2157CoCoA:CoCoA4.6.90 ReleasePlan2006-10-02T14:30:59Z<p>Bigatti: </p>
<hr />
<div>=Overview=<br />
CoCoA 4.6.90 is a preview release of the upcoming CoCoA 4.7. The release of CoCoA 4.6.90 is scheduled for Oct. 7th, 2006. The release is intented as a test for many of the new features that will ship with CoCoA 4.7. <br />
<br />
As the number of people who contribute to CoCoA 4.X and the CoCoALib grows it has become more difficult to coordinate among the contributors. So what used to be handled in a very informal manner between a group of 2 or 3 people residing in close physical proximity in Genova has become a more difficult due to the distributed nature of the new contributors. We hope that this wiki page as well as the CoCoA forum in general will lead to a better release experience.<br />
<br />
=Status of CoCoA 4.6.90 & CoCoALib 0.97.4 subprojects=<br />
<br />
While most development happens on the side of the CoCoALib, many subprojects are also integrated into the current CoCoA client, i.e. CoCoA 4.X. Due to this many sub projects appear for both CoCoA 4.6.90 and the CoCoALib 0.97.4.<br />
<br />
==CoCoA 4.6.90==<br />
<br />
FIXME: add (more) details<br />
<br />
# Weyl-algebras<br />
# Preprocessing<br />
# Multiple parameters<br />
# FGLM<br />
# Border bases<br />
# SVD & QR <br />
# Eigenvalue solver: maybe - time permitting.<br />
# approx BM<br />
# Universal binaries for MacOSX<br />
# non-commutative monoids/polynomials <br />
# optimization of WinSockets<br />
# print warning for "<<" instead of "Source" and "Use Q[xy]" instead of "Use Q[x,y]"<br />
# test that the CoCoAServer matches the CoCoAClient<br />
<br />
==CoCoALib 0.97.4==<br />
<br />
FIXME: add (more) details<br />
<br />
# SUGAR<br />
# Hilbert-functions<br />
# Weyl-algebras: done, samples in examples/. Still unstable interface: now does something funny to make an elimination ordering<br />
# Preprocessing<br />
# FGLM<br />
# Border bases<br />
# SVD & QR <br />
# Eigenvalue solver: maybe - time permitting.<br />
# approx BM<br />
# Universal binaries for MacOSX<br />
# non-commutative monoids/polynomials <br />
# optimization of WinSockets<br />
# LAPACK/BLAS abstraction-layer <br />
# CoCoALib build-support for VS 2003/2005</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=HowTo:Use_Modular_Numbers&diff=2109HowTo:Use Modular Numbers2006-05-19T18:46:24Z<p>Bigatti: /* Answer */</p>
<hr />
<div>== Question ==<br />
How can one compute with modular numbers? What's wrong in this?<br />
Use R::=Z/(5)[x];<br />
5x+2y;<br />
2y<br />
-------------------------------<br />
5=0;<br />
FALSE<br />
-------------------------------<br />
Moreover this command throws an error<br />
Use R::=Z/(5);<br />
<br />
== Answer ==<br />
Type(5);<br />
INT<br />
-------------------------------<br />
5 is an integer, and integers do not depend on the current ring: could you imagine what would happen to a For cycle over Z/(2)? ;-)<br />
<br />
If you want to use 5 as a modular number you should either use this syntax (similar to C/C++)<br />
5 % 5;<br />
0 % 5<br />
-------------------------------<br />
or embed your integer into the polynomial ring<br />
Use R::=Z/(5)[x];<br />
Poly(5);<br />
0<br />
-------------------------------<br />
The creation of a polynomial ring with no indeterminates has been disabled to highlight this (unexpected?) behaviour.<br />
<br />
by [[User:Bigatti|Bigatti]] 17:26, 29 Nov 2005 (CET)<br />
<br />
[[Category:HowTo]][[Category:CoCoA4]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=HowTo:Use_Modular_Numbers&diff=1498HowTo:Use Modular Numbers2005-11-29T16:26:11Z<p>Bigatti: </p>
<hr />
<div>== Question ==<br />
How can one compute with modular numbers? What's wrong in this?<br />
Use R::=Z/(5)[x];<br />
5x+2y;<br />
2y<br />
-------------------------------<br />
5=0;<br />
FALSE<br />
-------------------------------<br />
Moreover this command throws an error<br />
Use R::=Z/(5);<br />
<br />
== Answer ==<br />
Type(5);<br />
INT<br />
-------------------------------<br />
5 is an integer, and integers do not depend on the current ring: could you imagine what would happen to a For cycle over Z/(2)? ;-)<br />
<br />
If you want to use 5 as a modular number you should either use this syntax (similar to C/C++)<br />
5 % 5;<br />
0 % 5<br />
-------------------------------<br />
or embed your integer into the polynomial ring<br />
Use R::=Z/(5)[x];<br />
Poly(5);<br />
0<br />
-------------------------------<br />
The creation of a polynomial ring with no indeterminated has been disabled to highlight this (unexpected?) behaviour.<br />
<br />
by [[User:Bigatti|Bigatti]] 17:26, 29 Nov 2005 (CET)<br />
<br />
[[Category:HowTo]][[Category:CoCoA4]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=HowTo:Randomize_Coefficients&diff=1500HowTo:Randomize Coefficients2005-11-29T16:25:42Z<p>Bigatti: </p>
<hr />
<div>== Question ==<br />
The coefficients of a "Randomized" polynomials are too big for my purposes<br />
Use R ::= Q[x,y,z];<br />
Randomized(x-yz);<br />
2129104241yz - 2703411994x<br />
-------------------------------<br />
What can I do?<br />
<br />
== Answer ==<br />
This function will produce a randomized polynomial with "small" random coefficients<br />
Define MyRandomized(F, Range)<br />
Return Sum([ Rand(-Range,Range)*T | T In Support(F)]);<br />
EndDefine;<br />
<br />
MyRandomized(x-yz, 4);<br />
2yz + 6x<br />
-------------------------------<br />
by [[User:Bigatti|Bigatti]] 17:25, 29 Nov 2005 (CET)<br />
[[Category:CoCoA4]] [[Category:HowTo]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=Talk:Contribute_to_the_Library&diff=1502Talk:Contribute to the Library2005-11-29T16:10:57Z<p>Bigatti: Talk:Contribute to the Library moved to Talk:Contribute to CoCoALib</p>
<hr />
<div>#REDIRECT [[Talk:Contribute to CoCoALib]]<br />
</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoALib:Contribute&diff=417CoCoALib:Contribute2005-11-29T16:09:51Z<p>Bigatti: added instruction for running the examples</p>
<hr />
<div>== Contribute with an example ==<br />
The easiest way to help the CoCoALib project is to have a look at the "example" directory, run the examples, play with them, and send a comment about what can be improved.<br />
<br />
You could also create a new example to be added to the distibution.<br />
<br />
=== How do I run an example? ===<br />
<br />
Download CoCoALib-xxx and compile it: (you will need GMP)<br />
cd CoCoALib-xxx<br />
./configure<br />
make<br />
to run an example do this:<br />
cd examples<br />
make ex-yyyyy<br />
./ex-yyyy<br />
<br />
== Contibute with a new class ==<br />
At the moment there exists no exact procedure how to submit or contribute something to CoCoALib.<br />
As soon as somebody wants to contribute something, we will come up with a way to do so.<br />
<br />
[[Category:HowTo]][[Category:CoCoALib]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=HowTo:Randomize_Coefficients&diff=403HowTo:Randomize Coefficients2005-11-29T15:53:53Z<p>Bigatti: a function for "small" random polynomials</p>
<hr />
<div>== Question ==<br />
The coefficients of a "Randomized" polynomials are too big for my purposes<br />
Use R ::= Q[x,y,z];<br />
Randomized(x-yz);<br />
2129104241yz - 2703411994x<br />
-------------------------------<br />
What can I do?<br />
<br />
== Answer ==<br />
This function will produce a randomized polynomial with "small" random coefficients<br />
Define MyRandomized(F, Range)<br />
Return Sum([ Rand(-Range,Range)*T | T In Support(F)]);<br />
EndDefine;<br />
<br />
MyRandomized(x-yz, 4);<br />
2yz + 6x<br />
-------------------------------<br />
[[Category:CoCoA4]] [[Category:HowTo]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=Category_talk:CoCoAL&diff=1448Category talk:CoCoAL2005-11-29T15:43:41Z<p>Bigatti: </p>
<hr />
<div>Who developed CoCoAL? could "sombody" (Anna?) write some sentences about this?<br />
Thx...<br />
<br />
[[User:Dheldt|dheldt]] 09:25, 15 Jul 2005 (CEST)<br />
<br />
----<br />
<br />
What about converting "CoCoAL" into CoCoALanguage or simply CoCoA programming language? We've always hated that acronym and we've never used it ;-)<br />
<br />
[[User:Bigatti|Bigatti]] 17:20, 15 Jul 2005 (CEST)<br />
<br />
:sounds fine with me...<br />
:<br />
:[[User:83.84.162.239|83.84.162.239]] 11:41, 16 Jul 2005 (CEST) (dheldt@home)<br />
<br />
::how do you change name to a category? it's easy enough with articles, so I expect it should be possible--[[User:Bigatti|Bigatti]] 16:43, 29 Nov 2005 (CET)</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=HowTo:Use_Modular_Numbers&diff=404HowTo:Use Modular Numbers2005-11-29T14:54:57Z<p>Bigatti: </p>
<hr />
<div>== Question ==<br />
How can one compute with modular numbers? What's wrong in this?<br />
Use R::=Z/(5)[x];<br />
5x+2y;<br />
2y<br />
-------------------------------<br />
5=0;<br />
FALSE<br />
-------------------------------<br />
Moreover this command throws an error<br />
Use R::=Z/(5);<br />
<br />
== Answer ==<br />
Type(5);<br />
INT<br />
-------------------------------<br />
5 is an integer, and integers do not depend on the current ring: could you imagine what would happen to a For cycle over Z/(2)? ;-)<br />
<br />
If you want to use 5 as a modular number you should either use this syntax (similar to C/C++)<br />
5 % 5;<br />
0 % 5<br />
-------------------------------<br />
or embed your integer into the polynomial ring<br />
Use R::=Z/(5)[x];<br />
Poly(5);<br />
0<br />
-------------------------------<br />
The creation of a polynomial ring with no indeterminated has been disabled to highlight this (unexpected?) behaviour.<br />
<br />
[[Category:HowTo]][[Category:CoCoA4]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=HowTo:Use_Modular_Numbers&diff=400HowTo:Use Modular Numbers2005-11-29T14:51:35Z<p>Bigatti: </p>
<hr />
<div>== Question ==<br />
What's wrong in this?<br />
Use R::=Z/(5)[x];<br />
5x+2y;<br />
2y<br />
-------------------------------<br />
5=0;<br />
FALSE<br />
-------------------------------<br />
Moreover this command throws an error<br />
Use R::=Z/(5);<br />
<br />
== Answer ==<br />
Type(5);<br />
INT<br />
-------------------------------<br />
5 is an integer, and integers do not depend on the current ring: could you imagine what would happen to a For cycle over Z/(2)? ;-)<br />
<br />
If you want to use 5 as a modular number you should either use this syntax (similar to C/C++)<br />
5 % 5;<br />
0 % 5<br />
-------------------------------<br />
or embed your integer into the polynomial ring<br />
Use R::=Z/(5)[x];<br />
Poly(5);<br />
0<br />
-------------------------------<br />
The creation of a polynomial ring with no indeterminated has been disabled to highlight this (unexpected?) behaviour.<br />
<br />
[[Category:HowTo]][[Category:CoCoA4]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=HowTo:Use_Modular_Numbers&diff=399HowTo:Use Modular Numbers2005-11-29T14:50:13Z<p>Bigatti: Strange behaviour of modular numbers</p>
<hr />
<div>== Question ==<br />
What's wrong in this?<br />
Use R::=Z/(5)[x];<br />
5x+2y;<br />
2y<br />
-------------------------------<br />
5=0;<br />
FALSE<br />
-------------------------------<br />
Moreover this command throws an error<br />
Use R::=Z/(5);<br />
<br />
== Answer ==<br />
Type(5);<br />
INT<br />
-------------------------------<br />
5 is an integer, and integers do not depend on the current ring: could you imagine what would happen to a For cycle over Z/(2)? ;-)<br />
<br />
If you want to use 5 as a modular number you should either use this syntax (similar to C/C++)<br />
5 % 5;<br />
0 % 5<br />
-------------------------------<br />
or embed your integer into the polynomial ring<br />
Use R::=Z/(5)[x];<br />
Poly(5);<br />
0<br />
-------------------------------<br />
The creation of a polynomial ring with no indeterminated has been disabled to highlight this (unexpected?) behaviour.</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=HowTo:Use_Modular_Numbers&diff=398HowTo:Use Modular Numbers2005-11-29T14:48:09Z<p>Bigatti: </p>
<hr />
<div>== Modular Numbers ==<br />
=== Question ===<br />
What's wrong in this?<br />
Use R::=Z/(5)[x];<br />
5x+2y;<br />
2y<br />
-------------------------------<br />
5=0;<br />
FALSE<br />
-------------------------------<br />
Moreover this command throws an error<br />
Use R::=Z/(5);<br />
=== Answer ===<br />
Type(5);<br />
INT<br />
-------------------------------<br />
5 is an integer, and integers do not depend on the current ring: could you imagine what would happen to a For cycle over Z/(2)? ;-)<br />
If you want to use 5 as a modular number you should either use this syntax (similar to C/C++)<br />
5 % 5;<br />
0 % 5<br />
-------------------------------<br />
or embed your integer into the polynomial ring<br />
Use R::=Z/(5)[x];<br />
Poly(5);<br />
0<br />
-------------------------------<br />
The creation of a polynomial ring with no indeterminated has been disabled to highlight this (unexpected?) behaviour.</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=HowTo:Use_Modular_Numbers&diff=397HowTo:Use Modular Numbers2005-11-29T14:45:21Z<p>Bigatti: </p>
<hr />
<div>== Modular Numbers ==<br />
=== Question ===<br />
What's wrong in this?<br />
Use R::=Z/(5)[x];<br />
5x+2y;<br />
2y<br />
-------------------------------<br />
5=0;<br />
FALSE<br />
-------------------------------<br />
Moreover this throws an error<br />
Use R::=Z/(5);<br />
=== Answer ===<br />
Type(5);<br />
INT<br />
-------------------------------<br />
5 is an integer, and integers do not depend on the current ring: could you imagine what would happen to a For cycle over Z/(2)? ;-)<br />
If you want to use 5 as a modular number you should use this syntax (similar to C/C++)<br />
5 % 5;<br />
0 % 5<br />
-------------------------------<br />
or embed your integer into the polynomial ring<br />
Use R::=Z/(5)[x];<br />
Poly(5);<br />
0<br />
-------------------------------</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=HowTo:Use_Modular_Numbers&diff=396HowTo:Use Modular Numbers2005-11-29T14:41:24Z<p>Bigatti: </p>
<hr />
<div>== Modular Numbers ==<br />
=== Question ===<br />
What's wrong in this?<br />
Use R::=Z/(5)[x];<br />
5x+2y;<br />
2y<br />
-------------------------------<br />
5=0;<br />
FALSE<br />
-------------------------------<br />
Moreover this throws an error<br />
Use R::=Z/(5);<br />
=== Answer ===<br />
Type(5);<br />
INT<br />
-------------------------------<br />
5 e' un intero, e gli interi non dipendono dall'anello corrente (puoi<br />
immaginarti cosa succederebbe a un ciclo For?)<br />
<br />
per vedere 5 come modulare devi fare:<br />
5 % 5;<br />
0 % 5<br />
-------------------------------<br />
(analogo al C) oppure immergerlo nell'anello di polinomi<br />
Use R::=Z/(5)[x];<br />
Poly(5);<br />
0<br />
-------------------------------</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=HowTo:Use_Modular_Numbers&diff=395HowTo:Use Modular Numbers2005-11-29T14:40:16Z<p>Bigatti: </p>
<hr />
<div>== Modular Numbers ==<br />
=== Question ===<br />
Use R::=Z/(5)[x];<br />
5x+2y;<br />
2y<br />
---<br />
5=0;<br />
FALSE :-((<br />
---<br />
<br />
Use R::=Z/(5);<br />
=== Answer ===<br />
Type(5);<br />
INT<br />
-------------------------------<br />
5 e' un intero, e gli interi non dipendono dall'anello corrente (puoi<br />
immaginarti cosa succederebbe a un ciclo For?)<br />
<br />
per vedere 5 come modulare devi fare:<br />
5 % 5;<br />
0 % 5<br />
-------------------------------<br />
(analogo al C) oppure immergerlo nell'anello di polinomi<br />
Use R::=Z/(5)[x];<br />
Poly(5);<br />
0<br />
-------------------------------</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=HowTo:Use_Modular_Numbers&diff=394HowTo:Use Modular Numbers2005-11-29T14:38:49Z<p>Bigatti: I'm going to save every step now: I don't want to lose my edit again!</p>
<hr />
<div> Type(5);<br />
INT<br />
-------------------------------<br />
5 e' un intero, e gli interi non dipendono dall'anello corrente (puoi<br />
immaginarti cosa succederebbe a un ciclo For?)<br />
<br />
per vedere 5 come modulare devi fare:<br />
5 % 5;<br />
0 % 5<br />
-------------------------------<br />
(analogo al C) oppure immergerlo nell'anello di polinomi<br />
Use R::=Z/(5)[x];<br />
Poly(5);<br />
0<br />
-------------------------------</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=Category:CoCoA4&diff=1416Category:CoCoA42005-11-29T13:50:34Z<p>Bigatti: /* Supported Plattforms */</p>
<hr />
<div>==About==<br />
<br />
CoCoA 4 is no longer in development, but is still being maintained. The current release is CoCoA 4.5.1.<br />
It can be downloaded at <br />
<br />
* [http://cocoa.dima.unige.it/download/ http://cocoa.dima.unige.it/download/]<br />
* [ftp://ftp.reed.edu/mirrors/cocoa/]<br />
<br />
CoCoA 4 uses and is programmed in [[:Category:CoCoAL|CoCoALanguage]].<br />
<br />
==Interfaces==<br />
<br />
There are three different CoCoA 4 clients:<br />
<br />
* cocoa-text: provides a bare bones interface. Most users won't use this version, but it can be useful when running computations in batch mode on a shell.<br />
* Emacs-plugin: provides an Emacs interfaces that is a lot more comfortable than the bare bones cocoa-text. This client is more popular with the Linux/MacOSX/Unix crowd.<br />
* cocoa-qt: provides a GUI written in Qt, multiple input windows and integrated html-help. This client is more popular with the Windows crowd. <br />
<br />
All clients use the same computing engince so you should get the same result regardless of the client. On certain corner cases the clients show different behauviour, i.e. very long strings (2Megabytes+) seem to upset certain version of Emacs, while the Qt-client can handle strings pretty much the size of your RAM and then some. Each client has its own limitations and strength, so use the one that you are comfortable with and does the job for you.<br />
<br />
==Supported Plattforms==<br />
<br />
At the moment the following operating systems are supported:<br />
<br />
* MacOSX<br />
* PowerPC running LinuxPPC<br />
* Pc running Linux<br />
* Pc running Windows<br />
* Sun<br />
* DEC Alpha workstations (version 4.2)<br />
* ARM (version 4.2)<br />
<br />
For some more information on currently available releases of CoCoA-4 check out the [http://cocoa.dima.unige.it/download/ dowload page] and [[CoCoA4 Builds]].</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=Category:CoCoA4&diff=392Category:CoCoA42005-11-29T12:11:41Z<p>Bigatti: /* Supported Plattforms */</p>
<hr />
<div>==About==<br />
<br />
CoCoA 4 is no longer in development, but is still being maintained. The current release is CoCoA 4.5.1.<br />
It can be downloaded at <br />
<br />
* [http://cocoa.dima.unige.it/download/ http://cocoa.dima.unige.it/download/]<br />
* [ftp://ftp.reed.edu/mirrors/cocoa/]<br />
<br />
CoCoA 4 uses and is programmed in [[:Category:CoCoAL|CoCoALanguage]].<br />
<br />
==Interfaces==<br />
<br />
There are three different CoCoA 4 clients:<br />
<br />
* cocoa-text: provides a bare bones interface. Most users won't use this version, but it can be useful when running computations in batch mode on a shell.<br />
* Emacs-plugin: provides an Emacs interfaces that is a lot more comfortable than the bare bones cocoa-text. This client is more popular with the Linux/MacOSX/Unix crowd.<br />
* cocoa-qt: provides a GUI written in Qt, multiple input windows and integrated html-help. This client is more popular with the Windows crowd. <br />
<br />
All clients use the same computing engince so you should get the same result regardless of the client. On certain corner cases the clients show different behauviour, i.e. very long strings (2Megabytes+) seem to upset certain version of Emacs, while the Qt-client can handle strings pretty much the size of your RAM and then some. Each client has its own limitations and strength, so use the one that you are comfortable with and does the job for you.<br />
<br />
==Supported Plattforms==<br />
<br />
At the moment the following operating systems are supported:<br />
<br />
* MacOSX<br />
* PowerPC running LinuxPPC<br />
* Pc running Linux<br />
* Pc running Windows<br />
* Sun<br />
* DEC Alpha workstations (version 4.2)<br />
* ARM (version 4.2)<br />
<br />
For some more information on currently available releases of CoCoA 4.4 check out [[CoCoA4 Builds]].</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=Category:CoCoA4&diff=391Category:CoCoA42005-11-29T12:09:44Z<p>Bigatti: current release 4.5.1</p>
<hr />
<div>==About==<br />
<br />
CoCoA 4 is no longer in development, but is still being maintained. The current release is CoCoA 4.5.1.<br />
It can be downloaded at <br />
<br />
* [http://cocoa.dima.unige.it/download/ http://cocoa.dima.unige.it/download/]<br />
* [ftp://ftp.reed.edu/mirrors/cocoa/]<br />
<br />
CoCoA 4 uses and is programmed in [[:Category:CoCoAL|CoCoALanguage]].<br />
<br />
==Interfaces==<br />
<br />
There are three different CoCoA 4 clients:<br />
<br />
* cocoa-text: provides a bare bones interface. Most users won't use this version, but it can be useful when running computations in batch mode on a shell.<br />
* Emacs-plugin: provides an Emacs interfaces that is a lot more comfortable than the bare bones cocoa-text. This client is more popular with the Linux/MacOSX/Unix crowd.<br />
* cocoa-qt: provides a GUI written in Qt, multiple input windows and integrated html-help. This client is more popular with the Windows crowd. <br />
<br />
All clients use the same computing engince so you should get the same result regardless of the client. On certain corner cases the clients show different behauviour, i.e. very long strings (2Megabytes+) seem to upset certain version of Emacs, while the Qt-client can handle strings pretty much the size of your RAM and then some. Each client has its own limitations and strength, so use the one that you are comfortable with and does the job for you.<br />
<br />
==Supported Plattforms==<br />
<br />
At the moment the following operating systems are supported:<br />
<br />
* MacOSX<br />
* PowerPC running LinuxPPC<br />
* Pc running Linux<br />
* Pc running Windows (only version 4.3 or 4.4, emacs interface)<br />
* Sun (version 4.2, emacs interface)<br />
* DEC Alpha workstations (version 4.2, emacs interface)<br />
* ARM (version 4.2, emacs interface)<br />
<br />
For some more information on currently available releases of CoCoA 4.4 check out [[CoCoA4 Builds]].</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoA:Emacs_interface&diff=376CoCoA:Emacs interface2005-11-10T14:58:18Z<p>Bigatti: layout changes in the installation section</p>
<hr />
<div>== cocoa-mode == <br />
<br />
The distribution of cocoa-4.5 includes an <code>emacs/</code> directory which contains <code>cocoa.el</code> and <code>cocoa.emacs</code> (the settings to be added to your <code>.emacs</code>).<br />
<br />
* a friendly '''CoCoA''' menu<br />
* automatic indentation <br />
* coloured syntax (in font-lock-mode - default) <br />
* capitalization of keywords (in abbrev-mode - default) <br />
* automatic loading of <code>wordlist.txt</code> for dynamic abbrev expansion (<code>M-/</code> or <code>TAB</code>) <br />
<br />
=== CoCoA menu === <br />
[[Image:CoCoAMenu.jpg|right|CoCoA menu for cocoa-mode]]<br />
From the menu you can <br />
* send lines, regions and files to cocoa<br />
* go to the parse error line (if you had a parse error after sending a file) <br />
* start or restart the CoCoAServer<br />
<br />
<code>Use TAB for Completion</code> (available soon) will allows to toggle this option. It used to be always off up to cocoa-4.4, and always on in cocoa-4.5.<br />
<br />
=== Some key bindings in cocoa-mode ===<br />
<br />
* <code>C-c C-e</code> (like in latex-mode) writes the appropriate "End" (EndIf,...) <br />
* <code>C-c C-c</code> (like in c-mode) comment-region<br />
<br />
If the following features do not work you should customize the variable <code>cocoa-executable</code> in '''cocoa.emacs''': <br />
<br />
=== Calling CoCoA ===<br />
From a buffer in '''cocoa-mode''' you can select things and "send" them to a cocoa buffer (called <code>*cocoa*</code>) to be evaluated:<br />
<br />
; <code>C-c C-l</code> : execute this line (from any point in the line)<br />
; <code>C-c C-r</code> : execute the selected region<br />
; <code>C-c C-f</code> : execute all this file (from any point in thefile)<br />
; <code>C-c C-p</code> : go to the parse error line (if C-c C-f gave a parse error) <br />
; <code>C-c C-m</code> or <code>C-c ?</code> : call the CoCoA manual for this word (from any point in the word)<br />
<br />
They will automatically start CoCoA (if it isn't already running in a <code>*cocoa*</code> buffer).<br />
<br />
; <code>M-x cocoa</code> : opens a buffer (called <code>*cocoa*</code>) with a running CoCoA<br />
<br />
== Installation instructions for experts ==<br />
<br />
Copy the customizations and the settings you like from '''cocoa-4.5/emacs/cocoa.emacs'''<br />
into your '''~/.emacs'''.<br />
<br />
== Installation instructions for non-experts ==<br />
<br />
Following these instructions Emacs will recognise files with a CoCoA extension(<code>.coc, .cocoa, .cpkg</code>): REMEMBER to add one to the name of your files!<br />
<br />
If you used Emacs itself to change some settings you should restart Emacs. (of course you can load them without restarting Emacs, but this is the section for non-experts! ;-) )<br />
<br />
=== Unix/Linux ===<br />
<br />
Open your <code>.emacs</code> file with any editor <br />
(it should be in your home, and it may not exist!):<br />
<br />
Add this line at the end of your '''.emacs''':<br> <code>(load-file "&lt;path&gt;/emacs/cocoa.emacs")</code> <br />
<br />
for example: <br />
<br />
<code>(load-file "/usr/local/cocoa-4.5/emacs/cocoa.emacs")</code><br />
<br />
If you did not install cocoa in <code>/usr/local/</code><br />
then you need to correct the path in the files:<br />
* <code>&lt;path&gt;/cocoa-4.5/emacs/cocoa.emacs</code><br />
* <code>&lt;path&gt;/cocoa-4.5/cocoa</code><br />
<br />
=== MacOSX ===<br />
<br />
NB: MacOSX hides all file whose name start with ".", in particular '''.emacs'''.<br />
<br />
Go to the folder '''emacs''' in <b>CoCoA-4.5</b> and double-click on one of<br />
* <code>set-new-emacs-prefs</code> creates a brand new '''.emacs''' file (and moves the old one, if you had one, into previous.emacs)<br />
* <code>set-add-emacs-prefs</code> adds one line to your current <b>.emacs</b> file (creating it if necessary)<br />
<br />
=== MSWindows ===<br />
<br />
There is a file called "_emacs" in your cocoa-4.5/emacs directory.<br />
Move it up one directory, i.e. into cocoa-4.5<br />
<br />
After this you should make sure that your "HOME" variable is set to the cocoa-4.5 directory. (supposing that the average Windows user does not use the variable "HOME" for anything else) <br />
<br />
Emacs just evaluates %HOME% when looking for its config file, i.e. _emacs. To set it right click on "My Computer", click on "properties" and then on the "Advanced" tab. Then click on the button "Environment Variables". Another dialog pops up and you add HOME by pressing on "new" and filling in the appropriate values. The upper "new" sets HOME for all users and requires admin-rights, the lower "new" sets it just for the current user.<br />
<br />
<br />
[[Category:CoCoA4]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoA:Emacs_interface&diff=375CoCoA:Emacs interface2005-11-09T15:06:07Z<p>Bigatti: added installation instruction</p>
<hr />
<div>== cocoa-mode == <br />
<br />
The distribution of cocoa-4.5 includes an <code>emacs/</code> directory which contains <code>cocoa.el</code> and <code>cocoa.emacs</code> (the settings to be added to your <code>.emacs</code>).<br />
<br />
* a friendly '''CoCoA''' menu<br />
* automatic indentation <br />
* coloured syntax (in font-lock-mode - default) <br />
* capitalization of keywords (in abbrev-mode - default) <br />
* automatic loading of <code>wordlist.txt</code> for dynamic abbrev expansion (<code>M-/</code> or <code>ESC /</code> or <code>TAB /</code>) <br />
<br />
=== CoCoA menu === <br />
[[Image:CoCoAMenu.jpg|right|CoCoA menu for cocoa-mode]]<br />
From the menu you can <br />
* send lines, regions and files to cocoa<br />
* go to the parse error line (if you had a parse error after sending a file) <br />
* start or restart the CoCoAServer<br />
<br />
<code>Use TAB for Completion</code> (available soon) will allows to toggle this option. It used to be always off up to cocoa-4.4, and always on in cocoa-4.5.<br />
<br />
=== Some key bindings in cocoa-mode ===<br />
<br />
* <code>C-c C-e</code> (like in latex-mode) writes the appropriate "End" (EndIf,...) <br />
* <code>C-c C-c</code> (like in c-mode) comment-region<br />
<br />
If the following features do not work you should customize the variable <code>cocoa-executable</code> in '''cocoa.emacs''': <br />
<br />
=== Calling CoCoA ===<br />
From a buffer in '''cocoa-mode''' you can select things and "send" them to a cocoa buffer (called <code>*cocoa*</code>) to be evaluated:<br />
<br />
; <code>C-c C-l</code> : execute this line (from any point in the line)<br />
; <code>C-c C-r</code> : execute the selected region<br />
; <code>C-c C-f</code> : execute all this file (from any point in thefile)<br />
; <code>C-c C-p</code> : go to the parse error line (if C-c C-f gave a parse error) <br />
; <code>C-c C-m</code> or <code>C-c ?</code> : call the CoCoA manual for this word (from any point in the word)<br />
<br />
They will automatically start CoCoA (if it isn't already running in a <code>*cocoa*</code> buffer).<br />
<br />
; <code>M-x cocoa</code> : opens a buffer (called <code>*cocoa*</code>) with a running CoCoA<br />
<br />
<br />
== Installation instructions for Unix/Linux ==<br />
<br />
Open your <code>.emacs</code> file with any editor <br />
(it should be in your home, and it may not exist!):<br />
<br />
* If you are familiar about changing your '''.emacs''', then copy the settings you want from <code>cocoa-4.5/emacs/cocoa.emacs</code>.<br />
<br />
* If you are not then just add this line at the end of your '''.emacs''':<br> <code>(load-file "&lt;path&gt;/emacs/cocoa.emacs")</code> <br> for example: <code>(load-file "/usr/local/cocoa-4.5/emacs/cocoa.emacs")</code><br />
<br />
If you did not install cocoa in <code>/usr/local/</code><br />
then you need to correct the path in the files:<br />
* <code>&lt;path&gt;/cocoa-4.5/emacs/cocoa.emacs</code><br />
* <code>&lt;path&gt;/cocoa-4.5/cocoa</code><br />
<br />
<br />
== Installation instructions for MacOSX ==<br />
<br />
NB: MacOSX hides all file whose name start with "."<br />
<br />
'''For Emacs experts:''' copy the settings you want from CoCoA-4.5/emacs/cocoa.emacs into your ~/.emacs.<br />
<br />
'''For everyone else:''' go to the folder '''emacs''' in <b>CoCoA-4.5</b> and double-click on one of<br />
* <code>set-new-emacs-prefs</code> creates a brand new '''.emacs''' file (and moves the old one, if you had one, into previous.emacs)<br />
* <code>set-add-emacs-prefs</code> adds one line to your current <b>.emacs</b> file (creating it if necessary)<br />
<br />
<br />
ALL SET!! Now Emacs recognises files with a CoCoA extension (<code>.coc, .cocoa, .cpkg</code>): REMEMBER to add one to the name of your files!<br />
<br />
== Installation instructions for MSWindows ==<br />
<br />
There is a file called "_emacs" in your cocoa-4.5/emacs directory.<br />
Move it up one directory, i.e. into cocoa-4.5<br />
<br />
After this you should make sure that your "HOME" variable is set to the cocoa-4.5 directory. (supposing that the average Windows user does not use the variable "HOME" for anything else) <br />
<br />
Emacs just evaluates %HOME% when looking for its config file, i.e. _emacs. To set it right click on "My Computer", click on "properties" and then on the "Advanced" tab. Then click on the button "Environment Variables". Another dialog pops up and you add HOME by pressing on "new" and filling in the appropriate values. The upper "new" sets HOME for all users and requires admin-rights, the lower "new" sets it just for the current user.<br />
<br />
<br />
[[Category:CoCoA4]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoA:Emacs_interface&diff=374CoCoA:Emacs interface2005-10-19T11:08:13Z<p>Bigatti: slowly updating ("go to parse error line")</p>
<hr />
<div>== cocoa-mode == <br />
<br />
The distribution of cocoa-4.5 includes an <code>emacs/</code> directory which contains <code>cocoa.el</code> and <code>cocoa.emacs</code> (the settings to be added to your <code>.emacs</code>).<br />
<br />
* a friendly '''CoCoA''' menu<br />
* automatic indentation <br />
* coloured syntax (in font-lock-mode - default) <br />
* capitalization of keywords (in abbrev-mode - default) <br />
* automatic loading of <code>wordlist.txt</code> for dynamic abbrev expansion (<code>M-/</code> or <code>ESC /</code> or <code>TAB /</code>) <br />
<br />
=== CoCoA menu === <br />
[[Image:CoCoAMenu.jpg|right|CoCoA menu for cocoa-mode]]<br />
From the menu you can <br />
* send lines, regions and files to cocoa<br />
* go to the parse error line (if you had a parse error after sending a file) <br />
* start or restart the CoCoAServer<br />
<br />
=== Some key bindings in cocoa-mode ===<br />
<br />
* <code>C-c C-e</code> (like in latex-mode) writes the appropriate "End" (EndIf,...) <br />
* <code>C-c C-c</code> (like in c-mode) comment-region<br />
<br />
If the following features do not work you should customize the variable <code>cocoa-executable</code> in '''cocoa.emacs''': <br />
<br />
=== Calling CoCoA ===<br />
From a buffer in '''cocoa-mode''' you can select things and "send" them to a cocoa buffer (called <code>*cocoa*</code>) to be evaluated:<br />
<br />
; <code>C-c C-l</code> : execute this line (from any point in the line)<br />
; <code>C-c C-r</code> : execute the selected region<br />
; <code>C-c C-f</code> : execute all this file (from any point in thefile)<br />
; <code>C-c C-p</code> : go to the parse error line (if C-c C-f gave a parse error) <br />
; <code>C-c C-m</code> or <code>C-c ?</code> : call the CoCoA manual for this word (from any point in the word)<br />
<br />
They will automatically start CoCoA (if it isn't already running in a <code>*cocoa*</code> buffer).<br />
<br />
; <code>M-x cocoa</code> : opens a buffer (called <code>*cocoa*</code>) with a running CoCoA<br />
<br />
[[Category:CoCoA4]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoA:Emacs_interface&diff=358CoCoA:Emacs interface2005-10-19T10:20:18Z<p>Bigatti: added CoCoA menu picture</p>
<hr />
<div>== cocoa-mode == <br />
<br />
The distribution of cocoa-4.5 includes an <code>emacs/</code> directory which contains <code>cocoa.el</code> and <code>cocoa.emacs</code> (the settings to be added to your <code>.emacs</code>).<br />
<br />
* a friendly '''CoCoA''' menu<br />
* automatic indentation <br />
* coloured syntax (in font-lock-mode - default) <br />
* capitalization of keywords (in abbrev-mode - default) <br />
* automatic loading of <code>wordlist.txt</code> for dynamic abbrev expansion (<code>M-/</code> or <code>ESC /</code> or <code>TAB /</code>) <br />
<br />
=== CoCoA menu === <br />
[[Image:CoCoAMenu.jpg|right|CoCoA menu for cocoa-mode]]<br />
From the menu you can <br />
* send lines, regions and files to cocoa<br />
* (if you had a parse error after sending a file) go to the parse error line<br />
* start or restart the CoCoAServer<br />
<br />
=== Some key bindings in cocoa-mode ===<br />
<br />
* <code>C-c C-e</code> (like in latex-mode) writes the appropriate "End" (EndIf,...) <br />
* <code>C-c C-c</code> (like in c-mode) comment-region<br />
<br />
If the following features do not work you should customize the variable <code>cocoa-executable</code> in '''cocoa.emacs''': <br />
<br />
=== Calling CoCoA ===<br />
From a buffer in '''cocoa-mode''' you can select things and "send" them to a cocoa buffer (called <code>*cocoa*</code>) to be evaluated:<br />
<br />
* <code>C-c C-l</code> (evaluate line)<br />
* <code>C-c C-r</code> (evaluate region)<br />
* <code>C-c C-f</code> (evaluate file)<br />
* <code>C-c C-m</code> or <code>C-c ?</code> (evaluate CoCoA manual for the word under the cursor)<br />
<br />
They will automatically start CoCoA (if it isn't already running in a <code>*cocoa*</code> buffer).<br />
<br />
* <code>M-x cocoa</code> opens a buffer (called <code>*cocoa*</code>) with a running CoCoA<br />
<br />
[[Category:CoCoA4]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=File:CoCoAMenu.jpg&diff=1492File:CoCoAMenu.jpg2005-10-19T10:15:47Z<p>Bigatti: CoCoA menu under cocoa-mode in Emacs</p>
<hr />
<div>CoCoA menu under cocoa-mode in Emacs</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoA:Emacs_interface&diff=357CoCoA:Emacs interface2005-10-19T10:14:35Z<p>Bigatti: </p>
<hr />
<div>== cocoa-mode == <br />
<br />
The distribution of cocoa-4.5 includes an <code>emacs/</code> directory which contains <code>cocoa.el</code> and <code>cocoa.emacs</code> (the settings to be added to your <code>.emacs</code>).<br />
<br />
* a friendly '''CoCoA''' menu<br />
* automatic indentation <br />
* coloured syntax (in font-lock-mode - default) <br />
* capitalization of keywords (in abbrev-mode - default) <br />
* automatic loading of <code>wordlist.txt</code> for dynamic abbrev expansion (<code>M-/</code> or <code>ESC /</code> or <code>TAB /</code>) <br />
<br />
=== CoCoA menu ===<br />
[[Image:CoCoAMenu]]<br />
From the menu you can <br />
* send lines, regions and files to cocoa<br />
* (if you had a parse error after sending a file) go to the parse error line<br />
* start or restart the CoCoAServer<br />
<br />
=== Some key bindings in cocoa-mode ===<br />
<br />
* <code>C-c C-e</code> (like in latex-mode) writes the appropriate "End" (EndIf,...) <br />
* <code>C-c C-c</code> (like in c-mode) comment-region<br />
<br />
If the following features do not work you should customize the variable <code>cocoa-executable</code> in '''cocoa.emacs''': <br />
<br />
=== Calling CoCoA ===<br />
From a buffer in '''cocoa-mode''' you can select things and "send" them to a cocoa buffer (called <code>*cocoa*</code>) to be evaluated:<br />
<br />
* <code>C-c C-l</code> (evaluate line)<br />
* <code>C-c C-r</code> (evaluate region)<br />
* <code>C-c C-f</code> (evaluate file)<br />
* <code>C-c C-m</code> or <code>C-c ?</code> (evaluate CoCoA manual for the word under the cursor)<br />
<br />
They will automatically start CoCoA (if it isn't already running in a <code>*cocoa*</code> buffer).<br />
<br />
* <code>M-x cocoa</code> opens a buffer (called <code>*cocoa*</code>) with a running CoCoA<br />
<br />
[[Category:CoCoA4]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoA:Emacs_interface&diff=356CoCoA:Emacs interface2005-10-17T16:25:19Z<p>Bigatti: still working on it...</p>
<hr />
<div>== cocoa-mode == <br />
<br />
The distribution of cocoa-4.5 includes an <code>emacs/</code> directory which contains <code>cocoa.el</code> and <code>cocoa.emacs</code> (the settings to be added to your <code>.emacs</code>).<br />
<br />
* a friendly '''CoCoA''' menu<br />
* automatic indentation <br />
* coloured syntax (in font-lock-mode - default) <br />
* capitalization of keywords (in abbrev-mode - default) <br />
* automatic loading of <code>wordlist.txt</code> for dynamic abbrev expansion (<code>M-/</code> or <code>ESC /</code> or <code>TAB /</code>) <br />
<br />
=== CoCoA menu ===<br />
<br />
From the menu you can <br />
* send lines, regions and files to cocoa<br />
* (if you had a parse error after sending a file) go to the parse error line<br />
* start or restart the CoCoAServer<br />
<br />
=== Some key bindings in cocoa-mode ===<br />
<br />
* <code>C-c C-e</code> (like in latex-mode) writes the appropriate "End" (EndIf,...) <br />
* <code>C-c C-c</code> (like in c-mode) comment-region<br />
<br />
If the following features do not work you should customize the variable <code>cocoa-executable</code> in '''cocoa.emacs''': <br />
<br />
=== Calling CoCoA ===<br />
From a buffer in '''cocoa-mode''' you can select things and "send" them to a cocoa buffer (called <code>*cocoa*</code>) to be evaluated:<br />
<br />
* <code>C-c C-l</code> (evaluate line)<br />
* <code>C-c C-r</code> (evaluate region)<br />
* <code>C-c C-f</code> (evaluate file)<br />
* <code>C-c C-m</code> or <code>C-c ?</code> (evaluate CoCoA manual for the word under the cursor)<br />
<br />
They will automatically start CoCoA (if it isn't already running in a <code>*cocoa*</code> buffer).<br />
<br />
* <code>M-x cocoa</code> opens a buffer (called <code>*cocoa*</code>) with a running CoCoA<br />
<br />
[[Category:CoCoA4]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoA:Emacs_interface&diff=347CoCoA:Emacs interface2005-10-14T14:22:45Z<p>Bigatti: just settling</p>
<hr />
<div>Dowload [http://cocoa.dima.unige.it/download/emacs CoCoA on Emacs]<br />
<br />
== cocoa-mode provides == <br />
<br />
* a friendly '''CoCoA''' menu<br />
* automatic indentation <br />
* coloured syntax (in font-lock-mode - default) <br />
* capitalization of keywords (in abbrev-mode - default) <br />
* automatic loading of CoCoA <code>wordlist.txt</code> for dynamic abbrev expansion (<code>M-/</code> or <code>ESC /</code>) <br />
<br />
== Some key bindings in cocoa-mode == <br />
<br />
* <code>C-c C-e</code> (like in latex-mode) writes the appropriate "End" (EndIf,...) <br />
* <code>C-c C-c</code> (like in c-mode) comment-region<br />
<br />
If the following features do not work you should customize the variable <code>cocoa-executable</code> in '''cocoa.emacs''': <br />
<br />
=== Calling CoCoA ===<br />
From a buffer in '''cocoa-mode''' you can select things and "send" them to a cocoa buffer (called <code>*cocoa*</code>) to be evaluated:<br />
<br />
* <code>C-c C-l</code> (evaluate line)<br />
* <code>C-c C-r</code> (evaluate region)<br />
* <code>C-c C-f</code> (evaluate file)<br />
* <code>C-c C-m</code> or <code>C-c ?</code> (evaluate CoCoA manual for the word under the cursor)<br />
<br />
They will automatically start CoCoA (if it isn't already running in a <code>*cocoa*</code> buffer).<br />
<br />
* <code>M-x cocoa</code> opens a buffer (called <code>*cocoa*</code>) with a running CoCoA<br />
<br />
[[Category:CoCoA4]]</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=CoCoA:Emacs_interface&diff=328CoCoA:Emacs interface2005-10-14T14:09:01Z<p>Bigatti: first draft for the emacs page</p>
<hr />
<div>== cocoa-mode provides == <br />
<br />
* a friendly '''CoCoA''' menu<br />
* automatic indentation <br />
* coloured syntax (in font-lock-mode - default) <br />
* capitalization of keywords (in abbrev-mode - default) <br />
* automatic loading of CoCoA <code>wordlist.txt</code> for dynamic abbrev expansion (<code>M-/</code> or <code>ESC /</code>) <br />
<br />
== Some key bindings in cocoa-mode == <br />
<br />
* <font color=blue>C-c C-e</font> (like in latex-mode) writes the appropriate "End" (EndIf,...) <br />
* <font color=blue>C-c C-c</font> (like in c-mode) comment-region<br />
<br />
If the following features do not work you should customize the variable <code>cocoa-executable</code> in '''cocoa.emacs''': <br />
<br />
==== Calling CoCoA ====<br />
From a buffer in '''cocoa-mode''' you can select things and "send" them to a cocoa buffer (called <code>*cocoa*</code>) to be evaluated:<br />
<br />
* <font color=blue>C-c C-l</font> (evaluate line)<br />
* <font color=blue>C-c C-r</font> (evaluate region)<br />
* <font color=blue>C-c C-f</font> (evaluate file)<br />
* <font color=blue>C-c C-m</font> or <code>C-c ?</code> (evaluate CoCoA manual for the word under the cursor)<br />
<br />
They will automatically start CoCoA (if it isn't already running in a <code>*cocoa*</code> buffer).<br />
<br />
* <code>M-x cocoa</code> opens a buffer (called <code>*cocoa*</code>) with a running CoCoA</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=Talk:CoCoA4.4_Buglist&diff=1485Talk:CoCoA4.4 Buglist2005-10-11T14:57:23Z<p>Bigatti: Talk:CoCoA4.4 Buglist moved to Talk:CoCoA-4.4 Buglist</p>
<hr />
<div>#REDIRECT [[Talk:CoCoA-4.4 Buglist]]<br />
</div>Bigattihttp://apcocoa.uni-passau.de/wiki/index.php?title=Category_talk:Documentation&diff=1456Category talk:Documentation2005-07-18T13:21:08Z<p>Bigatti: </p>
<hr />
<div>I think we should move [[:Category:Documentation]] to Documentation CoCoALib, du to the reason, that we perhaps want to have later on also categorys documentating a cocoa 5 client, or cocoa 4 or...<br />
<br />
[[User:Dheldt|dheldt]] 14:58, 18 Jul 2005 (CEST)<br />
<br />
:ok, I'm not so sure about these other categories, but I had thought myself of calling it CoCoALib_Documentation ;-)<br />
:<br />
:[[User:Bigatti|Bigatti]] 15:21, 18 Jul 2005 (CEST)</div>Bigatti