![developer10 | Embarcadero RAD Studio Delphi C++Builder Blogs](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2020/08/developer10.jpg?resize=1140%2C694&ssl=1)
Since we learn C and C++ at university, we happen to get many projects related to Applied Math and Linear Algebra. And we should build an application to solve different complex problems with C/C++ (mostly C++). I have tried to implement some functions, for instance, dot product and cross product functions and also several matrix elimination functions. But, while stuck on implementing some methods with C++, I found the Eigen C++ library which is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
Eigen library helped me to save dozens of hours! You can get the Eigen library from GetIt and utilize it with C++ Builder projects easily.
![embarcaderocbuildereigenlibrary4270061 | Embarcadero RAD Studio Delphi C++Builder Blogs embarcadero c builder eigen library 4270061](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2020/12/embarcadero-c-builder-eigen-library-4270061.png?resize=615%2C442&ssl=1)
Here is some sample source code from the Eigen Array Of String test:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
EIGEN_DECLARE_TEST(array_of_string) { typedef Array<std::string,1,Dynamic> ArrayXs; ArrayXs a1(3), a2(3), a3(3), a3ref(3); a1 << "one", "two", "three"; a2 << "1", "2", "3"; a3ref << "one (1)", "two (2)", "three (3)"; std::stringstream s1; s1 << a1; VERIFY_IS_EQUAL(s1.str(), std::string(" one two three")); a3 = a1 + std::string(" (") + a2 + std::string(")"); VERIFY((a3==a3ref).all()); a3 = a1; a3 += std::string(" (") + a2 + std::string(")"); VERIFY((a3==a3ref).all()); a1.swap(a3); VERIFY((a1==a3ref).all()); VERIFY((a3!=a3ref).all()); } |
Head over and find out more about Eigen in Embarcadero GetIt and then download it via the IDE.
Get the answers to the most intriguing questions about the std string method as well as String Operations in C++ software in this article.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition