Difference between revisions of "ApCoCoA-1:MatlabCoCoARing"

From ApCoCoAWiki
(Tables updated)
m (Table format changed)
Line 36: Line 36:
 
<table border="1">
 
<table border="1">
 
       <tr>
 
       <tr>
         <td> typ </td><td>&nbsp;</td><td> Defines the coefficent ring. In the current implementation only Q  
+
         <td> typ </td><td> Defines the coefficent ring. In the current implementation only Q  
 
             - Ring of rational numbers - is available.</td>
 
             - Ring of rational numbers - is available.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> order </td><td>&nbsp;</td><td> Defines the order of the polynmoial ring. Usually a prime number or 0.</td>
+
         <td> order </td><td> Defines the order of the polynmoial ring. Usually a prime number or 0.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> noindets </td><td>&nbsp;</td><td> Stores the number of indeterminates.</td>
+
         <td> noindets </td><td> Stores the number of indeterminates.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> indets </td><td>&nbsp;</td><td> Holds the label of the indeterminates as a 1xNoindets cell array of strings.</td>
+
         <td> indets </td><td> Holds the label of the indeterminates as a 1xNoindets cell array of strings.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> ordering</td><td>&nbsp;</td><td> A matrix representing a degree compatible term ordering.</td>
+
         <td> ordering</td><td> A matrix representing a degree compatible term ordering.</td>
 
       </tr>
 
       </tr>
 
     </table>
 
     </table>
Line 57: Line 57:
 
<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> display </td><td>&nbsp;</td><td>&nbsp;</td><td> Is used by Matlab to print a CoCoARing 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 CoCoARing 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 rings and returns 1 in case that all attributes of the two rings are equal. Otherwise 0 is returned.</td>
+
         <td> eq </td><td>==</td><td> Compares two rings and returns 1 in case that all attributes of the two rings are equal. Otherwise 0 is returned.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> neq </td><td>&nbsp;</td><td>~=</td><td> returns NOT eq.</td>
+
         <td> neq </td><td>~=</td><td> returns NOT eq.</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> get </td><td>&nbsp;</td><td>&nbsp;</td><td> Returns the attributes of a ring. Syntax: get(ringVar, 'Keyword'), where ringVar is a CoCoARing and 'Keyword' is one of the keywords listed in table 1. Additionaly the keyword 'String' can be used. This will return the polynomial as a string. </td>
+
         <td> get </td><td>&nbsp;</td><td> Returns the attributes of a ring. Syntax: get(ringVar, 'Keyword'), where ringVar is a CoCoARing and 'Keyword' is one of the keywords listed in table 1. Additionaly the keyword 'String' can be used. This will return the polynomial as a string. </td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> one </td><td>&nbsp;</td><td>&nbsp;</td><td> returns the 1 polynomial of the polynomial ring</td>
+
         <td> one </td><td>&nbsp;</td><td> returns the 1 polynomial of the polynomial ring</td>
 
       </tr>
 
       </tr>
 
       <tr>
 
       <tr>
         <td> zero </td><td>&nbsp;</td><td>&nbsp;</td><td> returns the 0 polynomial of the polynomial ring</td>
+
         <td> zero </td><td>&nbsp;</td><td> returns the 0 polynomial of the polynomial ring</td>
 
       </tr>
 
       </tr>
 
     </table>
 
     </table>

Revision as of 16:52, 19 June 2008

Introduction

The CoCoARing class represents a polynomial ring structure. It stores the name of indeterminates defined over a coefficient ring which is defined in the typ attribute amongst other supporting attributes.

Constructor

The constructor function takes a parameter in the form 'keyword',value. For example to build a ring over Q use the keyword = 'Typ' and the value = 'Q'. The function is called CoCoARing().

Available keywords are listed below:

KeywordPossible ValuesDefault
Typ'Q','Z','RF','RD''Q'
Order0,1,2,...0
Noindets1,2,...1
Indets'auto', {'anyString1','anyString2',...}{'x[1]'}
Ordering'DegRevLex', 'DegLex', AnyTermOrderingMatrix1

Table 1: Keywords for CoCoARing


Note: The order of the keywords is not completly arbitrary:

  • The keyword Ordering can only be used after the keyword Indets.
  • Noindets should be defined before Indets otherwise result might not be correct as default value is used.

Attributes

typ Defines the coefficent ring. In the current implementation only Q - Ring of rational numbers - is available.
order Defines the order of the polynmoial ring. Usually a prime number or 0.
noindets Stores the number of indeterminates.
indets Holds the label of the indeterminates as a 1xNoindets cell array of strings.
ordering A matrix representing a degree compatible term ordering.

Methods

The following methods are available for rings:

MethodOperatorDescription
display   Is used by Matlab to print a CoCoARing to the command window. E.g. when a command is not terminated by a ';'.
eq == Compares two rings and returns 1 in case that all attributes of the two rings are equal. Otherwise 0 is returned.
neq ~= returns NOT eq.
get   Returns the attributes of a ring. Syntax: get(ringVar, 'Keyword'), where ringVar is a CoCoARing and 'Keyword' is one of the keywords listed in table 1. Additionaly the keyword 'String' can be used. This will return the polynomial as a string.
one   returns the 1 polynomial of the polynomial ring
zero   returns the 0 polynomial of the polynomial ring

Examples

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

  • Default ring Q[x[1]]:

<matlab> defaultRing = CoCoARing(); </matlab>

  • Q[x1,...,xN]: The only supported ring for the CoCoAPoly class at the moment is Q[x1,...,xN]. To generate this ring with a DegRevLex ordering over 3 indeterminates x,y and z use the following code:

<matlab> myR = CoCoARing('Typ','Q','Indets',{'x','y','z'},'Ordering','DegRevLex'); </matlab>

  • To generate the 1 and 0 polynomial of a CoCoARing use the following code:

<matlab> oneOfRing = one(myR); zeroOfRing = zero(myR); </matlab>

  • To read the attributes of a CoCoARing use the following command (this examples reads all attributes):

<matlab> [a1,a2,a3,a4,a5] = get(myR,'Typ','Order','Noindets','Indets','Ordering'); </matlab>