# Class Solve2x2

- Defined in File G2lib.hxx

## Class Documentation

class G2lib::Solve2x2

  Class that solve a 2x2 linear system using Pseudo inverse to manage singular and near singular cases

  Public Functions

  inline Solve2x2()
  bool factorize(real_type A[2][2])

    factorize matrix \( A \) , return false if factorization fails

  bool solve(real_type const b[2], real_type x[2]) const

    Solve the linear system \( Ax=b \) with \( A \) stored amd facted with a previous call of method `factorize`.

    Parameters

      - b – [in] the rhs of \( Ax=b \)

      - x – [out] the solution of \( Ax=b \)

    Returns

      true if solution found