Description
Add 'apply' method to Vector/Matrix to allow ad-hoc function apply to the elements of a Vector/Matrix.
For example, if a function f( x ) needs to apply to the elements of a vector v, then we can use
------------
DoubleFunction fun = new DoubleFunction() {
public double apply(double element)
};
v.apply(fun);
------------
This method borrows the style of functional programming by allowing a function to apply to all the elements of a Vector/Matrix. It can simply the coding, especially for those algorithms where Vector/Matrix operations are heavily used.