I work on FMatrix to use the wonderful function 'svd' but it's a template whitch is : FMatrix < type, cinst int N, const int M> N and M are the dimensions of the matrix.
The problem is that i make a lot of calculs, I create a special vector and then I need to use my svd function on a FMatrix<float, vector.size(), vector.size()>
But size return a int and the template need a const int.
How to convert vector.size() to a const int N that i could use as my matrix dimensions as FMatrix <float, N, N>?
Template parameters are compile-time constants. Either switch to a matrix library that allows defining matrix sizes at run time (I thought all of them did), or determine your size at compile time.
You cannot, simply. FMatrix needs a constant, known-at-compile-time, value. std::vector::size is not known at compile time, so it cannot be used with FMatrix.
If you have the source for the svd function, you can adapt it to be used with another matrix library.
I do make a new FMatrix whenever i create a new vector writing :
const int sizeX = myFirstVector.size();
But when it compiles it doesn't know the size of the vector (whitch is calculate during the execution) so he can't create the FMatrix and send an error message.
I'll try to find the explicite library. Thanks for your time
But when it compiles it doesn't know the size of the vector (whitch is calculate during the execution) so he can't create the FMatrix and send an error message.