Closed rfaasse closed 1 month ago
Richard, a nice dedicated PR. I have not seen anything blocking. A general question is more std::vector is used instead of ublas Vector. Is it a result of use of std::transform? Thank you.
That's indeed a good question, because we can use both for a lot of these lists (i.e. the lists with doubles). We can also use std::transform with the ublas Vector since it also has the necessary begin and end iterators. The only difference is we cannot use std::back_inserter for ublas Vectors (since it doesn't supply a push_back method), so we need to specify the size in advance. So that's not a real reason to use either one.
I think about the ublas Vector as 'linear algebra-type' vectors, since then we can use all the ublas functionality for all these operations (inner products, norms, multiplications, additions etc). For the kinds of lists as we have in this PR, we normally don't really need these kinds of operations and I think it is clearer to use std::vectors, since these could be used for lists of doubles, but also e.g. lists of matrices.
So no real technical reason, but more of a conceptual one for me. It's a good question though and I'm curious what you and @avdg81 both think of this!
Creates a pre-calculated list for the Bishop coefficients. This is the last of the matrix inputs we need. Also made some functions const in the retention laws