Calculates the tensor product of two vectors and adds the result to calling matrix.
Calculates the tensor product of Vec1 and Vec2 vectors and adds the result to the calling matrix by using the following formula:
If the ConjVec2 parameter is true, then the result will be tensor product of Vec1 and conjugated Vec2. The
property is set to Vec1.
property is set to Vec2.
. The
property of the calling matrix is adjusted automatically.
Example 1
var a,b: TMtx;
v1,v2: TVec;
begin
CreateIt(a,b);
CreateIt(v1,v2);
try
// Test non quadratic general matrix
a.SetIt(2,2,False,[0,2,2,0]);
v1.SetIt(false,[1,0]);
v2.setIt(false,[0,1]);
a.AddTensorProd(v1,v2,False);
b.SetIt(False,[1,2,2,1]);
if not a.Equal(b) then raise Exception.Create('Not same');
finally
FreeIt(a,b);
FreeIt(v1,v2);
end;
end;