From 57fa21944105fa2e7349c15f6b27e6d950376d60 Mon Sep 17 00:00:00 2001 From: Leto Date: Tue, 24 Dec 2024 14:33:22 +0100 Subject: [PATCH] Reflected changes to README --- README.md | 20 ++++++++------------ main.cpp | 18 +++++------------- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index b2094ae..58b250e 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ LeMA will eventually be used for graphical and machine learning usage in my othe #include "matrices.h" ``` -That's it! You're ready to use Lema. +That's it! You're ready to use LeMA. ### Example Usage @@ -45,18 +45,15 @@ int main() { ```cpp #include "matrices.h" -#include int main() { Matrix a(2,2); - Matrix b(2,2); + a.Set(2.0F); // Fill A with 2s + + Matrix b = a; + Matrix result = a + &b; // Basic operations are possible with pointers - a.Set(2.0F); // Fill both matrices - b.Set(3.0F); - - a.Add(&b); - - a.Print("A + B"); + result.Print("A + B"); // Is full of 4s ! return 0; } ``` @@ -65,15 +62,14 @@ int main() { ```cpp #include "matrices.h" -#include int main() { Matrix a(3, 3); Matrix b(3, 1); // Let's multiply by a vector - Matrix result = a.Multiply(&b); + Matrix result = a * &b; - result.Print("A x B"); + result.Print("A x B"); // Result is a 3 by 1 vector return 0; } diff --git a/main.cpp b/main.cpp index d215123..3846d27 100644 --- a/main.cpp +++ b/main.cpp @@ -1,20 +1,12 @@ #include "matrices.h" -// using namespace std; -int main() -{ - srand(time(0)); - - Matrix a(3,3); - a.Randomize(); - Matrix b(3, 1); - b.Set(2.0F); - - a.Print("A"); - b.Print("B"); +int main() { + Matrix a(3, 3); + Matrix b(3, 1); // Let's multiply by a vector Matrix result = a * &b; - result.Print("A x B"); + + result.Print("A x B"); // Result is a 3 by 1 vector return 0; } \ No newline at end of file