/*
 * @Author: mypx
 * @Date: 2025-07-04 14:51:22
 * @LastEditTime: 2025-08-15 14:50:55
 * @LastEditors: mypx mypx_coder@163.com
 * @Description: 
 */
#ifndef __ET_LINEAR_SOLVER_H__
#define __ET_LINEAR_SOLVER_H__
#include <math.h>
#include "etk_config.h"

#ifdef ET_LINEAR_SOLVER_SUPPORT
#ifdef __cplusplus
extern "C"
{
#endif

/**
 * Solve a system of linear equations using Gaussian elimination.
 * @param n Number of equations (dimension)
 * @param A Coefficient matrix (n x n)
 * @param b Constant vector (n)
 * @param x Solution vector (n)
 * @param tolerance Numerical tolerance for zero checks
 * @return 0: Success, 1: No solution, 2: Infinite solutions
 */
int et_linear_solver_gaussian_elimination(int n, double **A, double *b,
                                          double *x, double tolerance);
#ifdef __cplusplus
}
#endif
#endif // ET_LINEAR_SOLVER_SUPPORT

#endif // __ET_LINEAR_SOLVER_H__
