Here’s a simple compile error, I’m allocating double arrays like so:
double mixmu[][1] = {{1},{-1}};
double mixvar[][1] = {{1},{1}};
double coef[] = {1,1};
can I not pass these as double** objects?
error: no matching function for call to ‘MixtureModel::MixtureModel(int, int, double [2], double [2][1], double [2][1], Distribution*)’
./problems/MixtureModel.h:25: note: candidates are: MixtureModel::MixtureModel(int, int, double*, double**, double**, Distribution*)
No you don’t!
Your misconception/doubt stems from the (Incorrect)fact that, Arrays are pointers
No! Arrays are not pointers!!
An array name decays sometime to an pointer to its first element in scenarios where array name is not valid.
A two dimensional array does not decay to an double pointer. It decays to an pointer to array.
Your declaration needs to be:
or
Good Read:
How do I use arrays in C++?