简体   繁体   中英

Const float** defined in header file

I have one dll which contains three computing methods and two static const containers. I do not define a class for embedding the code in the DLL. As it is scientific code, code calling the DLL will directly call the methods defined in it.

The two data structures can be const and static, and could be typed float** . For now, I defined this QVector<QVector<float>> in the header file of the class.

jsekseArr.reserve(3);
jsekseArr.resize(3);
jsekseArr[0] = QVector<float>() << 0 << 1 << 1 << 3;
jsekseArr[1] = QVector<float>() << 0 << 1 << 3 << 6;
jsekseArr[2] = QVector<float>() << 0 << 1 << 6 << 10;

But I want to be no more reliant on Qt. what is the best, cleaner way to define these data structures in the header file as float** ?

Should I create a struct for this matrix ?

对于2d向量,请尝试std::vector<std::vector <float> >

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM