From a2021199696d2cf862fc4d0c877ce62f8f95a74c Mon Sep 17 00:00:00 2001 From: Lev Date: Sun, 13 Jun 2021 17:56:00 -0500 Subject: [PATCH] Update linearRegression to header file --- .../Midterm/Midterm Project/OrderBookEntry.cpp | 13 ++++++------- .../Midterm/Midterm Project/TradingBot.h | 2 ++ .../Midterm/Midterm Project/Wallet.h | 1 - 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CM2005 Object Oriented Programming/Midterm/Midterm Project/OrderBookEntry.cpp b/CM2005 Object Oriented Programming/Midterm/Midterm Project/OrderBookEntry.cpp index 7af218f..07e18b7 100644 --- a/CM2005 Object Oriented Programming/Midterm/Midterm Project/OrderBookEntry.cpp +++ b/CM2005 Object Oriented Programming/Midterm/Midterm Project/OrderBookEntry.cpp @@ -7,13 +7,12 @@ OrderBookEntry::OrderBookEntry( std::string _product, OrderBookType _orderType, std::string _username) - : - price(_price), - amount(_amount), - timestamp(_timestamp), - product(_product), - orderType(_orderType), - username(_username) + : price(_price), + amount(_amount), + timestamp(_timestamp), + product(_product), + orderType(_orderType), + username(_username) { } diff --git a/CM2005 Object Oriented Programming/Midterm/Midterm Project/TradingBot.h b/CM2005 Object Oriented Programming/Midterm/Midterm Project/TradingBot.h index 3afcf02..4131b23 100644 --- a/CM2005 Object Oriented Programming/Midterm/Midterm Project/TradingBot.h +++ b/CM2005 Object Oriented Programming/Midterm/Midterm Project/TradingBot.h @@ -8,6 +8,8 @@ class Bot { public: Bot(std::string filename); + /** returns a vector with the Y, B0 and B1 values in the formula Y = B0 + B1.X */ + std::vector linearRegresion(std::vector orderList, unsigned int start, unsigned int end); void Print(int intLimit); private: diff --git a/CM2005 Object Oriented Programming/Midterm/Midterm Project/Wallet.h b/CM2005 Object Oriented Programming/Midterm/Midterm Project/Wallet.h index 8987a36..3fea05e 100644 --- a/CM2005 Object Oriented Programming/Midterm/Midterm Project/Wallet.h +++ b/CM2005 Object Oriented Programming/Midterm/Midterm Project/Wallet.h @@ -22,7 +22,6 @@ public: * assumes the order was made by the owner of the wallet */ void processSale(OrderBookEntry &sale); - /** generate a string representation of the wallet */ std::string toString(); friend std::ostream &operator<<(std::ostream &os, Wallet &wallet);