How to use abs, sqrt etc on OperateOnAll with OjAlgo?

Viewed 92
1 Answers
UnaryFunction<Double> modifier = PrimitiveMath.ROOT.parameter(2);

// To modify A in place
A.modifyAll(modifier);

// The results in another matrix
A.operateOnAll(modifier).supplyTo(B);

// To have a new results matrix created for you
MatrixStore<Double> C = A.operateOnAll(modifier).get();

// If A if of an immutable type like Primitive64Matrix
DenseReceiver mutable = A.copy();
mutable.modifyAll(modifier);
Primitive64Matrix B = mutable.get();
Related