Vectors and matrices are some of the most common objects used in numerical computing.
The Extreme Optimization Numerical Libraries for .NET provide a full
set of classes for generic real vectors and matrices. Any type that has an associated
arithmetic can be used as the generic element type.
Specializing for specific element types
For any element type, the generic version of the linear algebra classes
is inherently slower than the non-generic version because of additional
overhead that is hard or impossible to optimize away.
The less work is involved in actual operations, the more prominent the overhead will be.
The Extreme Optimization Numerical Libraries for .NET
provide a general mechanism for providing specialized implementations. The same
technique can be applied to other generic algorithms as well.
To create a specialized implementation of the linear algebra kernel, the
following steps need to be taken:
Implement one or more of the interfaces that define the low level API
for linear algebra code for the element type.
Create the specialization class by inheriting from
and overriding the
method. Assign a new instance of the implementation classes from step one to the corresponding
property on the
Create an assembly level attribute
that declares the type created in the previous step
as the specialization for the linear algebra kernel. Use
to identify the association.