Difference between revisions of "ApCoCoA-1:LinAlg.Solve"
(Initial version.) |
m (replaced <quotes> tag by real quotes) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | {{Version|1}} | ||
<command> | <command> | ||
<title>LinAlg.Solve</title> | <title>LinAlg.Solve</title> | ||
Line 10: | Line 11: | ||
<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/> | ||
− | Let <tt>M</tt> and <tt>B</tt> be matrices defined over the ring of integers, a finite field or the field of rationals. This function tries to solve the linear equation system <tt>M*X = B</tt> by using the ApCoCoAServer supported by the IML or LinBox library (depending on the value of parameter <tt>BACKEND</tt>). Possible values for <tt>BACKEND</tt> are <tt>IML</tt> and <tt>LINBOX</tt>. If <tt>BACKEND</tt> is set to <tt>LINBOX</tt>, a fourth optional parameter <tt>METHOD</tt> may be specified. Please refer to <ref>LinBox.Solve</ref> for further details about this parameter. | + | Let <tt>M</tt> and <tt>B</tt> be matrices defined over the ring of integers, a finite field or the field of rationals. This function tries to solve the linear equation system <tt>M*X = B</tt> by using the ApCoCoAServer supported by the IML or LinBox library (depending on the value of parameter <tt>BACKEND</tt>). Possible values for <tt>BACKEND</tt> are <tt>IML</tt> and <tt>LINBOX</tt>. If <tt>BACKEND</tt> is set to <tt>LINBOX</tt>, a fourth optional parameter <tt>METHOD</tt> may be specified. Please refer to <ref>ApCoCoA-1:LinBox.Solve|LinBox.Solve</ref> for further details about this parameter. |
<par/> | <par/> | ||
The return value will be a solution vector of the linear equation system or an empty matrix if no solution has been found. | The return value will be a solution vector of the linear equation system or an empty matrix if no solution has been found. | ||
Line 16: | Line 17: | ||
<item>@param <em>M</em> A matrix with components either of type INT, ZMOD or RAT.</item> | <item>@param <em>M</em> A matrix with components either of type INT, ZMOD or RAT.</item> | ||
<item>@param <em>B</em> A matrix with components either of type INT, ZMOD or RAT.</item> | <item>@param <em>B</em> A matrix with components either of type INT, ZMOD or RAT.</item> | ||
− | <item>@param <em>BACKEND</em> Either the string | + | <item>@param <em>BACKEND</em> Either the string "IML" or "LINBOX".</item> |
<item>@return A matrix X representing a solution vector of the linear equation system M*X = B if a solution exists or the empty matrix otherwise.</item> | <item>@return A matrix X representing a solution vector of the linear equation system M*X = B if a solution exists or the empty matrix otherwise.</item> | ||
</itemize> | </itemize> | ||
The following parameter is optional. | The following parameter is optional. | ||
<itemize> | <itemize> | ||
− | <item>@param <em>METHOD</em> A string specifying the solution method to use. Available methods are | + | <item>@param <em>METHOD</em> A string specifying the solution method to use. Available methods are "Wiedemann" and "BlasElim". Please read the detailed description about this parameter, too.</item> |
</itemize> | </itemize> | ||
<example> | <example> | ||
Line 51: | Line 52: | ||
</description> | </description> | ||
− | <see>Introduction to CoCoAServer</see> | + | <see>ApCoCoA-1:Introduction to CoCoAServer|Introduction to CoCoAServer</see> |
− | <see>IML.Solve</see> | + | <see>ApCoCoA-1:IML.Solve|IML.Solve</see> |
− | <see>LinBox.Solve</see> | + | <see>ApCoCoA-1:LinBox.Solve|LinBox.Solve</see> |
− | <see>LinKer</see> | + | <see>ApCoCoA-1:LinKer|LinKer</see> |
<types> | <types> | ||
<type>matrix</type> | <type>matrix</type> | ||
Line 64: | Line 65: | ||
<key>solve linear equation system</key> | <key>solve linear equation system</key> | ||
<key>solve linear equation</key> | <key>solve linear equation</key> | ||
− | <wiki-category>Package_linalg</wiki-category> | + | <wiki-category>ApCoCoA-1:Package_linalg</wiki-category> |
</command> | </command> |
Latest revision as of 13:33, 29 October 2020
This article is about a function from ApCoCoA-1. |
LinAlg.Solve
Solves a system of linear equations.
Syntax
LinAlg.Solve(M:MAT, B:MAT, BACKEND:STRING):MAT LinAlg.Solve(M:MAT, B:MAT, BACKEND:STRING, METHOD: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.
Let M and B be matrices defined over the ring of integers, a finite field or the field of rationals. This function tries to solve the linear equation system M*X = B by using the ApCoCoAServer supported by the IML or LinBox library (depending on the value of parameter BACKEND). Possible values for BACKEND are IML and LINBOX. If BACKEND is set to LINBOX, a fourth optional parameter METHOD may be specified. Please refer to LinBox.Solve for further details about this parameter.
The return value will be a solution vector of the linear equation system or an empty matrix if no solution has been found.
@param M A matrix with components either of type INT, ZMOD or RAT.
@param B A matrix with components either of type INT, ZMOD or RAT.
@param BACKEND Either the string "IML" or "LINBOX".
@return A matrix X representing a solution vector of the linear equation system M*X = B if a solution exists or the empty matrix otherwise.
The following parameter is optional.
@param METHOD A string specifying the solution method to use. Available methods are "Wiedemann" and "BlasElim". Please read the detailed description about this parameter, too.
Example
Use ZZ/(19)[x]; M := BringIn(Mat([[1,3,4], [0,2,1]])); B := BringIn(Mat([[1], [2]])); LinAlg.Solve(M, B, "IML"); ------------------------------- Mat([ [-2 % 19], [1 % 19], [0 % 19] ]) -------------------------------
Example
Use QQ[x]; M := Mat([ [1,3,4], [0,2,1], [1,3,4] ]); B := Mat([ [1], [2], [0] ]); LinAlg.Solve(M, B, "IML"); ------------------------------- Mat([ [ ] ]) -------------------------------