I'm trying to do matrix multiplication in Android Studio and want to use c++ for the speed benefit. I found the library xtensor and think that it will be useful but I cant get working. I tried putting the header files into the cpp folder but then they dont have access to the base library dependencies and I've been researching for hours now but I couldn't find out exactly what to write in the CMakeLists.txt and how libraries are actually meant to be installed. I'm sorry if this is really obvious but I can't really wrap my head around it.
How can I install the xtensor library in android studio or is there some other way? I wanted to avoid using for loops for the calculation but if there's no other possibility I guess I have to..
xtensorproject is based oncmakewhich is supported byAndroidStudio(gradle)so you can easily use it for NDK build.It takes just a few steps to integrate
xtensorinto your project (without installing it into the system):xtensorandxtl(xtensordepends onxtl) projects and add them to your root cmake, for example:Findxtl.cmaketo supportfind_package(xtl). It's enough only to setxtl_FOUND:xtensorinterface library:Here an example how it can be done for
Android Studio Native C++ Template Projectbased on "Initialize a 2-D array and compute the sum of one of its rows and a 1-D array" example from xtensor/basic-usage.