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

Construct a sparse matrix by specifying the position of each element in dense matrix.

Pascal
procedure TripletsToSparseAndFlush;

This method can be used to construct a sparse matrix by specifying the position of each element in dense matrix.

A[1,0] := 1; A[2,3] := 5; A[4,0] := 2; A.TripletsToSparseAndFlush;

If you later call :A.SparseToDense, you'll construct a dense matrix of form:

0 0 0 0 1 0 0 0 <= 1,0 0 0 0 5 <= 2,3 0 0 0 0 2 0 0 0 <= 4,0
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!