-
-
Notifications
You must be signed in to change notification settings - Fork 200
Closed
Description
Description
Matrix functions can be generalized to work with Eigen expressions not just matrices. By propagating matrix expressions around we can avoid creating temporary matrices, improving performance. This could also make adding support for sparse matrices easier.
There was some discoussion about this on discourse. Also an abandoned PR #1309. Contrary to this PR I intend to split the this into smaller chunks:
- element-wise functions (ones that use
apply_scalar_unary). Prim implementation of these can in many cases use Eigen implementations that can be faster than std. - operator-like functions (add, subtract, multiply, divide, elt_multiply, elt_divide)
- size and view functions (col, row, sub_col, sub_row, head, tail, diagonal, transpose, cols, rows, num_elements, dims)
- reminder of */fun
- */prob
- allow functions to return expressions
Example
Instead of :
Eigen::MatrixXd f(const Eigen::MatrixXd& x)
We can do:
template<typename T>
auto f(const T& x)
Expected Output
More general and possibly faster code.
Current Version:
v3.0.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels