Skip to main content

Posts

Showing posts from October 22, 2022

1) Determinant 2) Inverse Matrix 3) Gaussian Elimination 4) Iterative technique and calculate using three method to find x , y, z method: cramer's rule, gaussian elimination and inverse matrix.

#include <iostream> #include <vector> # GaussianElimination std::vector<std::vector<float>> GaussianElimination(std::vector<std::vector<float>> matrix) {   int rows = matrix.size();   int cols = matrix[0].size();   for (int i = 0; i < rows; i++)   {     float coefficient1 = matrix[i][i];     for (int j = 0; j < cols; j++)     {       matrix[i][j] /= coefficient1;     }     for (int j = 0; j < rows; j++)     {       if (j == i) continue;       float coefficient2 = matrix[j][i];       for (int k = 0; k < cols; k++)       {         matrix[j][k] -=  coefficient2 * matrix[i][k];       }     }   }   return matrix; } void PrintMatrix(std::vector<std::vector<float>> matrix) {   for (int i = 0; i < matrix.size(); i++)...