operator* does not compile for one input matrix with double and other with var scalars
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 839
- Forks
- 220
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 14
Description
Description
operator* (matrix multiplication) does not compile for one input matrix with double and other with var scalars.
Both stan and tests always use multiply function, so this went undetected.
Example
int N = 2;
int M = 3;
int K = 4;
Eigen::MatrixXd a(N, M);
a << 1, 2, 3, 4, 5, 6;
stan::math::matrix_v b(M, K);
b << 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1;
stan::math::matrix_v c = a * b;
Does not compile.
Expected Output
operator* compiles and does the same as multiply function.
Current Version:
v3.3.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by compiling the provided operator* example and compare its behavior with the existing multiply function, which the issue identifies as the working path. Trace the operator* entry point and related tests, then add coverage for mixed double and var-scalar matrices; done means the example compiles and matches multiply.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100