I want to return an Expression.Call that creates a dense MathNet Matrix.
This is the Matrix I want:
Matrix<ContentType>.Build.Dense(Rows,Columns)
ContentType will be int
, double
or Complex
.
But I want to create it using Expression.Call. Here's my current code:
Expression.Call(
typeof(Matrix<>)
.MakeGenericType(ContentType)
.GetProperty("Build")
.GetMethod("Dense", new[] {typeof(int), typeof(int)}),
Expression.Constant(Rows), Expression.Constant(Columns));
This however results in a build error:
[CS1955] Non-invocable member 'PropertyInfo.GetMethod' cannot be used like a method.
What am I doing wrong?