Toeplitz.ToeplitzSolve Method

Overload List

#SignatureDescription
1void ToeplitzSolve(TVec FirstRow, TVec B, TVec X)Solves toeplitz system.
2void 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.

#NameDescription
1FirstRowDefines the first row R(0)..R(N-1) in the equation below.
2BDefines B vector in equation below.
3XReturns 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.

#NameDescription
1FirstRowDefines the first row R(0)..R(N-1) in the equation below. Vector can be real or complex.
2FirstColDefines 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.
3BDefines B vector in equation below.
4XReturns 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);
    }
}