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

From ApCoCoAWiki
(Created first version)
 
(Description update due to extended LinBox support)
Line 4: Line 4:
 
<syntax>
 
<syntax>
 
LinBox.Solve(M:MAT, B:MAT):MAT
 
LinBox.Solve(M:MAT, B:MAT):MAT
 +
LinBox.Solve(M:MAT, B:MAT, METHOD:STRING):MAT
 
</syntax>
 
</syntax>
 
<description>
 
<description>
This functions tries to solve the linear equation system <tt>M*X = B</tt>. The return value is of type MAT and non-empty if a solution exists. The computation is done by the ApCoCoAServer and LinBox functions.
+
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 LinBox library. If your base ring is the ring of integers or a finite field, you can pass <tt>Wiedemann</tt> as <tt>METHOD</tt> to let the ApCoCoAServer compute the solution by using the LinBox Wiedemann implementation. If you pass <tt>BlasElim</tt> instead in this case, the solution will be computed by using the LinBox BLAS elimination implementation. If you omit the parameter <tt>METHOD</tt>, <tt>Wiedemann</tt> will be used as default value where applicable. Please note that the parameter <tt>METHOD</tt> will be ignored if your base ring is the field of rationals, i.e. in this case it is always the LinBox rational solver implementation that will be used for computing a solution.
 +
 
 
<example>
 
<example>
 
Use Z/(19)[x];
 
Use Z/(19)[x];

Revision as of 13:34, 28 October 2008

Solve

solve linear equation system

Syntax

LinBox.Solve(M:MAT, B:MAT):MAT
LinBox.Solve(M:MAT, B:MAT, METHOD:STRING):MAT

Description

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 LinBox library. If your base ring is the ring of integers or a finite field, you can pass Wiedemann as METHOD to let the ApCoCoAServer compute the solution by using the LinBox Wiedemann implementation. If you pass BlasElim instead in this case, the solution will be computed by using the LinBox BLAS elimination implementation. If you omit the parameter METHOD, Wiedemann will be used as default value where applicable. Please note that the parameter METHOD will be ignored if your base ring is the field of rationals, i.e. in this case it is always the LinBox rational solver implementation that will be used for computing a solution.

Example

Use Z/(19)[x];
M := BringIn(Mat([[1,3,4], [0,2,1]]));
B := BringIn(Mat([[1], [2]]));
LinBox.Solve(M, B);
-- CoCoAServer: computing Cpu Time = 0
-------------------------------
Mat([
  [-2 % 19],
  [1 % 19],
  [0 % 19]
])
-------------------------------
Use Q[x];
M := Mat([ [1,3,4], [0,2,1], [1,3,4] ]);
B := Mat([ [1], [2], [0] ]);
LinBox.Solve(M, B);
-- CoCoAServer: computing Cpu Time = 0
-------------------------------
Mat([
  [ ]
])
-------------------------------

LinKer