From 33ae5621e428cf4c199c0fbb350ed58830d073e1 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Thu, 19 Sep 2024 15:15:52 -0400 Subject: [PATCH] first output --- .idea/vcs.xml | 1 - CMakeLists.txt | 2 +- lib/blt | 2 +- src/main.cpp | 36 +++++++++++++++++++++++++++++++++++- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 0a294a1..bf8431e 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -3,6 +3,5 @@ - \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index f9d83f1..5fb0f52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(COSC-4P80-Assignment-1 VERSION 0.0.2) +project(COSC-4P80-Assignment-1 VERSION 0.0.3) option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF) option(ENABLE_UBSAN "Enable the ub sanitizer" OFF) diff --git a/lib/blt b/lib/blt index d1aaf4d..e19a88c 160000 --- a/lib/blt +++ b/lib/blt @@ -1 +1 @@ -Subproject commit d1aaf4db9468cfafe10cffcaea48ee2908f6b05f +Subproject commit e19a88c45477c4529adb8cabebf3091380d9c756 diff --git a/src/main.cpp b/src/main.cpp index 6f2b004..7fc23d5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,40 @@ #include +#include +#include +#include +#include "blt/std/assert.h" + +void test_math() +{ + blt::generalized_matrix input{1, -1, -1, 1}; + blt::generalized_matrix output{1, 1, 1}; + blt::generalized_matrix expected{ + blt::vec4{1, -1, -1, 1}, + blt::vec4{1, -1, -1, 1}, + blt::vec4{1, -1, -1, 1} + }; + + auto w_matrix = input.transpose() * output; + BLT_ASSERT(w_matrix == expected && "MATH FAILURE"); +} + +constexpr blt::u32 input_count = 5; +constexpr blt::u32 output_count = 4; + +using input_t = blt::generalized_matrix; +using output_t = blt::generalized_matrix; + +input_t input_1{-1, 1, 1, 1, -1}; +output_t output_1{1, 1, -1, 1}; int main() { - std::cout << "Hello World!" << std::endl; + test_math(); + + + + std::cout << output_1 << std::endl; + std::cout << input_1.transpose() << std::endl; + std::cout << input_1.transpose() * output_1 << std::endl; + std::cout << "Hello World!" << std::endl; }