Difference between revisions of "ApCoCoA-1:MatlabCoCoAIdeal"

From ApCoCoAWiki
(Category added)
m (Table format change)
 
(One intermediate revision by the same user not shown)
Line 14: Line 14:
 
     <table border="1">
 
     <table border="1">
 
       <tr>
 
       <tr>
         <td> basering </td><td>&nbsp;</td><td> A CoCoARing
+
         <td> basering </td><td> A CoCoARing
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> gens </td><td>&nbsp;</td><td> an array of polynomials
+
         <td> gens </td><td> an array of polynomials
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> gBasis </td><td>&nbsp;</td><td> the Groebner-Basis of an Ideal
+
         <td> gBasis </td><td> the Groebner-Basis of an Ideal
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> numBasisElements </td><td>&nbsp;</td><td> The number of basis elements. If gBasis is not yet computed the number of generators is stored.
+
         <td> numBasisElements </td><td> The number of basis elements. If gBasis is not yet computed the number of generators is stored.
 
       </tr>
 
       </tr>
 
     </table>
 
     </table>
Line 31: Line 31:
 
     <table border="1">
 
     <table border="1">
 
       <tr>
 
       <tr>
         <td><b>Method</b></td><td>&nbsp;</td><td><b>Operator</b></td><td><b>Description</b></td>
+
         <td><b>Method</b></td><td><b>Operator</b></td><td><b>Description</b></td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> computeGBasis </td><td>&nbsp;</td><td>&nbsp;</td><td> computes the GBasis of the given Ideal and returns a new ideal with the same set of generators and the computed GBasis.</td>
+
         <td> computeGBasis </td><td>&nbsp;</td><td> computes the GBasis of the given Ideal and returns a new ideal with the same set of generators and the computed GBasis.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> computeLT </td><td>&nbsp;</td><td>&nbsp;</td><td> computes the leading term of the ideal. Returns a CoCoAPoly.</td>
+
         <td> computeLT </td><td>&nbsp;</td><td> computes the leading term of the ideal. Returns a CoCoAPoly.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> display </td><td>&nbsp;</td><td>&nbsp;</td><td> Is used by Matlab to print a CoCoAIdeal to the command window. E.g. when a command is not terminated by a ';'.</td>
+
         <td> display </td><td>&nbsp;</td><td> Is used by Matlab to print a CoCoAIdeal to the command window. E.g. when a command is not terminated by a ';'.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> eq </td><td>&nbsp;</td><td>==</td><td> Compares two ideals. Returns 1 if all generators are equal.</td>
+
         <td> eq </td><td>==</td><td> Compares two ideals. Returns 1 if all generators are equal.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> ge </td><td>&nbsp;</td><td>>=</td><td> Compares two ideals according to their leading term. Returns 1 if first ideal is greater equal the second ideal.</td>
+
         <td> ge </td><td>>=</td><td> Compares two ideals according to their leading term. Returns 1 if first ideal is greater equal the second ideal.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> get </td><td>&nbsp;</td><td>&nbsp;</td><td> Returns the attributes of an ideal. Syntax: get(idealVar, 'Keyword'), where idealVar is a CoCoAIdeal and 'Keyword' is one of the keywords:
+
         <td> get </td><td>&nbsp;</td><td> Returns the attributes of an ideal. Syntax: <br>
'BaseRing': Returns the ring over which the polynomials in the generator list are defined.
+
get(idealVar, 'Keyword'), where idealVar is a CoCoAIdeal and 'Keyword' is one of the keywords:<br>
'Gens': returns the generator array of CoCoAPoly's
+
'BaseRing': Returns the ring over which the polynomials in the generator list are defined.<br>
'GBasis': returns the GBasis of the Ideal if it has been computed. Otherwise [] is returned.
+
'Gens': returns the generator array of CoCoAPoly's<br>
'NumElements': Returns the number of basis elements. If gBasis is not yet computed the number of generators is returned.
+
'GBasis': returns the GBasis of the Ideal if it has been computed. Otherwise [] is returned.<br>
'String': Returns the polynomial as a string.
+
'NumElements': Returns the number of basis elements. If gBasis is not yet computed the number of generators is returned.<br>
 +
'String': Returns the polynomial as a string.<br>
 
'Latex' will return a string using Latex syntax.</td>
 
'Latex' will return a string using Latex syntax.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> gt </td><td>&nbsp;</td><td>></td><td> Compares two ideals according to their leading term. Returns 1 if first ideal is greater than the second ideal.</td>
+
         <td> gt </td><td>></td><td> Compares two ideals according to their leading term. Returns 1 if first ideal is greater than the second ideal.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> isContained </td><td>&nbsp;</td><td>&nbsp;</td><td> Returns 1 if the first ideal is contained in the second ideal.</td>
+
         <td> isContained </td><td>&nbsp;</td><td> Returns 1 if the first ideal is contained in the second ideal.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> isElem </td><td>&nbsp;</td><td>&nbsp;</td><td> Returns 1 if the polynomial (2. argument) is in the ideal (1. argument)</td>
+
         <td> isElem </td><td>&nbsp;</td><td> Returns 1 if the polynomial (2. argument) is in the ideal (1. argument)</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> le </td><td>&nbsp;</td><td><=</td><td> Compares two ideals according to their leading term. Returns 1 if first ideal is less equal the second ideal.</td>
+
         <td> le </td><td><=</td><td> Compares two ideals according to their leading term. Returns 1 if first ideal is less equal the second ideal.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> lt </td><td>&nbsp;</td><td><</td><td> Compares two ideals according to their leading term. Returns 1 if first ideal is less than the second ideal.</td>
+
         <td> lt </td><td><</td><td> Compares two ideals according to their leading term. Returns 1 if first ideal is less than the second ideal.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> ne </td><td>&nbsp;</td><td>~=</td><td> returns NOT eq.</td>
+
         <td> ne </td><td>~=</td><td> returns NOT eq.</td>
 
       </tr>
 
       </tr>
 
     </table>
 
     </table>
Line 81: Line 82:
 
* Ideal generated by two polynomials.
 
* Ideal generated by two polynomials.
 
<matlab>
 
<matlab>
p1 = CoCoAPoly(<span class="string">'x^2-1'</span>);
+
p1 = CoCoAPoly('x^2-1');
p2 = CoCoAPoly(<span class="string">'y+x'</span>);
+
p2 = CoCoAPoly('y+x');
 
myIdeal = CoCoAIdeal([p1 p2]);
 
myIdeal = CoCoAIdeal([p1 p2]);
 
</matlab>
 
</matlab>
  
 
[[Category:MatlabToolbox]]
 
[[Category:MatlabToolbox]]

Latest revision as of 16:54, 19 June 2008

Introduction

The CoCoAIdeal class represents an ideal of polynomials over a given polynomial ring (See <a href="MatlabCoCoAPoly.html">Poly class</a>).

Constructor

The constructor for a CoCoAIdeal can have two arguments:

  • Generators: Array of polynomials
  • Optional: 1/0 : 1 = Compute Groebner-Basis of Ideal

If no input is given the default ideal (1) over Q[x[1]] is returned Generators should be a 1xn CoCoAPoly array. A nx1 array is transposed.

Attributes

basering A CoCoARing
gens an array of polynomials
gBasis the Groebner-Basis of an Ideal
numBasisElements The number of basis elements. If gBasis is not yet computed the number of generators is stored.

Methods

MethodOperatorDescription
computeGBasis   computes the GBasis of the given Ideal and returns a new ideal with the same set of generators and the computed GBasis.
computeLT   computes the leading term of the ideal. Returns a CoCoAPoly.
display   Is used by Matlab to print a CoCoAIdeal to the command window. E.g. when a command is not terminated by a ';'.
eq == Compares two ideals. Returns 1 if all generators are equal.
ge >= Compares two ideals according to their leading term. Returns 1 if first ideal is greater equal the second ideal.
get   Returns the attributes of an ideal. Syntax:

get(idealVar, 'Keyword'), where idealVar is a CoCoAIdeal and 'Keyword' is one of the keywords:
'BaseRing': Returns the ring over which the polynomials in the generator list are defined.
'Gens': returns the generator array of CoCoAPoly's
'GBasis': returns the GBasis of the Ideal if it has been computed. Otherwise [] is returned.
'NumElements': Returns the number of basis elements. If gBasis is not yet computed the number of generators is returned.
'String': Returns the polynomial as a string.

'Latex' will return a string using Latex syntax.
gt > Compares two ideals according to their leading term. Returns 1 if first ideal is greater than the second ideal.
isContained   Returns 1 if the first ideal is contained in the second ideal.
isElem   Returns 1 if the polynomial (2. argument) is in the ideal (1. argument)
le <= Compares two ideals according to their leading term. Returns 1 if first ideal is less equal the second ideal.
lt < Compares two ideals according to their leading term. Returns 1 if first ideal is less than the second ideal.
ne ~= returns NOT eq.

Examples

A collection of examples is provided in the file TestCoCoAIdeal.m. This file defines the function TestCoCoAIdeal which will run and display many examples. A few common examples are presented below.

  • Ideal generated by two polynomials.

<matlab> p1 = CoCoAPoly('x^2-1'); p2 = CoCoAPoly('y+x'); myIdeal = CoCoAIdeal([p1 p2]); </matlab>