Adding a merge checker script

This commit is contained in:
2025-05-21 17:46:49 -04:00
parent dee19b54ad
commit 8a15459fc8
5 changed files with 46 additions and 18 deletions

View File

@@ -0,0 +1,26 @@
name: Merge-Checker
on:
pull_request:
branches: ["**"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Install dependencies (CMake + Ninja + Compiler)
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build build-essential
- name: Configure project with CMake
run: |
cmake -G Ninja -S . -B build/
- name: Build with Ninja
run: |
ninja -C build/

1
.gitignore vendored
View File

@@ -1 +1,2 @@
build/
.cache/

View File

@@ -1,8 +1,5 @@
{
"C_Cpp.intelliSenseEngine": "default",
"clangd.arguments": [
"--include-directory=build/unit-tests"
],
"C_Cpp.default.intelliSenseMode": "linux-gcc-x64",
"files.associations": {
"*.h": "cpp",
@@ -76,6 +73,7 @@
"csignal": "cpp",
"span": "cpp"
},
"clangd.enable": false,
"C_Cpp.dimInactiveRegions": false
"clangd.enable": true,
"C_Cpp.dimInactiveRegions": false,
"editor.defaultFormatter": "xaver.clang-format"
}

View File

@@ -212,8 +212,8 @@ Matrix<rows, columns>::Transpose() const
// explicitly define the determinant for a 2x2 matrix because it is definitely
// the fastest way to calculate a 2x2 matrix determinant
template <>
inline float Matrix<0, 0>::Det() const { return 1e+6; }
// template <>
// inline float Matrix<0, 0>::Det() const { return 1e+6; }
template <>
inline float Matrix<1, 1>::Det() const { return this->matrix[0]; }
template <>

View File

@@ -10,10 +10,10 @@
// TODO: Add a function for SVD decomposition
// TODO: Add a function for LQ decomposition
template <uint8_t rows, uint8_t columns>
class Matrix
{
template <uint8_t rows, uint8_t columns> class Matrix {
public:
static_assert(rows > 0, "Template error: rows must be greater than 0.");
static_assert(columns > 0, "Template error: columns must be greater than 0.");
/**
* @brief create a matrix but leave all of its values unitialized
*/
@@ -37,8 +37,7 @@ public:
/**
* @brief Initialize a matrix directly with any number of arguments
*/
template <typename... Args>
Matrix(Args... args);
template <typename... Args> Matrix(Args... args);
/**
* @brief set the matrix diagonals to 1 and all other values to 0
@@ -189,14 +188,17 @@ public:
Matrix<rows, columns> operator-(const Matrix<rows, columns> &other) const;
template <uint8_t other_columns>
Matrix<rows, other_columns> operator*(const Matrix<columns, other_columns> &other) const;
Matrix<rows, other_columns>
operator*(const Matrix<columns, other_columns> &other) const;
Matrix<rows, columns> operator*(float scalar) const;
template <uint8_t sub_rows, uint8_t sub_columns, uint8_t row_offset, uint8_t column_offset>
template <uint8_t sub_rows, uint8_t sub_columns, uint8_t row_offset,
uint8_t column_offset>
Matrix<sub_rows, sub_columns> SubMatrix() const;
template <uint8_t sub_rows, uint8_t sub_columns, uint8_t row_offset, uint8_t column_offset>
template <uint8_t sub_rows, uint8_t sub_columns, uint8_t row_offset,
uint8_t column_offset>
void SetSubMatrix(const Matrix<sub_rows, sub_columns> &sub_matrix);
/**
@@ -210,8 +212,9 @@ public:
static float DotProduct(const Matrix<vector_size, 1> &vec1,
const Matrix<vector_size, 1> &vec2);
static float DotProduct(const Matrix<1, 1> &vec1,
const Matrix<1, 1> &vec2) { return vec1.Get(0, 0) * vec2.Get(0, 0); }
static float DotProduct(const Matrix<1, 1> &vec1, const Matrix<1, 1> &vec2) {
return vec1.Get(0, 0) * vec2.Get(0, 0);
}
protected:
std::array<float, rows * columns> matrix;