SDL Component Suite - Matrix

The unit MATRIX offers some of the most important operations to manage and process two-dimensional real-valued and integer matrices. The object oriented approach of the unix MATRIX hides all the stuff dealing with array addressing and memory management. Thus the user may fully concentrate on his/her work. The unit MATRIX offers solutions for the following tasks:

• creation and management of matrices
• filling of matrices
• copying matrices
• matrix arithmetics
• determination of statistical parameters about the matrix elements
• inversion of a square matrix
• sorting of matrix elements
• LU decomposition and determinant
The unit MATRIX is part of the SDL Component Suite. More details can be found in the online help pages.

Tips, Tricks and Applications

 Delphi Bits Covariance of Samples and Populations Why does the covariance matrix calculated by CalcCovar differ from the results obtained by Microsofts Excel(tm). SDL TechNotes Access Violation When Creating Matrix Objects How to create a TMatrix instance in your program (without glueing a TMatrix component on your form).

What's new:

• Release 10.7   [Aug-24, 2020]

• Release 10.6   [Mar-09, 2018]

• Release 10.5   [Oct-10, 2016]

• Release 10.4   [Jun-02, 2015]

• Release 10.3   [Oct-06, 2014]

• Release 10.2   [May-30, 2013]

• the new method TMat4D.Percentile calculates percentiles of a 4-dimensional matrix
• the new methods FillDiag (Matrix) and FillDiag (Mat4D) allow to set the diagonal of a matrix
• the missing method Assign has been implemented
• bug fix: TMat4D caused a memory leak

• Release 10.1   [Oct-29, 2012]

• Release 10.0   [Oct-4, 2011]

• new class TMat4D allows to manage 4-dimensional hypercube matrices
• matrix classes can now be set to zero dimensions
• TMatrix.CopyFrom offers now an additional overloaded version to copy data from integer matrices (TIntMatrix).
• the methods SaveToStream and LoadFromStream now support file streams, as well
• new method TransposeAndMultiply allows to transpose and multiply in one step
• the new methods FillRandomGauss and FillRandomUniform fill the matrix of type TMatrix, TIntMatrix and TMat3D with uniformly or normally distributed random numbers

• Release 9.7   [May-31, 2010]

• new method CRCofData calculates the CRC over all matrix cells
• new methods MirrorColumns and MirrorRows allow to mirror the matrix
• new methods ExchangeRows and ExchangeColumns allow to exchange to rows or columns of a matrix
• new function FindInSortedColumn searches a sorted column by a binary search
• bug fix: depending on the data the calculation of the determinant resulted in a wrong sign (but correct absolute values) for matrices of even dimension (bug was introduced with release 9.51)
• bug fix: sorting the matrix (both rows and columns) does no longer reduce the numeric precision to 12 significant digits

• Release 9.51   [Dec-01, 2008]

• Release 9.5   [Oct-31, 2008]

• Release 9.0   [May-28, 2007]

• Release 8.5   [Feb-18, 2006]

• bug fix: method Percentile now calculates correct values (bug emerged only for less than 100 selected elements)

• Release 8.2   [Nov-03, 2004]

• bug fix: method Transpose works now correctly

• Release 8.1   [Aug-29, 2004]

• available for Delphi™ 8 for .NET

• Release 8.0   [Apr-15, 2004]

• CalcDistMat now provides event OnCalcDistance if distance measure is user defined
• new distance measure Dice coefficient

• Release 7.2   [Mar-23, 2003]

• MATRIX is now part of MathPack
• TMatrix, TIntMatrix and TMat3D are now components (no longer inherited from TObject)
• properties NrOfRows, NrOfCols, NrOfLayers are no longer read-only and published
• property DataID is now published
• bug fix: Resize of TMat3D works now properly

• Release 7.0   [Sep-15, 2002]

• available for Delphi™ 7.0
• the unit is now CLX compatible
• Percentile function implemented

• Release 6.5   [May-28, 2002]

• available for C++Builder™ 6.0
• new methods to export/import matrix data to/from XML files or streams: LoadFromXMLFile, ReadFromOpenXMLFile, ReadFromXMLStream, SaveAsXMLFile, WriteToOpenXMLFile, WriteToXMLStream
• property DataID implemented
• bug fix: sorting routine can now handle matrices with more than 65535 rows/columns

• Release 6.0  [Aug-06, 2001]

• available for Delphi™ 6.0
• new method SkewKurtSample of TMatrix and TIntMatrix implemented
• methods GeometricMean and HarmonicMean implemented
• bug fix: SkewKurt now calculates the skewness correctly

• Release 5.5   [Jun-09, 2000]

• available for C++Builder™ 5.0
• LoadFromStream and SaveToStream for TMatrix and TIntMatrix implemented
• sparse Matrix implemented

• Release 5.0   [Oct-07, 1999]

• MATRIX is now available for Delphi™ 5.0 (as part of the SDL Component Suite 5.0)
• LoadFromFile of TMatrix and TIntMatrix extended

• Release 1.8   [Mar-28, 1999]

• TMatrix & TIntMatrix have now OnSortExchange events
• method Clone implemented
• method Resize now does not execute if the new dimensions are equal to the old ones
• method Trace implemented
• property Elem is now default property
• LU decomposition implemented
• function Determinant implementedRelease 1.1 (Feb-12, 1997) :
• new class TIntMatrix implemented
• bug in method Destroy fixed, which resulted in occasional memory allocation problems
• new methods: Add, Subtract, and SMult

• Release 1.7    [Aug-12, 1998]

• MATRIX is now available for Delphi™ 4.0
• Mat3D has now Resize method
• bug fix: resize methods of TMatrix and TIntMatrix now function properly also in 16-bit mode
• CalcDistMat (TMatrix) implemented
• method Histogram implemented

• Release 1.6 (Feb-14, 1998):

• new method Quartiles
• bug fix: TMatrix and TIntMatrix are now classes of TObject
• new event: OnChange (both TMatrix and TIntMatrix)
• new method Change implemented
• ESDLMatrixError replaces ELocompError
• MATRIX is now available for all versions of Delphi™ (1.0, 2.0, 3.0), and for C++Builder™ (1.0 and 3.0)
• TMat3D implemented
• CopyRowToVec, CopyColToVec implemented
• StandardizeColumns, and StandardizeRows implemented
• bug in resize fixed: access violation for large matrices
• create now initializes all elements to zero values
• method Sum implemented
• bug fixed which caused strange behavior for zero or negative array dimensions on create

• Release 1.5 (May-28, 1997)

• bug in Resize fixed, which restricted 32-bit matrices to 64k
• method Transpose implemented
• MATRIX is now available for all three versions of Delphi™ and for C++Builder™