Skip to content

Commit

Permalink
Replaced many hand written loops in ML visitors with STL aglorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
hosseinmoein committed May 21, 2023
1 parent 7cd3861 commit 75bdfeb
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 110 deletions.
4 changes: 2 additions & 2 deletions docs/HTML/any_type.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<html>
<body>

To have containers of multiple types in C++ is not simple because although C++ is not strongly typed it is statically typed. That means all types must be known at compile time.<BR>
One approach is to use polymorphism and have containers of pointers. There are several variations of this approach. They are all inefficient especially for larger datasets because they break cache locality. Another approach is to use containers of <I>std::variant</I>. In this case if you need to support a new type you must modify your code. Also, for large datasets <I>std::variant</I> could waste a lot of unnecessary memory space.<BR>
To have containers of multiple types in C++ is simply impossible because although C++ is not strongly typed it is statically typed. That means all types must be known at compile time. Please note that I am excluding tuples and pairs as containers.<BR>
But there are ways to simulate or fake heterogeneous containers. One approach is to use polymorphism and have containers of pointers. There are several variations of this approach. They are all inefficient especially for larger datasets because they break cache locality. Another approach is to use containers of <I>std::variant</I>. In this case if you need to support a new type you must modify your code. Also, for large datasets <I>std::variant</I> could waste a lot of unnecessary memory space.<BR>
DataFrame solves the problem differently. It uses static containers in conjunction with meta-programming to simulate heterogenous containers that can support <I>any type</I> without having to modify code and keeps column data in <I>contiguous memory</I> space and does not use <I>unnecessary memory</I>.
<BR>
<BR>
Expand Down
1 change: 1 addition & 0 deletions docs/HTML/garbage_in_garbage_out.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<LI>It makes the code convoluted and hard to understand and maintain</LI>
<LI>The check often is more complicated than the algorithm itself and it makes the code bug-prone</LI>
</OL>
DataFrame is not a teaching/educational library -- there are other legitimate libraries for that. Therefore, the DataFrame logic is; <I>if you don't know what you are doing, you deserve what you get</I>.

<BR>
<BR>
Expand Down
Loading

0 comments on commit 75bdfeb

Please sign in to comment.