You are here: Symbol Reference > Sparse Namespace > Classes > TSparseMtx Class > public > TSparseMtx.LowerTriangle Method
MtxVec VCL
ContentsIndex
PreviousUpNext
TSparseMtx.LowerTriangle Method

Extract lower part of the Mtx.

Pascal
function LowerTriangle(const Src: TSparseMtx; Diagonal: boolean = false): TSparseMtx; overload;

Copies only the lower triangular part of the Src sparse matrix. The result is stored in the calling sparse matrix. If the Diagonal boolean parameter is true then the Src matrix main diagonal elements will be copied to the calling matrix main diagonal elements. If the Diagonal parameter is false, the calling matrix main diagonal elements will be set to zero.

var asp, bsp: TSparseMtx; csp, dsp: TSparseMtx; d: Vector; // ... // #1 : split asp into lower(bsp), upper(csp) and diagonal(d) sections bsp.LowerTriangle(asp); csp.UpperTriangle(asp); asp.Diag(d); // now combine lower(bsp), upper, and diagonal(d) back dsp.AddSplit(bsp,d,csp); // should be equal if not asp.Equal(dsp) then Eraise('Not Equal!');
void __fastcall Example() { Vector d; TSparseMtx *asp = new TSparseMtx(); TSparseMtx *bsp = new TSparseMtx(); TSparseMtx *csp = new TSparseMtx(); TSparseMtx *dsp = new TSparseMtx(); // ... // #1 : split asp into lower(bsp), upper(csp) and diagonal(d) sections bsp->LowerTriangle(asp); csp->UpperTriangle(asp); asp->Diag(d); // now combine lower(bsp), upper, and diagonal(d) back dsp->AddSplit(bsp,d,csp); // should be equal if (!asp->Equal(dsp)) ERaise("Not Equal!"); delete asp; delete bsp; delete csp; delete dsp; }
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!