Difference between revisions of "ApCoCoA-1:IML.Solve"

From ApCoCoAWiki
(Added parameter and return value list.)
m (insert version info)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Version|1}}
 
<command>
 
<command>
<title>IML.Solve</title>
+
  <title>IML.Solve</title>
<short_description>Solve a linear equation system.</short_description>
+
  <short_description>Solves a system of linear equations.</short_description>
 +
 
 
<syntax>
 
<syntax>
 
IML.Solve(M:MAT, B:MAT):MAT
 
IML.Solve(M:MAT, B:MAT):MAT
 
</syntax>
 
</syntax>
<description>
+
  <description>
{{ApCoCoAServer}} Please also note that you need an ApCoCoAServer with enabled IML support.
+
<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/>
 
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 library.
 
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 library.
 
+
<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.
 
<itemize>
 
<itemize>
 
   <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>@return A matrix X representing a solution vector of the linear equation system M*X = B.</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>
 
<example>
 
<example>
Use Z/(19)[x];
+
Use ZZ/(19)[x];
 
M := BringIn(Mat([[1,3,4], [0,2,1]]));
 
M := BringIn(Mat([[1,3,4], [0,2,1]]));
 
B := BringIn(Mat([[1], [2]]));
 
B := BringIn(Mat([[1], [2]]));
Line 28: Line 30:
 
])
 
])
 
-------------------------------
 
-------------------------------
 
+
</example>
Use Q[x];
+
<example>
 +
Use QQ[x];
 
M := Mat([ [1,3,4], [0,2,1], [1,3,4] ]);
 
M := Mat([ [1,3,4], [0,2,1], [1,3,4] ]);
 
B := Mat([ [1], [2], [0] ]);
 
B := Mat([ [1], [2], [0] ]);
Line 39: Line 42:
 
-------------------------------
 
-------------------------------
 
</example>
 
</example>
</description>
+
  </description>
<see>LinBox.Solve</see>
+
 
<see>LinKer</see>
+
  <see>ApCoCoA-1:Introduction to CoCoAServer|Introduction to CoCoAServer</see>
<types>
+
  <see>ApCoCoA-1:LinAlg.Solve|LinAlg.Solve</see>
  <type>cocoaserver</type>
+
  <see>ApCoCoA-1:LinBox.Solve|LinBox.Solve</see>
</types>
+
  <see>ApCoCoA-1:LinKer|LinKer</see>
<key>solve</key>
+
  <types>
<key>solve linear equation system</key>
+
    <type>matrix</type>
<key>solve linear equation</key>
+
    <type>apcocoaserver</type>
<key>kaspar</key>
+
  </types>
<wiki-category>Package_iml</wiki-category>
+
  <key>Solve</key>
 +
  <key>IML.Solve</key>
 +
  <key>iml.Solve</key>
 +
  <key>solve linear equation system</key>
 +
  <key>solve linear equation</key>
 +
  <wiki-category>ApCoCoA-1:Package_iml</wiki-category>
 
</command>
 
</command>

Latest revision as of 10:09, 7 October 2020

This article is about a function from ApCoCoA-1.

IML.Solve

Solves a system of linear equations.

Syntax

IML.Solve(M:MAT, B:MAT):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 library.

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.

  • @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.

Example

Use ZZ/(19)[x];
M := BringIn(Mat([[1,3,4], [0,2,1]]));
B := BringIn(Mat([[1], [2]]));
IML.Solve(M, B);
-------------------------------
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] ]);
IML.Solve(M, B);
-------------------------------
Mat([
  [ ]
])
-------------------------------

Introduction to CoCoAServer

LinAlg.Solve

LinBox.Solve

LinKer