first output

v1
Brett 2024-09-19 15:15:52 -04:00
parent 925d4bfae9
commit 33ae5621e4
4 changed files with 37 additions and 4 deletions

View File

@ -3,6 +3,5 @@
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" /> <mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/lib/blt" vcs="Git" /> <mapping directory="$PROJECT_DIR$/lib/blt" vcs="Git" />
<mapping directory="$PROJECT_DIR$/lib/blt/libraries/parallel-hashmap" vcs="Git" />
</component> </component>
</project> </project>

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.25) 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_ADDRSAN "Enable the address sanitizer" OFF)
option(ENABLE_UBSAN "Enable the ub sanitizer" OFF) option(ENABLE_UBSAN "Enable the ub sanitizer" OFF)

@ -1 +1 @@
Subproject commit d1aaf4db9468cfafe10cffcaea48ee2908f6b05f Subproject commit e19a88c45477c4529adb8cabebf3091380d9c756

View File

@ -1,6 +1,40 @@
#include <iostream> #include <iostream>
#include <blt/math/matrix.h>
#include <blt/math/log_util.h>
#include <valarray>
#include "blt/std/assert.h"
void test_math()
{
blt::generalized_matrix<float, 1, 4> input{1, -1, -1, 1};
blt::generalized_matrix<float, 1, 3> output{1, 1, 1};
blt::generalized_matrix<float, 4, 3> 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<float, 1, input_count>;
using output_t = blt::generalized_matrix<float, 1, output_count>;
input_t input_1{-1, 1, 1, 1, -1};
output_t output_1{1, 1, -1, 1};
int main() 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;
} }