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

Allows setting and getting value at position Row and Col.

Pascal
property Value [Row, Col: integer]: double;

Allows setting and getting value at position Row and Col. This property is to be used to form a new sparse matrix only. See the TripletsToSparseAndFlush method, on how to use this property. This property should not be used to access individual values of a sparse matrix. To access individual values, the following pattern can be used: 

 

for i := 0 to SparseMtx.Cols-1 do for j := SparseMtx.ap[i] to SparseMtx.ap[i+1]-1 do begin aRow := SparseMtx.ai[j]; aValue := SparseMtx.Values[j]; //... The aValue is stored at i'th column and aRow //i'th column values are stored in the Values array from index ap[i] to ap[i+1] //the row indices for the i'th column are stored in the Ai array end;
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!