مرجع
آخر الزيارات

أرمديلو (مكتبة سي++)

186 كلمة•0 مشاهدة•🗒️ منذ يومين
باختصار: أرمديلو هي مكتبة برمجية ذات مصدر مفتوح تستعمل مع لغة سي++ للحسابات المتعلقة بالجبر الخطي. تجد هنا «Pos.print("Current position of the particle:");»، «b << 2.0 << 5.0 << 2.0;» و«Pos.print("New position of the particle:"); // ^» ضمن 5 أقسام.
المحتويات
  1. Pos.print("Current position of the particle:");
  2. b << 2.0 << 5.0 << 2.0;
  3. Pos.print("New position of the particle:"); // ^
  4. مثال في C++ 98
  5. مثال في C++ 11

قبل الخوض في التفاصيل، أرمديلو هي مكتبة برمجية ذات مصدر مفتوح تستعمل مع لغة سي++ للحسابات المتعلقة بالجبر الخطي. وفيما يلي تفاصيل أوسع عن ذلك.

الاستعمال

Pos.print("Current position of the particle:");

Pos = RotM*Pos;

من جهة ثانية، std::cout << "Rotating the point " << phi*180/3.1416 << " deg" << std::endl;

b << 2.0 << 5.0 << 2.0;

  • // arma::endr represents the end of a row in a matrix
  • arma::mat A;
  • A << 1.0 << 2.0 << arma::endr
  • << 2.0 << 3.0 << arma::endr
  • << 1.0 << 3.0 << arma::endr;
  • std::cout << "Least squares solution:\n";
  • std::cout << arma::solve(A,b) << '\n';
  • return 0;
  • }
  • المراجع

Pos.print("New position of the particle:"); // ^

  • // x (1,0)
  • //
  • // +------>
  • return 0;
  • }

مثال في C++ 98

  • مثال آخر بلغة C++ 98:
  • #include
  • #include
  • int main
  • {
  • arma::vec b;

مثال في C++ 11

  • مثال بسيط يشرح استعمال المكتبة :
  • // Compile with:
  • // $ g++ -std=c++11 main.cpp -o file_name -O2 -larmadillo
  • #include
  • #include
  • #include
  • int main
  • {
  • // ^
  • // Position of a particle //
  • {1; // +---x-->
  • // Rotation matrix
  • double phi = -3.1416/2;
  • arma::mat RotM = +cos(phi), -sin(phi)},
  • {+sin(phi), +cos(phi);

ما رأيك في هذه المقالة؟

📝 هل في هذه المقالة خطأ؟

إذا وجدت معلومة تحتاج تصحيحاً أو إضافة، أو أردت حذف المقالة، أرسل لنا طلباً وسنراجعه.