Knowledge Base

MtxVec expressions

Operator overloading

It is possible to mix vectors, matrices, complex numbers and scalars in the Delphi code. It is sufficient to declare the type as Vector or Matrix without the need to worry about object creation or destruction. Freeing of objects is automatically wrapped by the compiler in to try/finally blocks. Internally object and memory allocations are cached ensuring best in class performance. The syntax is best demonstrated by an example:

MtxVec Expressions

MtxVec Expressions are available for Delphi/C++Builder 2006 and later. Another set of additional features has been added in 2022:

SelectSyntax

The speed of code is of course still (much) higher than using native Delphi arrays as long as the vectors/matrices are big enough. (more than 10 elements). "Select" property returnes "a view" or subranged vector. In case of matrices, it makes a copy. This type of syntax is is usefull for quick prototyping and debugging.

 


© DewResearch 1997 - 2022 All Rights Reserved.

E-mail This email address is being protected from spambots. You need JavaScript enabled to view it..
Delphi & C++ Builder are registered trademarks of Embarcadero Corporation. All other brands and product names are trademarks or registered trademarks of their respective owners.