Difference between revisions of "ApCoCoA-1:LinAlg.REF"
(Updated description.) |
|||
Line 4: | Line 4: | ||
<syntax> | <syntax> | ||
− | LinAlg.REF(M:MAT, CompRREF:BOOL):MAT | + | LinAlg.REF(M:MAT, CompRREF:BOOL, BACKEND:STRING):MAT |
− | LinAlg.REF(M:MAT, P:INT, CompRREF:BOOL):MAT | + | LinAlg.REF(M:MAT, P:INT, CompRREF:BOOL, BACKEND:STRING):MAT |
</syntax> | </syntax> | ||
<description> | <description> | ||
<em>Please note:</em> The function(s) explained on this page is/are using the <em>ApCoCoAServer</em>. You will have to start the ApCoCoAServer in order to use it/them. | <em>Please note:</em> The function(s) explained on this page is/are using the <em>ApCoCoAServer</em>. You will have to start the ApCoCoAServer in order to use it/them. | ||
<par/> | <par/> | ||
− | This function allows you to compute a (reduced) row echelon form of a matrix <tt>M</tt> defined over a field. If you want to use the first version without the parameter <tt>P</tt>, the components of the input matrix <tt>M</tt> must be castable to type <tt>RAT</tt> and your current working ring must be the same ring over which <tt>M</tt> has been defined. The second version of this function lets you compute a (reduced) row echelon form of <tt>M</tt> mod <tt>P</tt> and the components of <tt>M</tt> must be of type <tt>INT</tt>. | + | This function allows you to compute a (reduced) row echelon form of a matrix <tt>M</tt> defined over a field. If you want to use the first version without the parameter <tt>P</tt>, the components of the input matrix <tt>M</tt> must be castable to type <tt>RAT</tt> (<tt>BACKEND</tt> = <quotes>INTERNAL</quotes>) or <tt>ZMOD</tt> (<tt>BACKEND</tt> = <quotes>IML</quotes> or <tt>BACKEND</tt> = <quotes>LINBOX</quotes>) and your current working ring must be the same ring over which <tt>M</tt> has been defined. The second version of this function lets you compute a (reduced) row echelon form of <tt>M</tt> mod <tt>P</tt> and the components of <tt>M</tt> must be of type <tt>INT</tt>. |
<par/> | <par/> | ||
The parameter <tt>CompRREF</tt> lets you specify if you want to compute a row echelon form or the reduced row echelon form of <tt>M</tt>. If <tt>CompRREF</tt> is set to <tt>TRUE</tt>, the reduced row echelon form will be computed, and if it is set to <tt>FALSE</tt>, a row echelon form where all pivot elements are equal to one will be computed. | The parameter <tt>CompRREF</tt> lets you specify if you want to compute a row echelon form or the reduced row echelon form of <tt>M</tt>. If <tt>CompRREF</tt> is set to <tt>TRUE</tt>, the reduced row echelon form will be computed, and if it is set to <tt>FALSE</tt>, a row echelon form where all pivot elements are equal to one will be computed. | ||
+ | <par/> | ||
+ | The optional parameter <tt>BACKEND</tt> lets you choose between an internal implementation (<tt>BACKEND</tt> = <quotes>INTERNAL</quotes>) or IML or LinBox driven computations (<tt>BACKEND</tt> = <quotes>IML</quotes> or <tt>BACKEND</tt> = <quotes>LINBOX</quotes>). The default value of <tt>BACKEND</tt> is <quotes>INTERNAL</quotes>. | ||
<itemize> | <itemize> | ||
− | <item>@param <em>M</em> A matrix whose (reduced) row echelon form to compute. If parameter <tt>P</tt> is given, the components of <tt>M</tt> must be of type <tt>INT</tt>. Otherwise, they must be castable to type <tt>RAT</tt>.</item> | + | <item>@param <em>M</em> A matrix whose (reduced) row echelon form to compute. If parameter <tt>P</tt> is given, the components of <tt>M</tt> must be of type <tt>INT</tt>. Otherwise, they must be castable to type <tt>RAT</tt> or <tt>ZMOD</tt> (please see description above).</item> |
<item>@param <em>CompRREF</em> Set to <tt>TRUE</tt> if you want to compute the reduced row echelon form of <tt>M</tt> or to <tt>FALSE</tt> otherwise.</item> | <item>@param <em>CompRREF</em> Set to <tt>TRUE</tt> if you want to compute the reduced row echelon form of <tt>M</tt> or to <tt>FALSE</tt> otherwise.</item> | ||
<item>@return A (reduced) row echelon form of <tt>M</tt>.</item> | <item>@return A (reduced) row echelon form of <tt>M</tt>.</item> | ||
</itemize> | </itemize> | ||
− | The following | + | The following parameters are optional. |
<itemize> | <itemize> | ||
<item>@param <em>P</em> An integer value. If <tt>P</tt> is specified, the (reduced) row echelon form computation will be carried out over the ring <tt>Z/pZ</tt>.</item> | <item>@param <em>P</em> An integer value. If <tt>P</tt> is specified, the (reduced) row echelon form computation will be carried out over the ring <tt>Z/pZ</tt>.</item> | ||
+ | <item>@param <em>BACKEND</em> Allowed values are <quotes>IML</quotes>, <quotes>INTERNAL</quotes>, and <quotes>LINBOX</quotes>.</item> | ||
</itemize> | </itemize> | ||
<example> | <example> | ||
Use QQ[x,y]; | Use QQ[x,y]; | ||
M := Mat([[ 1/2, 1/3, 2], [200, 3000, 1], [2, 5, 17], [1, 1, 1]]); | M := Mat([[ 1/2, 1/3, 2], [200, 3000, 1], [2, 5, 17], [1, 1, 1]]); | ||
− | |||
LinAlg.REF(M, FALSE); | LinAlg.REF(M, FALSE); | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
------------------------------- | ------------------------------- | ||
Mat([ | Mat([ | ||
Line 45: | Line 42: | ||
Use QQ[x,y]; | Use QQ[x,y]; | ||
M := Mat([[ 1, 1, 2], [200, 3000, 1], [2, 5, 17], [1, 1, 1]]); | M := Mat([[ 1, 1, 2], [200, 3000, 1], [2, 5, 17], [1, 1, 1]]); | ||
− | |||
LinAlg.REF(M, 17, TRUE); | LinAlg.REF(M, 17, TRUE); | ||
+ | |||
+ | ------------------------------- | ||
Mat([ | Mat([ | ||
− | [1, | + | [1, 0, 0], |
− | [ | + | [0, 1, 0], |
− | [ | + | [0, 0, 1], |
− | [ | + | [0, 0, 0] |
]) | ]) | ||
+ | ------------------------------- | ||
+ | </example> | ||
+ | <example> | ||
+ | Use QQ[x,y]; | ||
+ | M := Mat([[ 1, 1, 2], [200, 3000, 1], [2, 5, 17], [1, 1, 1]]); | ||
+ | LinAlg.REF(M, 17, TRUE, "IML"); | ||
+ | |||
------------------------------- | ------------------------------- | ||
Mat([ | Mat([ | ||
Line 61: | Line 66: | ||
]) | ]) | ||
------------------------------- | ------------------------------- | ||
+ | </example> | ||
+ | <example> | ||
+ | Use ZZ/(239)[x]; | ||
+ | M := Mat([[1, 2, 3], [4, 5, 6], [7, 8, 9], [11, 12, 13]]); | ||
+ | LinAlg.REF(M, FALSE, "LINBOX"); | ||
+ | |||
+ | ------------------------------- | ||
+ | Mat([ | ||
+ | [1 % 239, 2 % 239, 3 % 239], | ||
+ | [0 % 239, 1 % 239, 2 % 239], | ||
+ | [0 % 239, 0 % 239, 0 % 239], | ||
+ | [0 % 239, 0 % 239, 0 % 239] | ||
+ | ]) | ||
</example> | </example> | ||
</description> | </description> |
Revision as of 18:56, 19 November 2010
LinAlg.REF
Computes a row echelon form of a matrix.
Syntax
LinAlg.REF(M:MAT, CompRREF:BOOL, BACKEND:STRING):MAT LinAlg.REF(M:MAT, P:INT, CompRREF:BOOL, BACKEND:STRING):MAT
Description
Please note: The function(s) explained on this page is/are using the ApCoCoAServer. You will have to start the ApCoCoAServer in order to use it/them.
This function allows you to compute a (reduced) row echelon form of a matrix M defined over a field. If you want to use the first version without the parameter P, the components of the input matrix M must be castable to type RAT (BACKEND = "INTERNAL") or ZMOD (BACKEND = "IML" or BACKEND = "LINBOX") and your current working ring must be the same ring over which M has been defined. The second version of this function lets you compute a (reduced) row echelon form of M mod P and the components of M must be of type INT.
The parameter CompRREF lets you specify if you want to compute a row echelon form or the reduced row echelon form of M. If CompRREF is set to TRUE, the reduced row echelon form will be computed, and if it is set to FALSE, a row echelon form where all pivot elements are equal to one will be computed.
The optional parameter BACKEND lets you choose between an internal implementation (BACKEND = "INTERNAL") or IML or LinBox driven computations (BACKEND = "IML" or BACKEND = "LINBOX"). The default value of BACKEND is "INTERNAL".
@param M A matrix whose (reduced) row echelon form to compute. If parameter P is given, the components of M must be of type INT. Otherwise, they must be castable to type RAT or ZMOD (please see description above).
@param CompRREF Set to TRUE if you want to compute the reduced row echelon form of M or to FALSE otherwise.
@return A (reduced) row echelon form of M.
The following parameters are optional.
@param P An integer value. If P is specified, the (reduced) row echelon form computation will be carried out over the ring Z/pZ.
@param BACKEND Allowed values are "IML", "INTERNAL", and "LINBOX".
Example
Use QQ[x,y]; M := Mat([[ 1/2, 1/3, 2], [200, 3000, 1], [2, 5, 17], [1, 1, 1]]); LinAlg.REF(M, FALSE); ------------------------------- Mat([ [1, 2/3, 4], [0, 1, -2397/8600], [0, 0, 1], [0, 0, 0] ]) -------------------------------
Example
Use QQ[x,y]; M := Mat([[ 1, 1, 2], [200, 3000, 1], [2, 5, 17], [1, 1, 1]]); LinAlg.REF(M, 17, TRUE); ------------------------------- Mat([ [1, 0, 0], [0, 1, 0], [0, 0, 1], [0, 0, 0] ]) -------------------------------
Example
Use QQ[x,y]; M := Mat([[ 1, 1, 2], [200, 3000, 1], [2, 5, 17], [1, 1, 1]]); LinAlg.REF(M, 17, TRUE, "IML"); ------------------------------- Mat([ [1, 0, 0], [0, 1, 0], [0, 0, 1], [0, 0, 0] ]) -------------------------------
Example
Use ZZ/(239)[x]; M := Mat([[1, 2, 3], [4, 5, 6], [7, 8, 9], [11, 12, 13]]); LinAlg.REF(M, FALSE, "LINBOX"); ------------------------------- Mat([ [1 % 239, 2 % 239, 3 % 239], [0 % 239, 1 % 239, 2 % 239], [0 % 239, 0 % 239, 0 % 239], [0 % 239, 0 % 239, 0 % 239] ])