Overload List
| # | Signature | Description |
|---|---|---|
| 1 | void ToeplitzSolve(TVec FirstRow, TVec B, TVec X) | Solves toeplitz system. |
| 2 | void ToeplitzSolve(TVec FirstRow, TVec FirstCol, TVec B, TVec X) | Solve a toepltiz system of linear equations. |
Overload 1: void ToeplitzSolve(TVec FirstRow, TVec B, TVec X)
Solves toeplitz system.
| # | Name | Description |
|---|---|---|
| 1 | FirstRow | Defines the first row R(0)..R(N-1) in the equation below. |
| 2 | B | Defines B vector in equation below. |
| 3 | X | Returns X vector in the equation below. |
Result: stored in self (calling object)
Remarks:
Solves toeplitz system, defined as:
[ R(0) R(1)* ... R(N-1)* ] [ X[1] ] = [ -B[1] ] [ R(1) R(0) ... R(N-2)* ] [ X[2] ] = [ -B[2] ] [ .... . . ] x [ . ] = [ . ] [ R(N-2) R(N-3) ... R(1)* ] [ X[N-1] ] = [ -B[N-1] ] [ R(N-1) R(N-2) ... R(0) ] [ X[N] ] = [ -B[N] ]
Overload 2: void ToeplitzSolve(TVec FirstRow, TVec FirstCol, TVec B, TVec X)
Solve a toepltiz system of linear equations.
| # | Name | Description |
|---|---|---|
| 1 | FirstRow | Defines the first row R(0)..R(N-1) in the equation below. Vector can be real or complex. |
| 2 | FirstCol | Defines the first column C(0)..C(N-2) in the equation below. FirstCol.Length must be equal to FirstRow.Length-1. Vector can be real or complex. |
| 3 | B | Defines B vector in equation below. |
| 4 | X | Returns X vector as solution in the equation below. |
Result: stored in self (calling object)
Remarks:
The procedures solves Toeplitz system of linear equations defined as:
[ R(0) R(1) ... R(N-1) ] [ X(0) ] = [ -B(0) ] [ C(0) R(0) ... R(N-2) ] [ X(1) ] = [ -B(1) ] [ .... . . ] x [ . ] = [ . ] [ C(N-1) C(N-2) ... R(1) ] [ X(N-2)] = [ -B(N-2) ] [ C(N-2) C(N-1) ... R(0) ] [ X(N-1)] = [ -B(N-1) ]
The computational complexity of the algorithm is O(n2) as oposed to at least O(n3) for solving a general matrix.
Examples
using Dew.Math;
using Dew.Math.Units;
using Dew.Math.Editors;
namespace Dew.Examples
{
private void Example()
{
Vector FirstRow = new Vector(0);
Vector FirstCol = new Vector(0);
Vector X1 = new Vector(0);
Vector X2 = new Vector(0);
Vector B = new Vector(0);
Vector R = new Vector(0;
Matrix A = new Matrix(0,0);
FirstRow.SetIt(false,new double[] {1,2,3,4});
FirstCol.SetIt(false,new double[] {2,3,4});
A.Toeplitz(FirstRow,FirstCol);
B.SetIt(false, new double[] {-2,-3,-4,-5});
R.Copy(FirstRow);
R.Resize(5);
R.Values[4] = 5;
Toeplitz.ToeplitzSolve(FirstRow, FirstCol,B, X1);
A.LUSolve(B,X2,MtxVec.mtGeneral);
MtxVecEdit.ViewValues(X1,"Real X1",true);
Toeplitz.Levinson(R,X2);
MtxVecEdit.ViewValues(X2,"Real X2",true);
}
}