Skip to content

Some numerical algorithms implemented in C ++ language and Matlab language.

Notifications You must be signed in to change notification settings

guihunkun/NumericalAlgorithm

Repository files navigation

NumericalAlgorithm

  1. IntersectAreaOfPoly.cpp double IntersectAreaOfPoly(vector& polygon1, vector& polygon2) /* Input: arbitrary polygon points, counterclockwise Output: Area of intersection of two polygons */ // HDU 3060 acm question

  2. GaussElimination.cpp void GaussElimination(vector<vector >& A, vector& b, vector& x) // Solving Ax = b by Gaussian Elimination /* Input: vector<vector >& A vector& b vector& x solve result save in x; */

  3. function [x, r, i] = GMRES ( A, b, x0, tol, maxit ) % solve Ax = b; % Input: % x0 Initial value % tol Precision % maxit The maximum number of iterations

% Output: % x Solution % r
% i The number of iterations

  1. GaussTriangleNumericalIntegration.m function [weight, gausspoints] = GaussTriangleNumericalIntegration(precision) % Calculate numerical integration on Triangle % Input: % precision integration precision

% Output: % weight integration weight % gausspoints integration points

  1. TestForGauTriNumInt.m % Just for test GaussTriangleNumericalIntegration % If change triangle points exact integration need change

  2. ConjugateGradient.m function [x,n] = ConjugateGradient(A, b, x0, epsa) % solve Ax = b; % Input: % A Matrix % b Vector % x0 Initial value % epsa Precision % Output: % x approximate solution % b the maximum number of iterations

  3. ChangeP1toP2Mesh.m function [p,t] = ChangeP1toP2Mesh(p,t) % % Input: p: nodes % t: index of node % Each triangle is described by three points.

% Output: p: nodes % t: index of node % Each triangle is described by six points.

  1. Tri2Edge.m function edges = Tri2Edge(p,t) % Input: p: nodes % t: index of node % Each triangle is described by three points. % Output: edges: return the element edge numbers.

  2. TestforChangeP1toP2Mesh.m % Just for test ChangeP1toP2Mesh

About

Some numerical algorithms implemented in C ++ language and Matlab language.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published