Quantcast
Channel: Math.NET Numerics - Math.NET
Viewing all articles
Browse latest Browse all 224

Mapping a function with multiple parameters

$
0
0

@jdelange wrote:

If M is a matrix, then I know I can apply a function on each element using Map(). So to apply Tanh(x) on each element of M, I can do M.Map(Math.Tanh). This works because Tanh(x) takes one parameter as input.

What if my function to map takes more than one parameter? Say Func(a, b, x), how would I map that?

All I can think of now is pass M with parameters a and b to an in-between-function, do the map without a and b inside that function, and then return M as the function output. I bet there is a nicer way to do this.

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 224

Trending Articles