├── .github ├── FUNDING.yml └── workflows │ ├── codacy.yml │ ├── codeql-analysis.yml │ ├── macos-build.yml │ ├── msvc.yml │ └── windows-build.yml ├── .gitignore ├── CMakeLists.txt ├── License ├── README.md ├── appveyor.yml ├── benchmarks ├── CMakeLists.txt ├── dataframe_performance.cc ├── dataframe_performance_2.cc ├── dataframe_read_large_file.cc ├── linkedin_benchmark.cc ├── linkedin_benchmark.py ├── pandas_performance.py ├── pandas_performance_2.py ├── pandas_read_large_file.py ├── polars_performance.py └── polars_read_large_file.py ├── cmake ├── DataFrame.pc.in └── DataFrameConfig.cmake.in ├── data ├── AAPL_10dBucketWithMaps.csv ├── AAPL_10dBucketWithMaps.dat ├── AAPL_10dBucketWithMaps_small.csv ├── AAPL_10dBucketWithVector.csv ├── AAPL_10dBucketWithVector.dat ├── DT_AAPL.csv ├── DT_IBM.csv ├── DT_Intraday.csv ├── DT_sample.csv ├── FORD.csv ├── IBM.csv ├── IcecreamProduction.csv ├── SHORT_IBM.csv ├── SHORT_IBM.dat ├── SchemaWithHeader.csv ├── SchemaWithoutHeader.csv ├── client_data.csv ├── csv2_format_data.csv ├── csv2_format_data_2.csv ├── csv2_format_data_no_index.csv ├── csv2_format_data_with_bars.csv ├── sample_data.csv ├── sample_data.json ├── sample_data_2.csv ├── sample_data_2.json ├── sample_data_dt_index.csv ├── sample_data_no_index.csv ├── sample_data_no_index.json ├── sample_data_string_index.csv ├── strings.csv └── strings2.csv ├── docs ├── CONTRIBUTING.md ├── CheatSheet.pdf ├── CheatSheet.pptx ├── HTML │ ├── AbsVisitor.html │ ├── AccumDistVisitor.html │ ├── AffinityPropVisitor.html │ ├── AnomalyDetectByFFTVisitor.html │ ├── AnomalyDetectByIQRVisitor.html │ ├── AnomalyDetectByLOFVisitor.html │ ├── AnomalyDetectByZScoreVisitor.html │ ├── ArnaudLegouxMAVisitor.html │ ├── AutoCorrVisitor.html │ ├── AvgDirMovIdxVisitor.html │ ├── BalanceOfPowerVisitor.html │ ├── BetaVisitor.html │ ├── BiasVisitor.html │ ├── BollingerBand.html │ ├── BoxCoxVisitor.html │ ├── CCIVisitor.html │ ├── CategoryVisitor.html │ ├── CenterOfGravityVisitor.html │ ├── ChaikinMoneyFlowVisitor.html │ ├── ChandeKrollStopVisitor.html │ ├── ChopIndexVisitor.html │ ├── ClipVisitor.html │ ├── CoppockCurveVisitor.html │ ├── CorrVisitor.html │ ├── CountVisitor.html │ ├── CovVisitor.html │ ├── CumMaxVisitor.html │ ├── CumProdVisitor.html │ ├── CumSumVisitor.html │ ├── DBSCANVisitor.html │ ├── DataFrame.html │ ├── DataFrameTypes.html │ ├── DateTime.html │ ├── DecayVisitor.html │ ├── DecomposeVisitor.html │ ├── DetrendPriceOsciVisitor.html │ ├── DiffVisitor.html │ ├── DotProdVisitor.html │ ├── DoubleCrossOver.html │ ├── DrawdownVisitor.html │ ├── DynamicTimeWarpVisitor.html │ ├── EBSineWaveVisitor.html │ ├── EaseOfMovementVisitor.html │ ├── EhlerSuperSmootherVisitor.html │ ├── EhlersHighPassFilterVisitor.html │ ├── ElderRayIndexVisitor.html │ ├── EldersForceIndexVisitor.html │ ├── EldersThermometerVisitor.html │ ├── EntropyVisitor.html │ ├── ExpandingRollAdopter.html │ ├── ExpoSmootherVisitor.html │ ├── ExponentiallyWeightedMeanVisitor.html │ ├── FactorizeVisitor.html │ ├── FastFourierTransVisitor.html │ ├── FirstVisitor.html │ ├── FisherTransVisitor.html │ ├── GarmanKlassVolVisitor.html │ ├── HampelFilterVisitor.html │ ├── HeikinAshiCndlVisitor.html │ ├── HodgesTompkinsVolVisitor.html │ ├── HoltWinterChannelVisitor.html │ ├── HullRollingMeanVisitor.html │ ├── HurstExponentVisitor.html │ ├── Index2D.html │ ├── InertiaVisitor.html │ ├── KMeansVisitor.html │ ├── KamaVisitor.html │ ├── KeltnerChannelsVisitor.html │ ├── KolmoSmirnovTestVisitor.html │ ├── KthValueVisitor.html │ ├── LinregMovingMeanVisitor.html │ ├── LossFuncVisitor.html │ ├── LowessVisitor.html │ ├── MACDVisitor.html │ ├── MADVisitor.html │ ├── MC_station_dist.html │ ├── MannWhitneyUTestVisitor.html │ ├── MassIndexVisitor.html │ ├── Matrix.html │ ├── MaxSubArrayVisitor.html │ ├── MaxVisitor.html │ ├── MeanShiftVisitor.html │ ├── MeanVisitor.html │ ├── MedianVisitor.html │ ├── ModeVisitor.html │ ├── MutualInfoVisitor.html │ ├── NLargestVisitor.html │ ├── NonZeroRangeVisitor.html │ ├── NormalizeVisitor.html │ ├── OnBalanceVolumeVisitor.html │ ├── PSLVisitor.html │ ├── ParabolicSARVisitor.html │ ├── ParkinsonVolVisitor.html │ ├── PeaksAndValleysVisitor.html │ ├── PercentPriceOSCIVisitor.html │ ├── PivotPointSRVisitor.html │ ├── PolicyLearningLossVisitor.html │ ├── PolyFitVisitor.html │ ├── PrettyGoodOsciVisitor.html │ ├── PriceDistanceVisitor.html │ ├── ProdVisitor.html │ ├── QuantQualEstimationVisitor.html │ ├── QuantileVisitor.html │ ├── RSIVisitor.html │ ├── RandGenParams.html │ ├── RankVisitor.html │ ├── RateOfChangeVisitor.html │ ├── RelativeVigorIndexVisitor.html │ ├── ReturnVisitor.html │ ├── RollingMidValueVisitor.html │ ├── SEMVisitor.html │ ├── SLRegressionVisitor.html │ ├── SampleZScoreVisitor.html │ ├── SeasonalPeriodVisitor.html │ ├── SharpeRatioVisitor.html │ ├── SigmoidVisitor.html │ ├── SimpleRollAdopter.html │ ├── SlopeVisitor.html │ ├── SpectralClusteringVisitor.html │ ├── StationaryCheckVisitor.html │ ├── StatsVisitor.html │ ├── StdVisitor.html │ ├── StepRollAdopter.html │ ├── SumVisitor.html │ ├── SymmTriangleMovingMeanVisitor.html │ ├── T3MovingMeanVisitor.html │ ├── TTMTrendVisitor.html │ ├── TTestVisitor.html │ ├── TrackingErrorVisitor.html │ ├── TrixVisitor.html │ ├── TrueRangeVisitor.html │ ├── UlcerIndexVisitor.html │ ├── UltimateOSCIVisitor.html │ ├── VWAPVisitor.html │ ├── VWBASVisitor.html │ ├── VarIdxDynAvgVisitor.html │ ├── VarVisitor.html │ ├── VectorSimilarityVisitor.html │ ├── VertHorizFilterVisitor.html │ ├── VirtualString.html │ ├── VortexVisitor.html │ ├── WilliamPrcRVisitor.html │ ├── YangZhangVolVisitor.html │ ├── ZScoreVisitor.html │ ├── ZeroLagMovingMeanVisitor.html │ ├── any_type.html │ ├── append_column.html │ ├── append_index.html │ ├── append_row.html │ ├── apply.html │ ├── assign.html │ ├── bucketize.html │ ├── canon_corr.html │ ├── change_freq.html │ ├── col_name_to_idx.html │ ├── combine.html │ ├── concat.html │ ├── consolidate.html │ ├── contiguous_memory.html │ ├── copying_data.html │ ├── covariance_matrix.html │ ├── create_column.html │ ├── describe.html │ ├── detect_and_change.html │ ├── detect_method.html │ ├── difference.html │ ├── drop_missing.html │ ├── duplication_mask.html │ ├── empty.html │ ├── explode.html │ ├── fast_ica.html │ ├── file_dtypes.html │ ├── from_string.html │ ├── garbage_in_garbage_out.html │ ├── gen_bernoulli_dist.html │ ├── gen_binomial_dist.html │ ├── gen_cauchy_dist.html │ ├── gen_chi_squared_dist.html │ ├── gen_datetime_index.html │ ├── gen_exponential_dist.html │ ├── gen_extreme_value_dist.html │ ├── gen_fisher_f_dist.html │ ├── gen_gamma_dist.html │ ├── gen_geometric_dist.html │ ├── gen_log_space_nums.html │ ├── gen_lognormal_dist.html │ ├── gen_negative_binomial_dist.html │ ├── gen_normal_dist.html │ ├── gen_poisson_dist.html │ ├── gen_sequence_index.html │ ├── gen_student_t_dist.html │ ├── gen_uniform_int_dist.html │ ├── gen_uniform_real_dist.html │ ├── gen_weibull_dist.html │ ├── get_above_quantile_data.html │ ├── get_col_unique_values.html │ ├── get_column.html │ ├── get_columns_info.html │ ├── get_data.html │ ├── get_data_after_times.html │ ├── get_data_at_times.html │ ├── get_data_before_times.html │ ├── get_data_between_times.html │ ├── get_data_by_affin.html │ ├── get_data_by_dbscan.html │ ├── get_data_by_idx.html │ ├── get_data_by_kmeans.html │ ├── get_data_by_like.html │ ├── get_data_by_loc.html │ ├── get_data_by_mshift.html │ ├── get_data_by_rand.html │ ├── get_data_by_sel.html │ ├── get_data_by_spectral.html │ ├── get_data_by_stdev.html │ ├── get_data_in_months.html │ ├── get_data_on_days.html │ ├── get_data_on_days_in_month.html │ ├── get_index.html │ ├── get_memory_usage.html │ ├── get_reindexed.html │ ├── get_row.html │ ├── get_str_col_stats.html │ ├── get_top_n_data.html │ ├── global_operators.html │ ├── groupby.html │ ├── has_column.html │ ├── how_to_write_visitors.html │ ├── in_between.html │ ├── inversion_count.html │ ├── io_format.html │ ├── is_equal.html │ ├── join_by_column.html │ ├── knn.html │ ├── load_column.html │ ├── load_data.html │ ├── load_index.html │ ├── load_indicators.html │ ├── load_result_as_column.html │ ├── make_consistent.html │ ├── make_stationary.html │ ├── mask.html │ ├── mean_type.html │ ├── modify_by_idx.html │ ├── multi_visit.html │ ├── multithreading.html │ ├── nan_policy.html │ ├── pattern_spec.html │ ├── pca_by_eigen.html │ ├── peaks.html │ ├── pointers.html │ ├── read.html │ ├── remove_above_quantile_data.html │ ├── remove_column.html │ ├── remove_data_by_fft.html │ ├── remove_data_by_hampel.html │ ├── remove_data_by_idx.html │ ├── remove_data_by_iqr.html │ ├── remove_data_by_like.html │ ├── remove_data_by_loc.html │ ├── remove_data_by_sel.html │ ├── remove_data_by_stdev.html │ ├── remove_data_by_zscore.html │ ├── remove_duplicates.html │ ├── remove_lock.html │ ├── remove_top_n_data.html │ ├── rename_column.html │ ├── replace.html │ ├── retype_column.html │ ├── roll_policy.html │ ├── rotate.html │ ├── self_contained.html │ ├── self_shift.html │ ├── shape.html │ ├── shrink_to_fit.html │ ├── shuffle.html │ ├── single_act_visit.html │ ├── sort.html │ ├── sort_state.html │ ├── starts_with.html │ ├── std_variant.html │ ├── threads.html │ ├── time_frequency.html │ ├── to_string.html │ ├── transpose.html │ ├── truncate.html │ ├── value_counts.html │ ├── visit.html │ └── write.html └── LionLookingUp.jpg ├── examples ├── CMakeLists.txt └── hello_world.cc ├── include └── DataFrame │ ├── DataFrame.h │ ├── DataFrameExports.h │ ├── DataFrameFinancialVisitors.h │ ├── DataFrameMLVisitors.h │ ├── DataFrameOperators.h │ ├── DataFrameStatsVisitors.h │ ├── DataFrameTransformVisitors.h │ ├── DataFrameTypes.h │ ├── Internals │ ├── DataFrame.tcc │ ├── DataFrame_functors.h │ ├── DataFrame_get.tcc │ ├── DataFrame_join.tcc │ ├── DataFrame_misc.tcc │ ├── DataFrame_opt.tcc │ ├── DataFrame_private_decl.h │ ├── DataFrame_read.tcc │ ├── DataFrame_remove.tcc │ ├── DataFrame_set.tcc │ ├── DataFrame_shift.tcc │ ├── DataFrame_slice.tcc │ ├── DataFrame_sort.tcc │ ├── DataFrame_standalone.tcc │ ├── DataFrame_visit.tcc │ ├── DataFrame_write.tcc │ └── RandGen.tcc │ ├── RandGen.h │ ├── Utils │ ├── AlignedAllocator.h │ ├── Concepts.h │ ├── DateTime.h │ ├── Endianness.h │ ├── FixedSizeAllocator.h │ ├── FixedSizePriorityQueue.h │ ├── FixedSizeString.h │ ├── IsolationTree.h │ ├── IsolationTree.tcc │ ├── Matrix.h │ ├── Matrix.tcc │ ├── MetaProg.h │ ├── Threads │ │ ├── SharedQueue.h │ │ ├── SharedQueue.tcc │ │ ├── ThreadGranularity.h │ │ ├── ThreadPool.h │ │ └── ThreadPool.tcc │ └── Utils.h │ └── Vectors │ ├── HeteroConstPtrView.h │ ├── HeteroConstPtrView.tcc │ ├── HeteroConstView.h │ ├── HeteroConstView.tcc │ ├── HeteroPtrView.h │ ├── HeteroPtrView.tcc │ ├── HeteroVector.h │ ├── HeteroVector.tcc │ ├── HeteroView.h │ ├── HeteroView.tcc │ ├── VectorPtrView.h │ └── VectorView.h ├── package.json ├── src ├── CommonMakefile.mk ├── Makefile.Linux.GCC64 ├── Makefile.Linux.GCC64D ├── Utils │ └── DateTime.cc └── build_all.sh └── test ├── CMakeLists.txt ├── allocator_tester.cc ├── dataframe_tester.cc ├── dataframe_tester_2.cc ├── dataframe_tester_3.cc ├── dataframe_tester_4.cc ├── dataframe_tester_output.txt ├── dataframe_tester_schema.cc ├── dataframe_thread_safety.cc ├── date_time_tester.cc ├── gen_rand_tester.cc ├── iso_tree_tester.cc ├── matrix_tester.cc ├── meta_prog_tester.cc ├── vector_ptr_view_tester.cc └── vectors_tester.cc /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | 2 | github: [hosseinmoein] 3 | -------------------------------------------------------------------------------- /.github/workflows/codacy.yml: -------------------------------------------------------------------------------- 1 | # This workflow uses actions that are not certified by GitHub. 2 | # They are provided by a third-party and are governed by 3 | # separate terms of service, privacy policy, and support 4 | # documentation. 5 | 6 | # This workflow checks out code, performs a Codacy security scan 7 | # and integrates the results with the 8 | # GitHub Advanced Security code scanning feature. For more information on 9 | # the Codacy security scan action usage and parameters, see 10 | # https://github.com/codacy/codacy-analysis-cli-action. 11 | # For more information on Codacy Analysis CLI in general, see 12 | # https://github.com/codacy/codacy-analysis-cli. 13 | 14 | name: Codacy Security Scan 15 | 16 | on: 17 | push: 18 | branches: [ "master" ] 19 | pull_request: 20 | # The branches below must be a subset of the branches above 21 | branches: [ "master" ] 22 | schedule: 23 | - cron: '38 18 * * 3' 24 | 25 | permissions: 26 | contents: read 27 | 28 | jobs: 29 | codacy-security-scan: 30 | permissions: 31 | contents: read # for actions/checkout to fetch code 32 | security-events: write # for github/codeql-action/upload-sarif to upload SARIF results 33 | actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status 34 | name: Codacy Security Scan 35 | runs-on: ubuntu-latest 36 | steps: 37 | # Checkout the repository to the GitHub Actions runner 38 | - name: Checkout code 39 | uses: actions/checkout@v3 40 | 41 | # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis 42 | - name: Run Codacy Analysis CLI 43 | uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b 44 | with: 45 | # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository 46 | # You can also omit the token and run the tools that support default configurations 47 | project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} 48 | verbose: true 49 | output: results.sarif 50 | format: sarif 51 | # Adjust severity of non-security issues 52 | gh-code-scanning-compat: true 53 | # Force 0 exit code to allow SARIF file generation 54 | # This will handover control about PR rejection to the GitHub side 55 | max-allowed-issues: 2147483647 56 | 57 | # Upload the SARIF file generated in the previous step 58 | - name: Upload SARIF results file 59 | uses: github/codeql-action/upload-sarif@v2 60 | with: 61 | sarif_file: results.sarif 62 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ master ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ master ] 20 | schedule: 21 | - cron: '30 20 * * 1' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: [ 'cpp', 'python' ] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 37 | # Learn more about CodeQL language support at https://git.io/codeql-language-support 38 | 39 | steps: 40 | - name: Checkout repository 41 | uses: actions/checkout@v2 42 | 43 | # Initializes the CodeQL tools for scanning. 44 | - name: Initialize CodeQL 45 | uses: github/codeql-action/init@v1 46 | with: 47 | languages: ${{ matrix.language }} 48 | # If you wish to specify custom queries, you can do so here or in a config file. 49 | # By default, queries listed here will override any specified in a config file. 50 | # Prefix the list here with "+" to use these queries and those in the config file. 51 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 52 | 53 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 54 | # If this step fails, then you should remove it and run the build manually (see below) 55 | - name: Autobuild 56 | uses: github/codeql-action/autobuild@v1 57 | 58 | # ℹ️ Command-line programs to run using the OS shell. 59 | # 📚 https://git.io/JvXDl 60 | 61 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 62 | # and modify them (or add more) to build your code if your project 63 | # uses a compiled language 64 | 65 | #- run: | 66 | # make bootstrap 67 | # make release 68 | 69 | - name: Perform CodeQL Analysis 70 | uses: github/codeql-action/analyze@v1 71 | -------------------------------------------------------------------------------- /.github/workflows/macos-build.yml: -------------------------------------------------------------------------------- 1 | name: MacOS-build 2 | 3 | on: 4 | push: 5 | branches: 6 | - '*' 7 | pull_request: 8 | branches: [ master ] 9 | 10 | jobs: 11 | build: 12 | 13 | runs-on: macos-14 14 | 15 | steps: 16 | - uses: actions/checkout@v4 17 | - uses: maxim-lobanov/setup-xcode@v1 18 | with: 19 | xcode-version: '16.2' 20 | - name: CMake set-up 21 | run: cmake -G "Unix Makefiles" -DHMDF_TESTING=ON -DHMDF_EXAMPLES=ON -DHMDF_BENCHMARKS=ON -DCMAKE_BUILD_TYPE=Release . 22 | - name: CMake build 23 | run: cmake --build . 24 | - name: CMake ctest 25 | run: ctest -C Release 26 | -------------------------------------------------------------------------------- /.github/workflows/msvc.yml: -------------------------------------------------------------------------------- 1 | # This workflow uses actions that are not certified by GitHub. 2 | # They are provided by a third-party and are governed by 3 | # separate terms of service, privacy policy, and support 4 | # documentation. 5 | # 6 | # Find more information at: 7 | # https://github.com/microsoft/msvc-code-analysis-action 8 | 9 | name: Microsoft C++ Code Analysis 10 | 11 | on: 12 | push: 13 | branches: [ "master" ] 14 | pull_request: 15 | branches: [ "master" ] 16 | schedule: 17 | - cron: '25 0 * * 6' 18 | 19 | env: 20 | # Path to the CMake build directory. 21 | build: '${{ github.workspace }}/build' 22 | 23 | permissions: 24 | contents: read 25 | 26 | jobs: 27 | analyze: 28 | permissions: 29 | contents: read # for actions/checkout to fetch code 30 | security-events: write # for github/codeql-action/upload-sarif to upload SARIF results 31 | actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status 32 | name: Analyze 33 | runs-on: windows-latest 34 | 35 | steps: 36 | - name: Checkout repository 37 | uses: actions/checkout@v3 38 | 39 | - name: Configure CMake 40 | run: cmake -B ${{ env.build }} 41 | 42 | # Build is not required unless generated source files are used 43 | # - name: Build CMake 44 | # run: cmake --build ${{ env.build }} 45 | 46 | - name: Initialize MSVC Code Analysis 47 | uses: microsoft/msvc-code-analysis-action@04825f6d9e00f87422d6bf04e1a38b1f3ed60d99 48 | # Provide a unique ID to access the sarif output path 49 | id: run-analysis 50 | with: 51 | cmakeBuildDirectory: ${{ env.build }} 52 | # Ruleset file that will determine what checks will be run 53 | ruleset: NativeRecommendedRules.ruleset 54 | 55 | # Upload SARIF file to GitHub Code Scanning Alerts 56 | - name: Upload SARIF to GitHub 57 | uses: github/codeql-action/upload-sarif@v2 58 | with: 59 | sarif_file: ${{ steps.run-analysis.outputs.sarif }} 60 | 61 | # Upload SARIF file as an Artifact to download and view 62 | # - name: Upload SARIF as an Artifact 63 | # uses: actions/upload-artifact@v3 64 | # with: 65 | # name: sarif-file 66 | # path: ${{ steps.run-analysis.outputs.sarif }} 67 | -------------------------------------------------------------------------------- /.github/workflows/windows-build.yml: -------------------------------------------------------------------------------- 1 | name: Windows-build 2 | 3 | on: 4 | push: 5 | branches: 6 | - '*' 7 | pull_request: 8 | branches: [ master ] 9 | 10 | jobs: 11 | build: 12 | 13 | runs-on: windows-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v4 17 | - name: CMake set-up 18 | run: cmake -S . `-DCMAKE_BUILD_TYPE=Release -DHMDF_TESTING=ON -DHMDF_EXAMPLES=ON -DHMDF_BENCHMARKS=ON` 19 | - name: CMake build 20 | run: cmake --build . --config Release 21 | - name: CMake ctest 22 | run: ctest -C Release 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | \bin 2 | \lib 3 | \obj 4 | 5 | \build 6 | \install 7 | \Release 8 | \Debug 9 | 10 | #add support for jetbrains IDE 11 | .idea/ 12 | cmake-build* 13 | -------------------------------------------------------------------------------- /License: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019-2026, Hossein Moein 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: '{build}' 2 | 3 | skip_tags: true 4 | 5 | image: 6 | - Visual Studio 2022 7 | 8 | platform: 9 | - x64 10 | # - x86 11 | 12 | test: off 13 | 14 | clone_folder: c:\Repos\source 15 | 16 | install: 17 | # - ps: if($env:PLATFORM -eq 'x64') { $env:arch = ' Win64'; } else { $env:arch = ''; } # Null for x86 builds 18 | - ps: $env:arch = ' Win64'; 19 | 20 | build_script: 21 | - cd C:\Repos\source\ 22 | - mkdir build 23 | - cd build 24 | - cmake --version 25 | - cmake C:\Repos\source -G "Visual Studio 17 2022" -DHMDF_TESTING=ON -DHMDF_EXAMPLES=ON -DHMDF_BENCHMARKS=ON 26 | - cmake --build . --config "Release" 27 | 28 | test_script: 29 | - ctest -C Release --output-on-failure 30 | -------------------------------------------------------------------------------- /benchmarks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(dataframe_performance dataframe_performance.cc) 2 | target_link_libraries(dataframe_performance PRIVATE DataFrame) 3 | 4 | add_executable(dataframe_performance_2 dataframe_performance_2.cc) 5 | target_link_libraries(dataframe_performance_2 PRIVATE DataFrame) 6 | 7 | add_executable(linkedin_benchmark linkedin_benchmark.cc) 8 | target_link_libraries(linkedin_benchmark PRIVATE DataFrame) 9 | -------------------------------------------------------------------------------- /benchmarks/dataframe_performance_2.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Hossein Moein and/or the DataFrame nor the 13 | names of its contributors may be used to endorse or promote products 14 | derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include <DataFrame/DataFrame.h> 29 | #include <DataFrame/DataFrameStatsVisitors.h> 30 | #include <DataFrame/RandGen.h> 31 | 32 | #include <iostream> 33 | 34 | using namespace hmdf; 35 | 36 | typedef StdDataFrame<unsigned int> MyDataFrame; 37 | 38 | // ----------------------------------------------------------------------------- 39 | 40 | int main(int, char *[]) { 41 | 42 | std::cout << "Starting ... " << time(nullptr) << std::endl; 43 | 44 | MyDataFrame df; 45 | auto index_vec = MyDataFrame::gen_sequence_index(0, 1100000000); 46 | const auto index_sz = index_vec.size(); 47 | 48 | RandGenParams<double> p; 49 | 50 | p.mean = 0; 51 | p.std = 1; 52 | p.s = 1; 53 | p.lambda = 1; 54 | df.load_data(std::move(index_vec), 55 | std::make_pair("normal", gen_normal_dist<double>(index_sz, p)), 56 | std::make_pair("log_normal", gen_lognormal_dist<double>(index_sz, p)), 57 | std::make_pair("exponential", gen_exponential_dist<double>(index_sz, p))); 58 | 59 | std::cout << "All memory allocations are done. Calculating means ... " << time(nullptr)<< std::endl; 60 | 61 | ewm_v<double, unsigned int> n_mv(exponential_decay_spec::span, 3, true); 62 | ewm_v<double, unsigned int> ln_mv(exponential_decay_spec::span, 3, true); 63 | ewm_v<double, unsigned int> e_mv(exponential_decay_spec::span, 3, true); 64 | auto fut1 = df.single_act_visit_async<double>("normal", n_mv); 65 | auto fut2 = df.single_act_visit_async<double>("log_normal", ln_mv); 66 | auto fut3 = df.single_act_visit_async<double>("exponential", e_mv); 67 | 68 | std::cout << fut1.get().get_result()[100000] << ", " 69 | << fut2.get().get_result()[100000] << ", " 70 | << fut3.get().get_result()[100000] << std::endl; 71 | std::cout << time(nullptr) << " ... Done" << std::endl; 72 | return (0); 73 | } 74 | 75 | // ----------------------------------------------------------------------------- 76 | 77 | // Local Variables: 78 | // mode:C++ 79 | // tab-width:4 80 | // c-basic-offset:4 81 | // End: 82 | -------------------------------------------------------------------------------- /benchmarks/dataframe_read_large_file.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Hossein Moein and/or the DataFrame nor the 13 | names of its contributors may be used to endorse or promote products 14 | derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include <DataFrame/DataFrame.h> 29 | 30 | #include <chrono> 31 | #include <cstdint> 32 | #include <cstdlib> 33 | #include <ctime> 34 | #include <iostream> 35 | #include <random> 36 | 37 | using namespace hmdf; 38 | using namespace std::chrono; 39 | 40 | // A DataFrame with long type index 41 | // 42 | using MyDataFrame = StdDataFrame<long>; 43 | 44 | // ----------------------------------------------------------------------------- 45 | 46 | int main(int, char *[]) { 47 | 48 | /* 49 | const auto start1 = std::chrono::high_resolution_clock::now(); 50 | std::ofstream stream; 51 | 52 | stream.open("Large_File.csv"); 53 | 54 | 55 | std::random_device rd; 56 | std::mt19937_64 gen(rd()); 57 | std::uniform_real_distribution<double> ddist; 58 | std::uniform_real_distribution<float> fdist; 59 | 60 | stream << "INDEX:300000000:<long>,COL1:300000000:<uint>,COL2:300000000:<int>,COL3:300000000:<int>,COL4:300000000:<int>,COL5:300000000:<ulong>,COL6:300000000:<double>,COL7:300000000:<float>\n"; 61 | 62 | std::srand(std::time(nullptr)); 63 | for (std::size_t i = 0; i < 300'000'000; ++i) { 64 | stream << i << ',' 65 | << std::rand() << ',' 66 | << std::rand() << ',' 67 | << std::rand() << ',' 68 | << std::rand() << ',' 69 | << std::rand() << ',' 70 | << ddist(gen) << ',' 71 | << fdist(gen) << '\n'; 72 | } 73 | stream.close(); 74 | 75 | const auto end1 = std::chrono::high_resolution_clock::now(); 76 | 77 | std::cout 78 | << "Writing Took: " 79 | << double(duration_cast<microseconds>(end1 - start1).count()) / 1000000.0 80 | << " seconds\n"; 81 | */ 82 | 83 | // Now the reading 84 | // 85 | MyDataFrame df; 86 | 87 | const auto start2 = std::chrono::high_resolution_clock::now(); 88 | 89 | try { 90 | df.read("Large_File.csv", io_format::csv2); 91 | } 92 | catch (const DataFrameError &ex) { 93 | std::cout << ex.what() << std::endl; 94 | } 95 | 96 | const auto end2 = std::chrono::high_resolution_clock::now(); 97 | 98 | std::cout << "Column Length: " 99 | << df.get_column<double>("COL6").size() << '\n'; 100 | std::cout 101 | << "Reading Took: " 102 | << double(duration_cast<microseconds>(end2 - start2).count()) / 1000000.0 103 | << " seconds\n"; 104 | 105 | /* 106 | df.write<long, unsigned int, int, unsigned long, double, float> 107 | ("Large_File.dat", io_format::binary); 108 | */ 109 | 110 | return (0); 111 | } 112 | 113 | // ----------------------------------------------------------------------------- 114 | 115 | // Local Variables: 116 | // mode:C++ 117 | // tab-width:4 118 | // c-basic-offset:4 119 | // End: 120 | -------------------------------------------------------------------------------- /benchmarks/linkedin_benchmark.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Hossein Moein and/or the DataFrame nor the 13 | names of its contributors may be used to endorse or promote products 14 | derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include <DataFrame/DataFrame.h> 29 | #include <DataFrame/DataFrameStatsVisitors.h> 30 | #include <DataFrame/RandGen.h> 31 | 32 | #include <chrono> 33 | #include <cstdint> 34 | #include <iostream> 35 | 36 | using namespace hmdf; 37 | 38 | // Number of data points 39 | // 40 | constexpr std::size_t DATA_SIZE = 100000000; 41 | 42 | // A DataFrame with time_t type index 43 | // 44 | using MyDataFrame = StdDataFrame<time_t>; 45 | 46 | // ----------------------------------------------------------------------------- 47 | 48 | // The visitor implementing the benchmark logic 49 | // 50 | template<arithmetic T, typename I> 51 | struct MyVisitor { 52 | 53 | DEFINE_VISIT_BASIC_TYPES_2 54 | 55 | inline void operator() (const I &, const T &val) { 56 | 57 | sum_ += std::labs(val - 2); 58 | } 59 | PASS_DATA_ONE_BY_ONE 60 | 61 | 62 | inline void pre () { sum_ = 0; } 63 | inline result_type get_result () const { return (sum_); } 64 | inline void post () { } 65 | 66 | MyVisitor() = default; 67 | 68 | private: 69 | 70 | result_type sum_ { 0 }; 71 | }; 72 | 73 | // ----------------------------------------------------------------------------- 74 | 75 | int main(int, char *[]) { 76 | 77 | const auto start = std::chrono::high_resolution_clock::now(); 78 | auto index_vec = MyDataFrame::gen_sequence_index(0, DATA_SIZE, 1); 79 | MyDataFrame df; 80 | RandGenParams<int64_t> param; 81 | 82 | param.min_value = -10000000; 83 | param.max_value = 10000000; 84 | df.load_data(std::move(index_vec), 85 | std::make_pair("uniform", gen_uniform_int_dist<int64_t>(DATA_SIZE, param))); 86 | 87 | const auto middle = std::chrono::high_resolution_clock::now(); 88 | 89 | MyVisitor<int64_t, time_t> my_visit; 90 | 91 | df.visit<int64_t>("uniform", my_visit); 92 | 93 | const auto last = std::chrono::high_resolution_clock::now(); 94 | 95 | std::cout << "Result: " << my_visit.get_result() << '\n' 96 | << "Calculation Time: " 97 | << std::chrono::duration_cast<std::chrono::duration<double>>(last - middle).count() << '\n' 98 | << "Overall Time: " 99 | << std::chrono::duration_cast<std::chrono::duration<double>>(last - start).count() 100 | << std::endl; 101 | return (0); 102 | } 103 | 104 | // ----------------------------------------------------------------------------- 105 | 106 | // Local Variables: 107 | // mode:C++ 108 | // tab-width:4 109 | // c-basic-offset:4 110 | // End: 111 | -------------------------------------------------------------------------------- /benchmarks/linkedin_benchmark.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | import time 4 | 5 | # ------------------------------------------------------------------------------ 6 | 7 | start: float = float(time.time()) 8 | 9 | length: int = 100000000 10 | 11 | df = pd.DataFrame( 12 | { "INDEX": np.arange(0, length), 13 | "uniform": np.random.randint(-10000000, high=10000000, size=length, dtype=np.int64) 14 | }) 15 | df.set_index("INDEX") 16 | 17 | middle: float = float(time.time()) 18 | result = (df["uniform"] - 2).abs().sum() 19 | 20 | last: float = float(time.time()) 21 | 22 | print(f"Result: {result}") 23 | print(f"Calculation Time: {last - middle}\nOverall Time: {last - start}") 24 | 25 | # ------------------------------------------------------------------------------ 26 | 27 | # Local Variables: 28 | # mode:Python 29 | # tab-width:4 30 | # c-basic-offset:4 31 | # End: 32 | -------------------------------------------------------------------------------- /benchmarks/pandas_performance.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import numpy as np 3 | import pandas as pd 4 | 5 | # ------------------------------------------------------------------------------ 6 | 7 | SIZE: int = 300000000 8 | 9 | first = datetime.datetime.now() 10 | df = pd.DataFrame({"normal": np.random.normal(size=SIZE), 11 | "log_normal": np.random.lognormal(size=SIZE), 12 | "exponential": np.random.exponential(size=SIZE), 13 | }) 14 | second = datetime.datetime.now() 15 | print(f"Data generation/load time: " 16 | f"{(second - first).seconds}.{(second - first).microseconds}") 17 | 18 | mean: float = df["normal"].mean() 19 | var: float = df["log_normal"].var() 20 | corr: float = df["exponential"].corr(df["log_normal"]) 21 | 22 | print(f"{mean}, {var}, {corr}") 23 | third = datetime.datetime.now() 24 | 25 | df2 = df[df["log_normal"] > 8] 26 | print(f"Number of rows after select: {len(df2)}") 27 | fourth = datetime.datetime.now() 28 | 29 | print(f"Calculation time: {(third - second).seconds}.{(third - second).microseconds}") 30 | print(f"Selection time: {(fourth - third).seconds}.{(fourth - third).microseconds}") 31 | print(f"Overall time: {(fourth - first).seconds}.{(fourth - first).microseconds}") 32 | 33 | # ------------------------------------------------------------------------------ 34 | 35 | # Local Variables: 36 | # mode:Python 37 | # tab-width:4 38 | # c-basic-offset:4 39 | # End: 40 | 41 | -------------------------------------------------------------------------------- /benchmarks/pandas_performance_2.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | import time 4 | 5 | # ------------------------------------------------------------------------------ 6 | 7 | print(f"Starting ... {int(time.time())}"); 8 | 9 | length: int = 1100000000 10 | 11 | df = pd.DataFrame({"INDEX": np.arange(0, length), 12 | "normal": np.random.normal(size=length), 13 | "log_normal": np.random.lognormal(size=length), 14 | "exponential": np.random.exponential(size=length), 15 | }) 16 | df.set_index("INDEX") 17 | 18 | print(f"All memory allocations are done. Calculating means ... {int(time.time())}") 19 | 20 | m1: pd.Series = df["normal"].ewm(span=3).mean() 21 | m2: pd.Series = df["log_normal"].ewm(span=3).mean() 22 | m3: pd.Series = df["exponential"].ewm(span=3).mean() 23 | 24 | print(f"{m1[100000]}, {m2[100000]}, {m3[100000]}") 25 | print(f"{int(time.time())} ... Done"); 26 | 27 | # ------------------------------------------------------------------------------ 28 | 29 | # Local Variables: 30 | # mode:Python 31 | # tab-width:4 32 | # c-basic-offset:4 33 | # End: 34 | -------------------------------------------------------------------------------- /benchmarks/pandas_read_large_file.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import pandas as pd 3 | 4 | # ------------------------------------------------------------------------------ 5 | 6 | start = datetime.datetime.now() 7 | df = df = pd.read_csv("Large_File.csv") 8 | end = datetime.datetime.now() 9 | 10 | print(f"Column Length: {len(df['COL6:200000000:<int>'])}") 11 | print(f"Reading Took: {(end - start).seconds}.{(end - start).microseconds}") 12 | 13 | # ------------------------------------------------------------------------------ 14 | 15 | # Local Variables: 16 | # mode:Python 17 | # tab-width:4 18 | # c-basic-offset:4 19 | # End: 20 | 21 | -------------------------------------------------------------------------------- /benchmarks/polars_performance.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import numpy as np 3 | import polars as pl 4 | 5 | # ------------------------------------------------------------------------------ 6 | 7 | SIZE: int = 300000000 8 | # SIZE: int = 10000000 9 | 10 | first = datetime.datetime.now() 11 | df = pl.DataFrame({"normal": np.random.normal(size=SIZE), 12 | "log_normal": np.random.lognormal(size=SIZE), 13 | "exponential": np.random.exponential(size=SIZE), 14 | }) 15 | second = datetime.datetime.now() 16 | print(f"Data generation/load time: " 17 | f"{(second - first).seconds}.{(second - first).microseconds} secs") 18 | 19 | df2 = df.select( 20 | mean = pl.col("normal").mean(), 21 | var = pl.col("log_normal").var(), 22 | corr = pl.corr("exponential", "log_normal") 23 | ) 24 | 25 | mean: float = df2["mean"] 26 | var: float = df2["var"] 27 | corr: float = df2["corr"] 28 | 29 | print(f"{mean[0]}, {var[0]}, {corr[0]}") 30 | third = datetime.datetime.now() 31 | 32 | df3 = df.filter(pl.col("log_normal") > 8) 33 | print(f"Number of rows after select: {df3.select(pl.len()).item()}") 34 | fourth = datetime.datetime.now() 35 | 36 | # df4 = df.sort(["log_normal", "exponential"]); 37 | # print(f"1001th value in normal column: {df4['normal'][1001]}") 38 | fifth = datetime.datetime.now() 39 | 40 | print(f"Calculation time: {(third - second).seconds}.{(third - second).microseconds} secs") 41 | print(f"Selection time: {(fourth - third).seconds}.{(fourth - third).microseconds} secs") 42 | # print(f"Sorting time: {(fifth - fourth).seconds}.{(fifth - fourth).microseconds} secs") 43 | print(f"Overall time: {(fifth - first).seconds}.{(fifth - first).microseconds} secs") 44 | 45 | # ------------------------------------------------------------------------------ 46 | 47 | # Local Variables: 48 | # mode:Python 49 | # tab-width:4 50 | # c-basic-offset:4 51 | # End: 52 | -------------------------------------------------------------------------------- /benchmarks/polars_read_large_file.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import polars as pl 3 | 4 | # ------------------------------------------------------------------------------ 5 | 6 | 7 | start = datetime.datetime.now() 8 | df = pl.read_csv("Large_File.csv") 9 | end = datetime.datetime.now() 10 | 11 | print(f"Column Length: {df.select(pl.count()).item()}") 12 | print(f"Reading Took: {(end - start).seconds}.{(end - start).microseconds}") 13 | 14 | # ------------------------------------------------------------------------------ 15 | 16 | # Local Variables: 17 | # mode:Python 18 | # tab-width:4 19 | # c-basic-offset:4 20 | # End: 21 | -------------------------------------------------------------------------------- /cmake/DataFrame.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ 4 | libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ 5 | 6 | Name: DataFrame 7 | Description: C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ using native types and contiguous memory storage 8 | Version: @PROJECT_VERSION@ 9 | Cflags: -I${includedir} 10 | Libs: -L${libdir} -lDataFrame@DATAFRAME_PKG_EXTRA_LIBS@ 11 | -------------------------------------------------------------------------------- /cmake/DataFrameConfig.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include(CMakeFindDependencyMacro) 4 | find_dependency(Threads) 5 | 6 | include("${CMAKE_CURRENT_LIST_DIR}/DataFrameTargets.cmake") 7 | 8 | check_required_components(DataFrame) 9 | -------------------------------------------------------------------------------- /data/AAPL_10dBucketWithMaps.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosseinmoein/DataFrame/606d1bca2cdfd6564ade3aa6abdb6a2448ea8ed3/data/AAPL_10dBucketWithMaps.dat -------------------------------------------------------------------------------- /data/AAPL_10dBucketWithMaps_small.csv: -------------------------------------------------------------------------------- 1 | INDEX:5:<DateTimeAME>,Open:5:<double>,High:5:<double>,Low:5:<double>,Close:5:<double>,Mean:5:<double>,Median:5:<double>,25% Quantile:5:<double>,Std:5:<double>,MAD:5:<double>,Map 1:5:<str_dbl_map>,Unordered Map:5:<str_dbl_unomap>,Str Vec:5:<str_vec>,Double Set:5:<dbl_set>,Str Set:5:<str_set>,Volume:5:<long> 2 | 01/14/2000 00:00:00.000,0.999442,0.999442,0.77846,0.896763,0.8819754,0.8805805,0.8560265,0.060093197,0.0436942,3{label one 1:123.0|label one 2:-782.5|label one 3:444.44},3{Key one 1:123.0|Key one 2:-782.5|Key one 3:444.44},4[bbb|aaa|zzz|ddd],3[123.0|-782.5|444.44],3[123.0|-782.5|444.44],6400945600 3 | 01/31/2000 00:00:00.000,0.928013,1.013393,0.907366,0.926339,0.9637277,0.966797,0.938337,0.036251929,0.0313617,3{label two 1:123.0|label two 2:-782.5|label two 3:444.44},3{Key two 1:123.0|Key two 2:-782.5|Key two 3:444.44},4[aaa|bbb|ccc|www],3[1:123.0|-782.5|:444.44],3[1:123.0|-782.5|:444.44],6154232000 4 | 02/14/2000 00:00:00.000,0.895089,1.03404,0.882254,1.03404,0.9732142,0.988281,0.9433595,0.05597332,0.0462054,3{label three 1:123.0|label three 2:-782.5|label three 3:444.44},3{Key three 1:123.0|Key three 2:-782.5|Key three 3:444.44},4[123|abc|345|list],3[123.0|-782.5|444.44],3[123.0|-782.5|444.44],3714592000 5 | 02/29/2000 00:00:00.000,1.0625,1.0625,0.985491,1.023438,1.0203265,1.0212055,1.013672,0.021711375,0.0153041,3{label four 1:123.0|label four 2:-782.5|label four 3:444.44},3{Key four 1:123.0|Key four 2:-782.5|Key four 3:444.44},3[bbb|aaa|zzz],4[123.0|-782.5|444.44|100.5],4[123.0|-782.5|444.44|100.5],3605190400 6 | -------------------------------------------------------------------------------- /data/AAPL_10dBucketWithVector.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosseinmoein/DataFrame/606d1bca2cdfd6564ade3aa6abdb6a2448ea8ed3/data/AAPL_10dBucketWithVector.dat -------------------------------------------------------------------------------- /data/DT_sample.csv: -------------------------------------------------------------------------------- 1 | INDEX:11:<DateTimeISO>,IBM_Open:11:<double>,IBM_High:11:<double>,IBM_Low:11:<double>,IBM_Close:11:<double>,IBM_Adj_Close:11:<double>,IBM_Volume:11:<long>,Date_Col:11:<DateTimeAME> 2 | 2000-11-01,98.437500,99.875000,97.250000,98.562500,62.795776,7466200,11/02/2022 3 | 2000-11-02,99.000000,102.312500,98.500000,101.937500,64.946083,7445100,11/03/2022 4 | 2000-11-03,102.500000,102.625000,99.375000,100.125000,63.791306,5848500,11/11/2022 13:20:50 5 | 2000-11-06,99.875000,102.375000,99.437500,100.312500,63.910774,4448500,11/02/2023 6 | 2000-11-07,101.125000,103.500000,100.687500,102.312500,65.185028,5420600,11/02/2024 14:21:50.123 7 | 2000-11-08,103.625000,103.750000,99.250000,100.000000,63.792744,6990800,12/02/2022 13:20:50 8 | 2000-11-09,96.750000,100.000000,95.687500,99.437500,63.433865,9047900,12/02/2022 9 | 2000-11-10,98.000000,98.375000,93.000000,93.000000,59.327213,6807900,12/02/2022 10 | 2000-11-13,91.812500,99.437500,91.625000,97.437500,62.158020,8684900,09/22/2021 13:08:50.123 11 | 2000-11-14,99.250000,99.875000,98.500000,99.500000,63.473755,5150900,01/13/1982 12 | 2000-11-15,99.500000,100.062500,97.625000,99.375000,63.394009,4160300,10/05/1999 13 | -------------------------------------------------------------------------------- /data/SHORT_IBM.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosseinmoein/DataFrame/606d1bca2cdfd6564ade3aa6abdb6a2448ea8ed3/data/SHORT_IBM.dat -------------------------------------------------------------------------------- /data/SchemaWithHeader.csv: -------------------------------------------------------------------------------- 1 | INDEX:12:<int>,IBM_Open:12:<double>,IBM_High:12:<double>,IBM_Low:12:<double>,IBM_Close:12:<double>,IBM_Adj_Close:12:<double>,IBM_Volume:12:<long> 2 | 1,187.210007,187.399994,185.199997,185.529999,140.697495,4546500 3 | 2,185.830002,187.350006,185.300003,186.639999,141.539261,4063200 4 | 3,187.149994,187.360001,185.300003,186.000000,141.053940,4067800 5 | 4,186.389999,190.350006,186.380005,189.710007,143.867477,5932300 6 | 5,189.330002,189.419998,187.259995,187.970001,142.547913,4603700 7 | 6,189.020004,189.500000,186.550003,187.380005,142.100449,4321300 8 | 7,188.309998,188.570007,186.279999,187.259995,142.009460,4022400 9 | 8,186.259995,186.949997,183.860001,184.160004,139.658600,5784700 10 | 9,185.059998,186.429993,183.880005,185.919998,140.993225,4619200 11 | 10,185.820007,188.649994,185.490005,187.740005,142.373489,4816500 12 | 11,187.529999,188.990005,186.800003,188.759995,143.146988,4770300 13 | 12,188.039993,190.809998,187.860001,190.089996,144.155609,7644600 14 | -------------------------------------------------------------------------------- /data/SchemaWithoutHeader.csv: -------------------------------------------------------------------------------- 1 | 2 | 1,187.210007,187.399994,185.199997,185.529999,140.697495,4546500 3 | 2,185.830002,187.350006,185.300003,186.639999,141.539261,4063200 4 | 3,187.149994,187.360001,185.300003,186.000000,141.053940,4067800 5 | 4,186.389999,190.350006,186.380005,189.710007,143.867477,5932300 6 | 5,189.330002,189.419998,187.259995,187.970001,142.547913,4603700 7 | 6,189.020004,189.500000,186.550003,187.380005,142.100449,4321300 8 | 7,188.309998,188.570007,186.279999,187.259995,142.009460,4022400 9 | 8,186.259995,186.949997,183.860001,184.160004,139.658600,5784700 10 | 9,185.059998,186.429993,183.880005,185.919998,140.993225,4619200 11 | 10,185.820007,188.649994,185.490005,187.740005,142.373489,4816500 12 | 11,187.529999,188.990005,186.800003,188.759995,143.146988,4770300 13 | 12,188.039993,190.809998,187.860001,190.089996,144.155609,7644600 14 | -------------------------------------------------------------------------------- /data/client_data.csv: -------------------------------------------------------------------------------- 1 | INDEX:11:<ulong>,close:11:<double>,close2:11:<ulong> 2 | 0,13731.70654, 3 | 1,13652.44631, 4 | 2,13634.6356, 5 | 3,13567.47794, 6 | 4,13534.40545, 7 | 5,13634.03615,5 8 | 6,13622.68511,6 9 | 7,13567.4479,7 10 | 8,13586.30945,8 11 | 9,2000.005,, 12 | 10,3000.005,, 13 | -------------------------------------------------------------------------------- /data/csv2_format_data.csv: -------------------------------------------------------------------------------- 1 | INDEX:28:<ulong>,ul_col:28:<ulong>,dbl_col_2:26:<double>,bool_col:6:<bool>,str_col:25:<string>,xint_col:28:<int>,dbl_col:27:<double>,char_col:27:<char>,uchar_col:27:<uchar> 2 | 123450,123450,0.998,1,4% of something,1,1.2345,C,B 3 | 123451,123451,0.3456,1,Description 4/5,2,2.2345,23,B 4 | 123452,123452,0.056,1,This is bad,3,3.2345,^,& 5 | 123450,123450,0.15678,0,3.4% of GDP,4,4.2345,F,250 6 | 123455,123455,0.00345,0,Market drops,5,5.2345,120,B 7 | 123450,123450,0.923,1,Market pulls back,3,3,78,B 8 | 123449,123449,0.06743,,$15 increase,7,0.9999,,B 9 | 123450,123450,0.1,,Running fast,3,10,C,B 10 | 123451,123451,0.0056,,C++14 development,9,4.25,C, 11 | 123450,123450,0.07865,,Some explanation,10,0.009,C,B 12 | 123452,123452,0.0111,,More strings,3,8,C,B 13 | 123450,123450,0.1002,,Bonds vs. Equities,2,2.2222,C,40 14 | 123455,123455,-0.8888,,Almost done,3,3.3333,C,B 15 | 123450,123450,0.14,,XXXX04,14,11,C,B 16 | 123454,123454,0.0456,,XXXX2,2,5.25,C,B 17 | 123450,123450,0.078654,,XXXX3,2,1.009,, 18 | 123450,123450,-0.8999,,XXXX4,2,2.111,C, 19 | 123457,123457,0.8002,,XXXX4,3,9,C,B 20 | 123458,123458,-0.9888,,XXXX5,2,3.2222,,B 21 | 123459,123459,0.2,,XXXX6,3,4.3333,C,B 22 | 123450,123450,0.1056,,XXXX7,3,12,C,B 23 | 123441,123441,0.87865,,XXXX10,3,6.25,C,B 24 | 123442,123442,-0.6999,,XXXX11,3,2.009,C,B 25 | 123432,123432,0.4111,,XXXX02,3,3.111,C,B 26 | 123450,123450,0.1902,,XXXX03,36,10,C,B 27 | 123450,123450,-0.4888,,,2,4.2222,C,B 28 | 123435,123435,,,,45,5.3333,C,B 29 | 123450,123450,,,,2,,C,B 30 | -------------------------------------------------------------------------------- /data/csv2_format_data_2.csv: -------------------------------------------------------------------------------- 1 | INDEX:28:<ulong>,ul_col_2:28:<ulong>,dbl_col_2_2:26:<double>,bool_col_2:6:<bool>,str_col_2:25:<string>,xint_col_2:28:<int>,dbl_col_3_2:27:<double> 2 | 123450,123450,0.998,1,4% of something,1,1.2345 3 | 123451,123451,0.3456,1,Description 4/5,2,2.2345 4 | 123452,123452,0.056,1,This is bad,3,3.2345 5 | 123450,123450,0.15678,0,3.4% of GDP,4,4.2345 6 | 123455,123455,0.00345,0,Market drops,5,5.2345 7 | 123450,123450,0.923,1,Market pulls back,3,3 8 | 123449,123449,0.06743,,$15 increase,7,0.9999 9 | 123450,123450,0.1,,Running fast,3,10 10 | 123451,123451,0.0056,,C++14 development,9,4.25 11 | 123450,123450,0.07865,,Some explanation,10,0.009 12 | 123452,123452,0.0111,,More strings,3,8 13 | 123450,123450,0.1002,,Bonds vs. Equities,2,2.2222 14 | 123455,123455,-0.8888,,Almost done,3,3.3333 15 | 123450,123450,0.14,,XXXX04,14,11 16 | 123454,123454,0.0456,,XXXX2,2,5.25 17 | 123450,123450,0.078654,,XXXX3,2,1.009 18 | 123450,123450,-0.8999,,XXXX4,2,2.111 19 | 123457,123457,0.8002,,XXXX4,3,9 20 | 123458,123458,-0.9888,,XXXX5,2,3.2222 21 | 123459,123459,0.2,,XXXX6,3,4.3333 22 | 123450,123450,0.1056,,XXXX7,3,12 23 | 123441,123441,0.87865,,XXXX10,3,6.25 24 | 123442,123442,-0.6999,,XXXX11,3,2.009 25 | 123432,123432,0.4111,,XXXX02,3,3.111 26 | 123450,123450,0.1902,,XXXX03,36,10 27 | 123450,123450,-0.4888,,,2,4.2222 28 | 123435,123435,,,,45,5.3333 29 | 123450,123450,,,,2, 30 | -------------------------------------------------------------------------------- /data/csv2_format_data_no_index.csv: -------------------------------------------------------------------------------- 1 | ul_col_no_idx:28:<ulong>,dbl_col_2_no_idx:26:<double>,bool_col_no_idx:6:<bool>,str_col_no_idx:25:<string>,xint_col_no_idx:28:<int>,dbl_col_no_idx:27:<double> 2 | 123450,0.998,1,4% of something,1,1.2345 3 | 123451,0.3456,1,Description 4/5,2,2.2345 4 | 123452,0.056,1,This is bad,3,3.2345 5 | 123450,0.15678,0,3.4% of GDP,4,4.2345 6 | 123455,0.00345,0,Market drops,5,5.2345 7 | 123450,0.923,1,Market pulls back,3,3 8 | 123449,0.06743,,$15 increase,7,0.9999 9 | 123450,0.1,,Running fast,3,10 10 | 123451,0.0056,,C++14 development,9,4.25 11 | 123450,0.07865,,Some explanation,10,0.009 12 | 123452,0.0111,,More strings,3,8 13 | 123450,0.1002,,Bonds vs. Equities,2,2.2222 14 | 123455,-0.8888,,Almost done,3,3.3333 15 | 123450,0.14,,XXXX04,14,11 16 | 123454,0.0456,,XXXX2,2,5.25 17 | 123450,0.078654,,XXXX3,2,1.009 18 | 123450,-0.8999,,XXXX4,2,2.111 19 | 123457,0.8002,,XXXX4,3,9 20 | 123458,-0.9888,,XXXX5,2,3.2222 21 | 123459,0.2,,XXXX6,3,4.3333 22 | 123450,0.1056,,XXXX7,3,12 23 | 123441,0.87865,,XXXX10,3,6.25 24 | 123442,-0.6999,,XXXX11,3,2.009 25 | 123432,0.4111,,XXXX02,3,3.111 26 | 123450,0.1902,,XXXX03,36,10 27 | 123450,-0.4888,,,2,4.2222 28 | 123435,,,,45,5.3333 29 | 123450,,,,2, 30 | -------------------------------------------------------------------------------- /data/csv2_format_data_with_bars.csv: -------------------------------------------------------------------------------- 1 | INDEX:28:<ulong>|ul_col:28:<ulong>|dbl_col_2:26:<double>|bool_col:6:<bool>|str_col:25:<string>|xint_col:28:<int>|dbl_col:27:<double>|char_col:27:<char>|uchar_col:27:<uchar> 2 | 123450|123450|0.998|1|4% of something|1|1.2345|C|B 3 | 123451|123451|0.3456|1|Description 4/5|2|2.2345|23|B 4 | 123452|123452|0.056|1|This is bad|3|3.2345|^|& 5 | 123450|123450|0.15678|0|3.4% of GDP|4|4.2345|F|250 6 | 123455|123455|0.00345|0|Market drops|5|5.2345|120|B 7 | 123450|123450|0.923|1|Market pulls back|3|3|78|B 8 | 123449|123449|0.06743||$15 increase|7|0.9999||B 9 | 123450|123450|0.1||Running fast|3|10|C|B 10 | 123451|123451|0.0056||C++14 development|9|4.25|C| 11 | 123450|123450|0.07865||Some explanation|10|0.009|C|B 12 | 123452|123452|0.0111||More strings|3|8|C|B 13 | 123450|123450|0.1002||Bonds vs. Equities|2|2.2222|C|40 14 | 123455|123455|-0.8888||Almost done|3|3.3333|C|B 15 | 123450|123450|0.14||XXXX04|14|11|C|B 16 | 123454|123454|0.0456||XXXX2|2|5.25|C|B 17 | 123450|123450|0.078654||XXXX3|2|1.009|| 18 | 123450|123450|-0.8999||XXXX4|2|2.111|C| 19 | 123457|123457|0.8002||XXXX4|3|9|C|B 20 | 123458|123458|-0.9888||XXXX5|2|3.2222||B 21 | 123459|123459|0.2||XXXX6|3|4.3333|C|B 22 | 123450|123450|0.1056||XXXX7|3|12|C|B 23 | 123441|123441|0.87865||XXXX10|3|6.25|C|B 24 | 123442|123442|-0.6999||XXXX11|3|2.009|C|B 25 | 123432|123432|0.4111||XXXX02|3|3.111|C|B 26 | 123450|123450|0.1902||XXXX03|36|10|C|B 27 | 123450|123450|-0.4888|||2|4.2222|C|B 28 | 123435|123435||||45|5.3333|C|B 29 | 123450|123450||||2||C|B 30 | -------------------------------------------------------------------------------- /data/sample_data.csv: -------------------------------------------------------------------------------- 1 | # Test csv file 2 | # 3 | 4 | INDEX:28:<ulong>:123432,123433,123434,123435,123436,123441,123442,123448,123449,123450,123450,123450,123450,123450,123451,123451,123452,123452,123452,123453,123454,123455,123455,123456,123457,123458,123459,123460, 5 | ul_col:28:<ulong>:123450,123451,123452,123450,123455,123450,123449,123448,123451,123452,123452,123450,123455,123450,123454,123453,123456,123457,123458,123459,123460,123441,123442,123432,123433,123434,123435,123436, 6 | xint_col:28:<int>:35,36,40,45,46,33,34,8,7,1,4,6,12,14,2,9,3,10,11,20,15,5,13,22,23,24,25,30, 7 | str_col:28:<string>:XXXX10,XXXX11,XXXX01,XXXX02,XXXX03,XXXX6,XXXX7,Running fast,$15 increase,4% of something,3.4% of GDP,Market pulls back,Bonds vs. Equities,Here comes the sun,Description 4/5,C++14 development,This is bad,Some explanation,More strings,XXXX04,XXXX1,Market drops,Almost done,XXXX2,XXXX3,XXXX4,XXXX4,XXXX5, 8 | dbl_col:28:<double>:2.009,3.111,10,4.2222,5.3333,12,6.25,10,0.9999,1.2345,4.2345,3,8,3.3333,2.2345,4.25,3.2345,0.009,1.111,5.25,11,5.2345,2.2222,1.009,2.111,9,3.2222,4.3333, 9 | dbl_col_2:28:<double>:0.87865,-0.6999,0.4111,0.1902,-0.4888,0.2,0.1056,0.1,0.06743,0.998,0.15678,0.923,0.0111,-0.8888,0.3456,0.0056,0.056,0.07865,-0.9999,0.0456,0.14,0.00345,0.1002,0.078654,-0.8999,0.01119,0.8002,-0.9888, 10 | bool_col:28:<bool>:0,1,1,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0, 11 | Map 1:4:<str_dbl_map>:3{label one 1:123.0|label one 2:-782.5|label one 3:444.44},3{label two 1:123.0|label two 2:-782.5|label two 3:444.44},3{label three 1:123.0|label three 2:-782.5|label three 3:444.44},3{label four 1:123.0|label four 2:-782.5|label four 3:444.44}, 12 | Unordered Map:4:<str_dbl_unomap>:3{Key one 1:123.0|Key one 2:-782.5|Key one 3:444.44},3{Key two 1:123.0|Key two 2:-782.5|Key two 3:444.44},3{Key three 1:123.0|Key three 2:-782.5|Key three 3:444.44},3{Key four 1:123.0|Key four 2:-782.5|Key four 3:444.44}, 13 | Str Vec:4:<str_vec>:4[bbb|aaa|zzz|ddd],4[aaa|bbb|ccc|www],4[123|abc|345|list],3[bbb|aaa|zzz], 14 | Double Set:4:<dbl_set>:3[123.0|-782.5|444.44],3[1:123.0|-782.5|:444.44],3[123.0|-782.5|444.44],4[123.0|-782.5|444.44|100.5], 15 | Str Set:4:<str_set>:3[123.0|-782.5|444.44],3[1:123.0|-782.5|:444.44],3[123.0|-782.5|444.44],4[123.0|-782.5|444.44|100.5], 16 | Z Score:4:<dbl_vec>:10[1.95474040557|0.552535091086|0.775388936446|-0.561817339812|0.106794118727|-0.153218675013|-0.896114748672|-1.72258101434|-0.301804546072|0.246077772077],10[-0.985180680575|-0.338649566179|1.37000434149|0.831246802651|-0.415610988193|1.06213106869|0.554158098662|0.507981245453|-1.55472278822|-1.03135753378],10[-1.39575784008|-1.62506351709|-0.907239380237|-0.159508137551|0.807541881212|0.937157205458|0.578236204203|0.717820563726|-0.0398797142361|1.0866927346],10[1.94246107491|-0.062340594565|0.246115232403|-1.24462409799|-0.190844664632|0.8115331407|0.381021476571|-1.60448155299|-0.422151990754|0.143311976349], 17 | -------------------------------------------------------------------------------- /data/sample_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "INDEX":{"N":12,"T":"ulong","D":[123450,123451,123452,123453,123454,123455,123456,123457,123458,123459,123460,555555]}, 3 | "col_3":{"N":12,"T":"double","D":[15,16,17,18,19,20,21,22,23,24,25, 555.543]}, 4 | "col_4":{"N":6,"T":"double","D":[22,23,24,25,26,27]}, 5 | "col_str":{"N":12,"T":"string","D":["11","22","33","aa","bb","cc","dd","tt","uu","ii","88", 6 | "This is a test"]}, 7 | "col_2":{"N":12,"T":"double","D":[8,9,10,11,12,13,14,15,16,17,18, 777.78]}, 8 | "col_1":{"N":12,"T":"double","D":[1,2,3,4,5,6,7,8,9,10,11, 9 | 55.55]}, 10 | "col_char":{"N":12,"T":"char","D":[8,C,F,$,,8,120,88,h,u,18, 78]}, 11 | "col_uchar":{"N":12,"T":"uchar","D":[8,C,F,$,,8,220,88,h,&,18, 255]} 12 | } 13 | -------------------------------------------------------------------------------- /data/sample_data_2.csv: -------------------------------------------------------------------------------- 1 | # Test csv file 2 | # 3 | 4 | INDEX:28:<ulong>:123432,123433,123434,123435,123436,123441,123442,123448,123449,123450,123450,123450,123450,123450,123451,123451,123452,123452,123452,123453,123454,123455,123455,123456,123457,123458,123459,123460, 5 | ul_col_2:28:<ulong>:123450,123451,123452,123450,123455,123450,123449,123448,123451,123452,123452,123450,123455,123450,123454,123453,123456,123457,123458,123459,123460,123441,123442,123432,123433,123434,123435,123436, 6 | xint_col_2:28:<int>:35,36,40,45,46,33,34,8,7,1,4,6,12,14,2,9,3,10,11,20,15,5,13,22,23,24,25,30, 7 | str_col_2:28:<string>:XXXX10,XXXX11,XXXX01,XXXX02,XXXX03,XXXX6,XXXX7,Running fast,$15 increase,4% of something,3.4% of GDP,Market pulls back,Bonds vs. Equities,Here comes the sun,Description 4/5,C++14 development,This is bad,Some explanation,More strings,XXXX04,XXXX1,Market drops,Almost done,XXXX2,XXXX3,XXXX4,XXXX4,XXXX5, 8 | dbl_col_3:28:<double>:2.009,3.111,10,4.2222,5.3333,12,6.25,10,0.9999,1.2345,4.2345,3,8,3.3333,2.2345,4.25,3.2345,0.009,1.111,5.25,11,5.2345,2.2222,1.009,2.111,9,3.2222,4.3333, 9 | dbl_col_2_2:28:<double>:0.87865,-0.6999,0.4111,0.1902,-0.4888,0.2,0.1056,0.1,0.06743,0.998,0.15678,0.923,0.0111,-0.8888,0.3456,0.0056,0.056,0.07865,-0.9999,0.0456,0.14,0.00345,0.1002,0.078654,-0.8999,0.01119,0.8002,-0.9888, 10 | bool_col_2:28:<bool>:0,1,1,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0, 11 | str_str_pair_col:5:<str_str_pair>:<First String 11:Second String 11>,<:>,<:Second String 13>,<First String 14:>,<First String 15:Second String 15>, 12 | dbl_dbl_pair_col:5:<dbl_dbl_pair>:<1234:456.7>,<:>,<:456.8>,<456.9:>,<789.1:789.2>, 13 | str_dbl_pair_col:5:<str_dbl_pair>:<First String 11:456.7>,<:>,<:456.8>,<First String 14:>,<First String 15:789.2>, 14 | -------------------------------------------------------------------------------- /data/sample_data_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "INDEX":{"N":12,"T":"ulong","D":[123450,123451,123452,123453,123454,123455,123456,123457,123458,123459,123460,555555]}, 3 | "col_3_2":{"N":12,"T":"double","D":[15,16,17,18,19,20,21,22,23,24,25, 555.543]}, 4 | "col_4_2":{"N":6,"T":"double","D":[22,23,24,25,26,27]}, 5 | "col_str_2":{"N":12,"T":"string","D":["11","22","33","aa","bb","cc","dd","tt","uu","ii","88", 6 | "This is a test"]}, 7 | "col_2_2":{"N":12,"T":"double","D":[8,9,10,11,12,13,14,15,16,17,18, 777.78]}, 8 | "col_1_2":{"N":12,"T":"double","D":[1,2,3,4,5,6,7,8,9,10,11, 9 | 55.55]}, 10 | "col_char":{"N":12,"T":"char","D":[8,C,F,$,,8,120,88,h,u,18, 78]}, 11 | "col_uchar":{"N":12,"T":"uchar","D":[8,C,F,$,,8,220,88,h,&,18, 255]} 12 | } 13 | -------------------------------------------------------------------------------- /data/sample_data_dt_index.csv: -------------------------------------------------------------------------------- 1 | # Test csv file 2 | # 3 | 4 | INDEX:28:<DateTimeAME>:1547825036.3,1516179600.874123908,1516093200.234,1516006800.234098,1515920400.2309,1515834000.89,1515747600.123456789,1515661200.12309,1515574800.4562387,1515488400.2345609,1515402000.78,1515315600.340987645,1515229200.309812765,1515142800.093451984,1515056400.671092346,1514970000.450137234,1514883600.091256923,1514797200.67,1514624400.4562,1514538000.5,1514451600.0,1514365200.896120945,1514278800.783452098,378205200000.561209834,409741200000.346,441277200000.340987,472899600.0,504435600.871234561, 5 | ul_col:28:<ulong>:123450,123451,123452,123450,123455,123450,123449,123448,123451,123452,123452,123450,123455,123450,123454,123453,123456,123457,123458,123459,123460,123441,123442,123432,123433,123434,123435,123436, 6 | xint_col:28:<int>:35,36,40,45,46,33,34,8,7,1,4,6,12,14,2,9,3,10,11,20,15,5,13,22,23,24,25,30, 7 | str_col:28:<string>:XXXX10,XXXX11,XXXX01,XXXX02,XXXX03,XXXX6,XXXX7,Running fast,$15 increase,4% of something,3.4% of GDP,Market pulls back,Bonds vs. Equities,Here comes the sun,Description 4/5,C++14 development,This is bad,Some explanation,More strings,XXXX04,XXXX1,Market drops,Almost done,XXXX2,XXXX3,XXXX4,XXXX4,XXXX5, 8 | dbl_col:28:<double>:2.009,3.111,10,4.2222,5.3333,12,6.25,10,0.9999,1.2345,4.2345,3,8,3.3333,2.2345,4.25,3.2345,0.009,1.111,5.25,11,5.2345,2.2222,1.009,2.111,9,3.2222,4.3333, 9 | dbl_col_2:28:<double>:0.87865,-0.6999,0.4111,0.1902,-0.4888,0.2,0.1056,0.1,0.06743,0.998,0.15678,0.923,0.0111,-0.8888,0.3456,0.0056,0.056,0.07865,-0.9999,0.0456,0.14,0.00345,0.1002,0.078654,-0.8999,0.01119,0.8002,-0.9888, 10 | bool_col:28:<bool>:0,1,1,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0, 11 | -------------------------------------------------------------------------------- /data/sample_data_no_index.csv: -------------------------------------------------------------------------------- 1 | # Test csv file 2 | # 3 | 4 | ul_col_no_idx:28:<ulong>:123450,123451,123452,123450,123455,123450,123449,123448,123451,123452,123452,123450,123455,123450,123454,123453,123456,123457,123458,123459,123460,123441,123442,123432,123433,123434,123435,123436, 5 | xint_col_no_idx:28:<int>:35,36,40,45,46,33,34,8,7,1,4,6,12,14,2,9,3,10,11,20,15,5,13,22,23,24,25,30, 6 | str_col_no_idx:28:<string>:XXXX10,XXXX11,XXXX01,XXXX02,XXXX03,XXXX6,XXXX7,Running fast,$15 increase,4% of something,3.4% of GDP,Market pulls back,Bonds vs. Equities,Here comes the sun,Description 4/5,C++14 development,This is bad,Some explanation,More strings,XXXX04,XXXX1,Market drops,Almost done,XXXX2,XXXX3,XXXX4,XXXX4,XXXX5, 7 | dbl_col_no_idx:28:<double>:2.009,3.111,10,4.2222,5.3333,12,6.25,10,0.9999,1.2345,4.2345,3,8,3.3333,2.2345,4.25,3.2345,0.009,1.111,5.25,11,5.2345,2.2222,1.009,2.111,9,3.2222,4.3333, 8 | dbl_col_2_no_idx:28:<double>:0.87865,-0.6999,0.4111,0.1902,-0.4888,0.2,0.1056,0.1,0.06743,0.998,0.15678,0.923,0.0111,-0.8888,0.3456,0.0056,0.056,0.07865,-0.9999,0.0456,0.14,0.00345,0.1002,0.078654,-0.8999,0.01119,0.8002,-0.9888, 9 | bool_col_no_idx:28:<bool>:0,1,1,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0, 10 | char_col:6:<char>:C,%,120,,65,! 11 | uchar_col:6:<uchar>:C,%,250,,65,! 12 | -------------------------------------------------------------------------------- /data/sample_data_no_index.json: -------------------------------------------------------------------------------- 1 | { 2 | "col_3_no_idx":{"N":12,"T":"double","D":[15,16,17,18,19,20,21,22,23,24,25, 555.543]}, 3 | "col_4_no_idx":{"N":6,"T":"double","D":[22,23,24,25,26,27]}, 4 | "col_str_no_idx":{"N":12,"T":"string","D":["11","22","33","aa","bb","cc","dd","tt","uu","ii","88", 5 | "This is a test"]}, 6 | "col_2_no_idx":{"N":12,"T":"double","D":[8,9,10,11,12,13,14,15,16,17,18, 777.78]}, 7 | "col_1_no_idx":{"N":12,"T":"double","D":[1,2,3,4,5,6,7,8,9,10,11, 8 | 55.55]}, 9 | "col_char_no_idx":{"N":12,"T":"char","D":[8,C,F,$,,8,120,88,h,u,18, 78]}, 10 | "col_uchar_no_idx":{"N":12,"T":"uchar","D":[8,C,F,$,,8,220,88,h,&,18, 255]} 11 | } 12 | -------------------------------------------------------------------------------- /data/sample_data_string_index.csv: -------------------------------------------------------------------------------- 1 | # Test csv file 2 | # 3 | 4 | INDEX:28:<string>:string_index_1,string_index_2,string_index_3,string_index_4,string_index_5,string_index_6,string_index_7,string_index_8,string_index_9,string_index_10,string_index_11,string_index_12,string_index_13,string_index_14,string_index_15,string_index_16,string_index_17,string_index_18,string_index_19,string_index_20,string_index_21,string_index_22,string_index_23,string_index_24,string_index_25,string_index_26,string_index_27,string_index_28, 5 | ul_col:28:<ulong>:123450,123451,123452,123450,123455,123450,123449,123448,123451,123452,123452,123450,123455,123450,123454,123453,123456,123457,123458,123459,123460,123441,123442,123432,123433,123434,123435,123436, 6 | xint_col:28:<int>:35,36,40,45,46,33,34,8,7,1,4,6,12,14,2,9,3,10,11,20,15,5,13,22,23,24,25,30, 7 | str_col:28:<string>:XXXX10,XXXX11,XXXX01,XXXX02,XXXX03,XXXX6,XXXX7,Running fast,$15 increase,4% of something,3.4% of GDP,Market pulls back,Bonds vs. Equities,Here comes the sun,Description 4/5,C++14 development,This is bad,Some explanation,More strings,XXXX04,XXXX1,Market drops,Almost done,XXXX2,XXXX3,XXXX4,XXXX4,XXXX5, 8 | dbl_col:28:<double>:2.009,3.111,10,4.2222,5.3333,12,6.25,10,0.9999,1.2345,4.2345,3,8,3.3333,2.2345,4.25,3.2345,0.009,1.111,5.25,11,5.2345,2.2222,1.009,2.111,9,3.2222,4.3333, 9 | dbl_col_2:28:<double>:0.87865,-0.6999,0.4111,0.1902,-0.4888,0.2,0.1056,0.1,0.06743,0.998,0.15678,0.923,0.0111,-0.8888,0.3456,0.0056,0.056,0.07865,-0.9999,0.0456,0.14,0.00345,0.1002,0.078654,-0.8999,0.01119,0.8002,-0.9888, 10 | bool_col:28:<bool>:0,1,1,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0, 11 | char_col:6:<char>:C,%,120,,65,!, 12 | uchar_col:6:<uchar>:C,%,250,,65,!, 13 | Map 1:4:<str_dbl_map>:3{label one 1:123.0|label one 2:-782.5|label one 3:444.44},3{label two 1:123.0|label two 2:-782.5|label two 3:444.44},3{label three 1:123.0|label three 2:-782.5|label three 3:444.44},3{label four 1:123.0|label four 2:-782.5|label four 3:444.44}, 14 | Unordered Map:4:<str_dbl_unomap>:3{Key one 1:123.0|Key one 2:-782.5|Key one 3:444.44},3{Key two 1:123.0|Key two 2:-782.5|Key two 3:444.44},3{Key three 1:123.0|Key three 2:-782.5|Key three 3:444.44},3{Key four 1:123.0|Key four 2:-782.5|Key four 3:444.44}, 15 | Str Vec:4:<str_vec>:4[bbb|aaa|zzz|ddd],4[aaa|bbb|ccc|www],4[123|abc|345|list],3[bbb|aaa|zzz], 16 | Double Set:4:<dbl_set>:3[123.0|-782.5|444.44],3[1:123.0|-782.5|:444.44],3[123.0|-782.5|444.44],4[123.0|-782.5|444.44|100.5], 17 | Str Set:4:<str_set>:3[123.0|-782.5|444.44],3[1:123.0|-782.5|:444.44],3[123.0|-782.5|444.44],4[123.0|-782.5|444.44|100.5], 18 | Z Score:4:<dbl_vec>:10[1.95474040557|0.552535091086|0.775388936446|-0.561817339812|0.106794118727|-0.153218675013|-0.896114748672|-1.72258101434|-0.301804546072|0.246077772077],10[-0.985180680575|-0.338649566179|1.37000434149|0.831246802651|-0.415610988193|1.06213106869|0.554158098662|0.507981245453|-1.55472278822|-1.03135753378],10[-1.39575784008|-1.62506351709|-0.907239380237|-0.159508137551|0.807541881212|0.937157205458|0.578236204203|0.717820563726|-0.0398797142361|1.0866927346],10[1.94246107491|-0.062340594565|0.246115232403|-1.24462409799|-0.190844664632|0.8115331407|0.381021476571|-1.60448155299|-0.422151990754|0.143311976349], 19 | 20 | -------------------------------------------------------------------------------- /data/strings.csv: -------------------------------------------------------------------------------- 1 | INDEX:8:<ulong>:0,1,2,3,4,5,6,7, 2 | abc:8:<string>:A,B,C,D,E,F,G,H, 3 | ott:8:<int>:1,2,3,4,5,6,7,8, 4 | str:8:<string>:"str1",str2,str3,str4,str5,"str6",str7,str8, 5 | -------------------------------------------------------------------------------- /data/strings2.csv: -------------------------------------------------------------------------------- 1 | INDEX:8:<string>,s1:8:<string>,n1:8:<int>,s2:8:<string> 2 | 2025-01-01,string11,68,string21 3 | 2025-01-02,'string12',25,string22 4 | 2025-01-03,"string13",22,string23 5 | 2025-01-06,string14,25,string24 6 | 2025-01-07,string15,12,string25 7 | 2025-01-08,string16,62,string26 8 | 2025-01-09,string17,27,string27 9 | 2025-01-10,string18,77,string28 10 | -------------------------------------------------------------------------------- /docs/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | <img src="LionLookingUp.jpg" alt="drawing" width="200"/> 2 | 3 | # Thank you for choosing to contribute to DataFrame 4 | 5 | ### Did you find a bug 6 | * Ensure the bug was not already reported by searching on GitHub under Issues. 7 | * If you're unable to find an open issue addressing the problem, open a new one and mark it as **bug**. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring. 8 | * If you wrote a patch that fixes a bug 9 | * Open a new GitHub pull request with the patch. 10 | * Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. 11 | * Follow the same coding conventions and formatting already in DataFrame, as much as you can 12 | 13 | ### Do you intend to add a new feature or change an existing one? 14 | * Open an issue and mark it as **new feature** and clearly describe the new feature/enhancement. 15 | * Wait a few days for feedback. 16 | * Open a branch and implement your new addition/enhancement. 17 | * Follow the same coding conventions and formatting already in DataFrame, as much as you can 18 | * write an **explicit and comprehensive** test for your new addition/enhancement. 19 | * Make sure your new addition/enhancement and the test compile and run correctly on all supported platforms 20 | * issue a pull request 21 | 22 | In general, you should get familiarized with the project and its source code first. I suggest: 23 | 24 | 1. Read the documentation from beginning to end 25 | 2. Get comfortable with compiling the project 26 | 3. Go through the Hello World 27 | 4. Understand the Vectors code 28 | 5. Go through the other test programs along with most of the features in the documentation 29 | 6. Contribute + document + write test case 30 | -------------------------------------------------------------------------------- /docs/CheatSheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosseinmoein/DataFrame/606d1bca2cdfd6564ade3aa6abdb6a2448ea8ed3/docs/CheatSheet.pdf -------------------------------------------------------------------------------- /docs/CheatSheet.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosseinmoein/DataFrame/606d1bca2cdfd6564ade3aa6abdb6a2448ea8ed3/docs/CheatSheet.pptx -------------------------------------------------------------------------------- /docs/HTML/Index2D.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> 43 | </tr> 44 | <tr bgcolor="Azure"> 45 | <td> 46 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 47 | <span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">struct</span> Index2D <span style="color:#800080; ">{</span></span> 48 | <span class="line_wrapper"> T begin <span style="color:#800080; ">{</span><span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span> 49 | <span class="line_wrapper"> T end <span style="color:#800080; ">{</span><span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"><span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span> 51 | <span class="line_wrapper"></span></pre> 52 | </td> 53 | <td> 54 | It represents a range with begin and end within a continuous memory space 55 | </td> 56 | </tr> 57 | 58 | </table> 59 | 60 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 61 | width="200" height="200" style="float:right"/> 62 | 63 | </body> 64 | </html> 65 | 66 | <!-- 67 | Local Variables: 68 | mode:HTML 69 | tab-width:4 70 | c-basic-offset:4 71 | End: 72 | --> 73 | -------------------------------------------------------------------------------- /docs/HTML/ProdVisitor.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | <tr bgcolor="Azure"> 45 | <td> 46 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#004a43; ">#</span><span style="color:#004a43; ">include </span><span style="color:#800000; "><</span><span style="color:#40015a; ">DataFrame/DataFrameStatsVisitors.h</span><span style="color:#800000; ">></span></span> 47 | <span class="line_wrapper"></span> 48 | <span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">typename</span> I <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">struct</span> ProdVisitor<span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | This functor class calculates the product of a given column. The constructor takes a single optional Boolean argument to whether skip NaN values. The default is True.<BR> 54 | </td> 55 | <td width="30%"> 56 | <B>T</B>: Column data type.<BR> 57 | <B>I</B>: Index type. 58 | </td> 59 | </tr> 60 | 61 | </table> 62 | 63 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 64 | width="200" height="200" style="float:right"/> 65 | 66 | </body> 67 | </html> 68 | 69 | <!-- 70 | Local Variables: 71 | mode:HTML 72 | tab-width:4 73 | c-basic-offset:4 74 | End: 75 | --> 76 | -------------------------------------------------------------------------------- /docs/HTML/StdVisitor.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | <tr bgcolor="Azure"> 45 | <td> 46 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#004a43; ">#</span><span style="color:#004a43; ">include </span><span style="color:#800000; "><</span><span style="color:#40015a; ">DataFrame/DataFrameStatsVisitors.h</span><span style="color:#800000; ">></span></span> 47 | <span class="line_wrapper"></span> 48 | <span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">typename</span> I <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">struct</span> StdVisitor<span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | This functor class calculates the standard deviation of a given column.<BR> 54 | <I> 55 | <PRE> 56 | explicit 57 | StdVisitor(bool bias = false, 58 | bool skipnan = false, 59 | bool stable_algo = false); 60 | </PRE> 61 | </I> 62 | <B>bias</B>: If true it divides by n - 1, otherwise by n.<BR> 63 | <B>skip_nan</B>: If true it skips over nan numbers as if they didn't exist.<BR> 64 | <B>stable_algo</B>: If true, it uses a version of Kahan summation that is numerically stable for data with very large values. Kahan summation is slower than regular summation, so only use it, if your data contains very large values.<BR> 65 | </td> 66 | <td width="30%"> 67 | <B>T</B>: Column data type.<BR> 68 | <B>I</B>: Index type. 69 | </td> 70 | </tr> 71 | 72 | </table> 73 | 74 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 75 | width="200" height="200" style="float:right"/> 76 | 77 | </body> 78 | </html> 79 | 80 | <!-- 81 | Local Variables: 82 | mode:HTML 83 | tab-width:4 84 | c-basic-offset:4 85 | End: 86 | --> 87 | -------------------------------------------------------------------------------- /docs/HTML/SumVisitor.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | <tr bgcolor="Azure"> 45 | <td> 46 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#004a43; ">#</span><span style="color:#004a43; ">include </span><span style="color:#800000; "><</span><span style="color:#40015a; ">DataFrame/DataFrameStatsVisitors.h</span><span style="color:#800000; ">></span></span> 47 | <span class="line_wrapper"></span> 48 | <span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">typename</span> I <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">struct</span> SumVisitor<span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | This functor class calculates the sum of a given column. The constructor takes a single optional Boolean argument to whether skip NaN values. The default is True.<BR> 54 | </td> 55 | <td width="30%"> 56 | <B>T</B>: Column data type.<BR> 57 | <B>I</B>: Index type. 58 | </td> 59 | </tr> 60 | 61 | </table> 62 | 63 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 64 | width="200" height="200" style="float:right"/> 65 | 66 | </body> 67 | </html> 68 | 69 | <!-- 70 | Local Variables: 71 | mode:HTML 72 | tab-width:4 73 | c-basic-offset:4 74 | End: 75 | --> 76 | -------------------------------------------------------------------------------- /docs/HTML/VarVisitor.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | <tr bgcolor="Azure"> 45 | <td> 46 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#004a43; ">#</span><span style="color:#004a43; ">include </span><span style="color:#800000; "><</span><span style="color:#40015a; ">DataFrame/DataFrameStatsVisitors.h</span><span style="color:#800000; ">></span></span> 47 | <span class="line_wrapper"></span> 48 | <span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">typename</span> I <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">struct</span> VarVisitor<span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | This functor class calculates the variance of a given column.<BR> 54 | <I> 55 | <PRE> 56 | explicit 57 | VarVisitor(bool bias = false, 58 | bool skipnan = false, 59 | bool stable_algo = false); 60 | </PRE> 61 | </I> 62 | <B>bias</B>: If true it divides by n - 1, otherwise by n.<BR> 63 | <B>skip_nan</B>: If true it skips over nan numbers as if they didn't exist.<BR> 64 | <B>stable_algo</B>: If true, it uses a version of Kahan summation that is numerically stable for data with very large values. Kahan summation is slower than regular summation, so only use it, if your data contains very large values.<BR> 65 | </td> 66 | <td width="30%"> 67 | <B>T</B>: Column data type.<BR> 68 | <B>I</B>: Index type. 69 | </td> 70 | </tr> 71 | 72 | </table> 73 | 74 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 75 | width="200" height="200" style="float:right"/> 76 | 77 | </body> 78 | </html> 79 | 80 | <!-- 81 | Local Variables: 82 | mode:HTML 83 | tab-width:4 84 | c-basic-offset:4 85 | End: 86 | --> 87 | -------------------------------------------------------------------------------- /docs/HTML/any_type.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | <head> 28 | <style> 29 | * { 30 | box-sizing: border-box; 31 | } 32 | 33 | body { 34 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 35 | } 36 | 37 | </style> 38 | </head> 39 | 40 | <body style="font-family: Georgia, serif"> 41 | 42 | 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> 43 | 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> 44 | 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>. 45 | <BR> 46 | <BR> 47 | <BR> 48 | 49 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 50 | width="200" height="200" style="float:right"/> 51 | 52 | </body> 53 | </html> 54 | 55 | <!-- 56 | Local Variables: 57 | mode:HTML 58 | tab-width:4 59 | c-basic-offset:4 60 | End: 61 | --> 62 | -------------------------------------------------------------------------------- /docs/HTML/append_index.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span></span> 48 | <span class="line_wrapper">append_index<span style="color:#808030; ">(</span><span style="color:#800000; font-weight:bold; ">const</span> IndexType <span style="color:#808030; ">&</span>val<span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 49 | <span class="line_wrapper"></span></pre> 50 | </td> 51 | <td> 52 | It appends val to the end of the index column. Returns number of items loaded<BR> 53 | Returns number of items loaded 54 | </td> 55 | <td> 56 | <B>val</B>: Single index value<BR> 57 | </td> 58 | </tr> 59 | 60 | <tr bgcolor="Azure"> 61 | <td > 62 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> ITR<span style="color:#800080; ">></span></span> 63 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span></span> 64 | <span class="line_wrapper">append_index<span style="color:#808030; ">(</span><a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/Index2D.html">Index2D</a> range<span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 65 | <span class="line_wrapper"></span></pre> 66 | </td> 67 | <td> 68 | It appends the range begin to end to the end of the index column<BR> 69 | Returns number of items loaded 70 | </td> 71 | <td> 72 | <B>ITR</B>: Type of the iterator<BR> 73 | <B>range</B>: The begin and end iterators for data<BR> 74 | </td> 75 | </tr> 76 | 77 | </table> 78 | 79 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 80 | width="200" height="200" style="float:right"/> 81 | 82 | </body> 83 | </html> 84 | 85 | <!-- 86 | Local Variables: 87 | mode:HTML 88 | tab-width:4 89 | c-basic-offset:4 90 | End: 91 | --> 92 | -------------------------------------------------------------------------------- /docs/HTML/contiguous_memory.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | <head> 28 | <style> 29 | * { 30 | box-sizing: border-box; 31 | } 32 | 33 | body { 34 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 35 | } 36 | 37 | </style> 38 | </head> 39 | 40 | <body style="font-family: Georgia, serif"> 41 | 42 | Watch this video: <a href="https://www.youtube.com/watch?v=WDIkqP4JbkE">Scott Meyers: Cpu Caches and Why You Care</a>. Enough said 43 | <BR> 44 | <BR> 45 | <BR> 46 | 47 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 48 | width="200" height="200" style="float:right"/> 49 | 50 | </body> 51 | </html> 52 | 53 | <!-- 54 | Local Variables: 55 | mode:HTML 56 | tab-width:4 57 | c-basic-offset:4 58 | End: 59 | --> 60 | -------------------------------------------------------------------------------- /docs/HTML/copying_data.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | <head> 28 | <style> 29 | * { 30 | box-sizing: border-box; 31 | } 32 | 33 | body { 34 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 35 | } 36 | 37 | </style> 38 | </head> 39 | 40 | <body style="font-family: Georgia, serif"> 41 | 42 | Copying data obviously causes space and time being wasted. But it also could have other side effects. For example, the construction and/or destruction of objects being copied may have side effects. Also, some object may be consumers of expensive resources and copying them may increase resource consumption. DataFrame <I>Views</I> play an important role in this regard. 43 | <BR> 44 | <BR> 45 | <BR> 46 | 47 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 48 | width="200" height="200" style="float:right"/> 49 | 50 | </body> 51 | </html> 52 | 53 | <!-- 54 | Local Variables: 55 | mode:HTML 56 | tab-width:4 57 | c-basic-offset:4 58 | End: 59 | --> 60 | -------------------------------------------------------------------------------- /docs/HTML/empty.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> 43 | </tr> 44 | <tr bgcolor="Azure"> 45 | <td> 46 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">bool</span></span> 47 | <span class="line_wrapper">empty<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800000; font-weight:bold; ">const</span> <span style="color:#800000; font-weight:bold; ">noexcept</span><span style="color:#800080; ">;</span></span> 48 | <span class="line_wrapper"></span></pre> 49 | </td> 50 | <td width = "70%"> 51 | It returns true, if index column is empty.<BR> 52 | <B>NOTE</B>: When index column is empty, no other column could be populated 53 | </td> 54 | </tr> 55 | 56 | <tr bgcolor="Azure"> 57 | <td> 58 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">bool</span></span> 59 | <span class="line_wrapper">shapeless<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800000; font-weight:bold; ">const</span> <span style="color:#800000; font-weight:bold; ">noexcept</span><span style="color:#800080; ">;</span></span> 60 | <span class="line_wrapper"></span></pre> 61 | </td> 62 | <td width = "70%"> 63 | It returns true, if index column is empty and no named column has been created. 64 | </td> 65 | </tr> 66 | 67 | </table> 68 | 69 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 70 | width="200" height="200" style="float:right"/> 71 | 72 | </body> 73 | </html> 74 | 75 | <!-- 76 | Local Variables: 77 | mode:HTML 78 | tab-width:4 79 | c-basic-offset:4 80 | End: 81 | --> 82 | -------------------------------------------------------------------------------- /docs/HTML/garbage_in_garbage_out.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | <head> 28 | <style> 29 | * { 30 | box-sizing: border-box; 31 | } 32 | 33 | body { 34 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 35 | } 36 | 37 | </style> 38 | </head> 39 | 40 | <body style="font-family: Georgia, serif"> 41 | 42 | <I>Garbage In, Garbage Out</I> is when a user inputs a dataset that is not suitable for a particular analysis, and (s)he gets nonsense as a result. For example, a data analysis algorithm may require that the input to be normally distributed. If user inputs a dataset that is far from being normal distribution, the result will be garbage.<BR> 43 | One approach would be for the library to check the data first and warn the user that the data is not suitable. DataFrame doesn't do that because this approach has many pitfalls: 44 | <OL> 45 | <LI>It makes the code inefficient and slow</LI> 46 | <LI>It makes the code convoluted and hard to understand and maintain</LI> 47 | <LI>The check often is more complicated than the algorithm itself and it makes the code bug-prone</LI> 48 | </OL> 49 | 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>. 50 | 51 | <BR> 52 | <BR> 53 | <BR> 54 | 55 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 56 | width="200" height="200" style="float:right"/> 57 | 58 | </body> 59 | </html> 60 | 61 | <!-- 62 | Local Variables: 63 | mode:HTML 64 | tab-width:4 65 | c-basic-offset:4 66 | End: 67 | --> 68 | -------------------------------------------------------------------------------- /docs/HTML/gen_bernoulli_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">bool</span><span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper">gen_bernoulli_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">bool</span><span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 49 | <span class="line_wrapper"></span></pre> 50 | </td> 51 | <td> 52 | It generates random Boolean values, according to the discrete probability function. The probability of true is:<BR> 53 | <I> 54 | <PRE> 55 | ⎧ p if b == true 56 | P(b|p) = ⎨ 57 | ⎩ 1 - p if b == false 58 | </PRE> 59 | </I> 60 | It returns the vector of results<BR> 61 | Optional parameters to set:<BR> 62 | <I>prob_true, seed</I> 63 | </td> 64 | <td> 65 | <B>n</B>: Number of numeric to generate<BR> 66 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 67 | </td> 68 | </tr> 69 | </table> 70 | 71 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 72 | width="200" height="200" style="float:right"/> 73 | 74 | </body> 75 | </html> 76 | 77 | <!-- 78 | Local Variables: 79 | mode:HTML 80 | tab-width:4 81 | c-basic-offset:4 82 | End: 83 | --> 84 | -------------------------------------------------------------------------------- /docs/HTML/gen_binomial_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_binomial_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | Produces random non-negative integer values i, distributed according to discrete probability function:<BR> 54 | <I>P(i|t,p)=(ti)⋅pi⋅(1−p)t−i</I><BR> 55 | 56 | It returns the vector of results<BR> 57 | Optional parameters to set:<BR> 58 | <I>t_dist, prob_true, seed</I> 59 | </td> 60 | <td> 61 | <B>T</B>: Type can only be [unsigned] char, [unsigned] short, [unsigned] int, [unsigned] long int, or [unsigned] long long int<BR> 62 | <B>n</B>: Number of numerics to generate<BR> 63 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 64 | </td> 65 | </tr> 66 | </table> 67 | 68 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 69 | width="200" height="200" style="float:right"/> 70 | 71 | </body> 72 | </html> 73 | 74 | <!-- 75 | Local Variables: 76 | mode:HTML 77 | tab-width:4 78 | c-basic-offset:4 79 | End: 80 | --> 81 | -------------------------------------------------------------------------------- /docs/HTML/gen_cauchy_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_cauchy_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | Produces random numbers according to a Cauchy distribution<BR> 54 | (also called Lorentz distribution):<BR> 55 | see https://en.cppreference.com/w/cpp/numeric/random/cauchy_distribution<BR> 56 | <BR> 57 | It returns the vector of results<BR> 58 | Optional parameters to set:<BR> 59 | alpha (location), beta (scale), seed 60 | </td> 61 | <td> 62 | <B>T</B>: Type can only be float, double, or long double<BR> 63 | <B>n</B>: Number of numerics to generate<BR> 64 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 65 | </td> 66 | </tr> 67 | </table> 68 | 69 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 70 | width="200" height="200" style="float:right"/> 71 | 72 | </body> 73 | </html> 74 | 75 | <!-- 76 | Local Variables: 77 | mode:HTML 78 | tab-width:4 79 | c-basic-offset:4 80 | End: 81 | --> 82 | -------------------------------------------------------------------------------- /docs/HTML/gen_chi_squared_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_chi_squared_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | The chi_squared_distribution produces random numbers x > 0 according<BR> 54 | to the Chi-squared distribution:<BR> 55 | see https://en.cppreference.com/w/cpp/numeric/random/chi_squared_distribution<BR> 56 | <BR> 57 | It returns the vector of results<BR> 58 | Optional parameters to set:<BR> 59 | n (degree of freedom), seed 60 | </td> 61 | <td> 62 | <B>T</B>: Type can only be float, double, or long double<BR> 63 | <B>n</B>: Number of numerics to generate<BR> 64 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 65 | </td> 66 | </tr> 67 | </table> 68 | 69 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 70 | width="200" height="200" style="float:right"/> 71 | 72 | </body> 73 | </html> 74 | 75 | <!-- 76 | Local Variables: 77 | mode:HTML 78 | tab-width:4 79 | c-basic-offset:4 80 | End: 81 | --> 82 | -------------------------------------------------------------------------------- /docs/HTML/gen_exponential_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_exponential_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | Produces random non-negative floating-point values x, distributed according to probability density function:<BR> 54 | <PRE> 55 | P(x|λ) = λe-λx 56 | </PRE> 57 | It returns the vector of results<BR> 58 | Optional parameters to set:<BR> 59 | lambda, seed 60 | </td> 61 | <td> 62 | <B>T</B>: Type can only be float, double, or long double<BR> 63 | <B>n</B>: Number of numerics to generate<BR> 64 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 65 | </td> 66 | </tr> 67 | </table> 68 | 69 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 70 | width="200" height="200" style="float:right"/> 71 | 72 | </body> 73 | </html> 74 | 75 | <!-- 76 | Local Variables: 77 | mode:HTML 78 | tab-width:4 79 | c-basic-offset:4 80 | End: 81 | --> 82 | -------------------------------------------------------------------------------- /docs/HTML/gen_fisher_f_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_bernoulli_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | Produces random numbers according to the f-distribution:<BR> 54 | see https://en.cppreference.com/w/cpp/numeric/random/fisher_f_distribution<BR> 55 | <BR> 56 | It returns the vector of results<BR> 57 | Optional parameters to set<BR> 58 | n (degree of freedom), n2 (degree of freedom), seed 59 | </td> 60 | <td> 61 | <B>T</B>: Type can only be float, double, or long double<BR> 62 | <B>n</B>: Number of numerics to generate<BR> 63 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 64 | </td> 65 | </tr> 66 | </table> 67 | 68 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 69 | width="200" height="200" style="float:right"/> 70 | 71 | </body> 72 | </html> 73 | 74 | <!-- 75 | Local Variables: 76 | mode:HTML 77 | tab-width:4 78 | c-basic-offset:4 79 | End: 80 | --> 81 | -------------------------------------------------------------------------------- /docs/HTML/gen_gamma_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_gamma_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | Produces random non-negative floating-point values x, 54 | distributed according to probability density function:<BR> 55 | <PRE> 56 | p(x∣α,β)=e−x/ββα⋅Γ(α)⋅xα−1 57 | </PRE> 58 | It returns the vector of results<BR> 59 | Optional parameters to set:<BR> 60 | alpha, beta, seed<BR> 61 | </td> 62 | <td> 63 | <B>T</B>: Type can only be float, double, or long double<BR> 64 | <B>n</B>: Number of numerics to generate<BR> 65 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 66 | </td> 67 | </tr> 68 | </table> 69 | 70 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 71 | width="200" height="200" style="float:right"/> 72 | 73 | </body> 74 | </html> 75 | 76 | <!-- 77 | Local Variables: 78 | mode:HTML 79 | tab-width:4 80 | c-basic-offset:4 81 | End: 82 | --> 83 | -------------------------------------------------------------------------------- /docs/HTML/gen_geometric_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_geometric_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | Produces random non-negative integer values i, distributed according to<BR> 54 | discrete probability function:<BR> 55 | <PRE> 56 | P(i|p)=p⋅(1−p)i 57 | </PRE> 58 | It returns the vector of results<BR> 59 | Optional parameters to set: 60 | prob_true, seed 61 | </td> 62 | <td> 63 | <B>T</B>: Type can only be [unsigned] char, [unsigned] short, [unsigned] int, 64 | [unsigned] long int, or [unsigned] long long int<BR> 65 | <B>n</B>: Number of numerics to generate<BR> 66 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 67 | </td> 68 | </tr> 69 | </table> 70 | 71 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 72 | width="200" height="200" style="float:right"/> 73 | 74 | </body> 75 | </html> 76 | 77 | <!-- 78 | Local Variables: 79 | mode:HTML 80 | tab-width:4 81 | c-basic-offset:4 82 | End: 83 | --> 84 | -------------------------------------------------------------------------------- /docs/HTML/gen_lognormal_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_lognormal_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | The lognormal_distribution random number distribution produces<BR> 54 | random numbers x > 0 according to a log-normal distribution:<BR> 55 | see https://en.cppreference.com/w/cpp/numeric/random/lognormal_distribution<BR> 56 | <BR> 57 | It returns the vector of results<BR> 58 | Optional parameters to set:<BR> 59 | m (log-scale), s (shape), seed 60 | </td> 61 | <td> 62 | <B>T</B>: Type can only be float, double, or long double<BR> 63 | <B>n</B>: Number of numerics to generate<BR> 64 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 65 | </td> 66 | </tr> 67 | </table> 68 | 69 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 70 | width="200" height="200" style="float:right"/> 71 | 72 | </body> 73 | </html> 74 | 75 | <!-- 76 | Local Variables: 77 | mode:HTML 78 | tab-width:4 79 | c-basic-offset:4 80 | End: 81 | --> 82 | -------------------------------------------------------------------------------- /docs/HTML/gen_negative_binomial_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_negative_binomial_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | Produces random non-negative integer values i, distributed according to<BR> 54 | discrete probability function:<BR> 55 | <PRE> 56 | P(i|k,p)=(k+i−1i)⋅pk⋅(1−p)i 57 | </PRE> 58 | It returns the vector of results<BR> 59 | Optional parameters to set:<BR> 60 | t_dist, prob_true, seed 61 | </td> 62 | <td> 63 | <B>T</B>: Type can only be [unsigned] char, [unsigned] short, [unsigned] int, [unsigned] long int, or [unsigned] long long int<BR> 64 | <B>n</B>: Number of numerics to generate<BR> 65 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 66 | </td> 67 | </tr> 68 | </table> 69 | 70 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 71 | width="200" height="200" style="float:right"/> 72 | 73 | </body> 74 | </html> 75 | 76 | <!-- 77 | Local Variables: 78 | mode:HTML 79 | tab-width:4 80 | c-basic-offset:4 81 | End: 82 | --> 83 | -------------------------------------------------------------------------------- /docs/HTML/gen_normal_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_normal_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | Generates random numbers according to the Normal (or Gaussian)<BR> 54 | random number distribution. It is defined as:<BR> 55 | see https://en.cppreference.com/w/cpp/numeric/random/normal_distribution<BR> 56 | <BR> 57 | It returns the vector of results<BR> 58 | Optional parameters to set:<BR> 59 | mean, std (scale), seed<BR> 60 | </td> 61 | <td> 62 | <B>T</B>: Type can only be float, double, or long double<BR> 63 | <B>n</B>: Number of numerics to generate<BR> 64 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 65 | </td> 66 | </tr> 67 | </table> 68 | 69 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 70 | width="200" height="200" style="float:right"/> 71 | 72 | </body> 73 | </html> 74 | 75 | <!-- 76 | Local Variables: 77 | mode:HTML 78 | tab-width:4 79 | c-basic-offset:4 80 | End: 81 | --> 82 | -------------------------------------------------------------------------------- /docs/HTML/gen_student_t_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_student_t_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | Produces random floating-point values x, distributed according<BR> 54 | to probability density function:<BR> 55 | see https://en.cppreference.com/w/cpp/numeric/random/student_t_distribution<BR> 56 | <BR> 57 | It returns the vector of results<BR> 58 | Optional parameters to set:<BR> 59 | n (degree of freedom), seed 60 | </td> 61 | <td> 62 | <B>T</B>: Type can only be float, double, or long double<BR> 63 | <B>n</B>: Number of numerics to generate<BR> 64 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 65 | </td> 66 | </tr> 67 | </table> 68 | 69 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 70 | width="200" height="200" style="float:right"/> 71 | 72 | </body> 73 | </html> 74 | 75 | <!-- 76 | Local Variables: 77 | mode:HTML 78 | tab-width:4 79 | c-basic-offset:4 80 | End: 81 | --> 82 | -------------------------------------------------------------------------------- /docs/HTML/gen_uniform_int_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_uniform_int_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | It generates n uniform integer distribution random numbers.<BR> 54 | <PRE> 55 | 1 56 | P(i|a,b) = ----------- 57 | b − a + 1 58 | </PRE> 59 | It returns the vector of results<BR> 60 | Optional parameters to set:<BR> 61 | max_value, min_value, seed 62 | </td> 63 | <td> 64 | <B>T</B>: Type can only be [unsigned] char, [unsigned] short, [unsigned] int, [unsigned] long int, or [unsigned] long long int<BR> 65 | <B>n</B>: Number of numerics to generate<BR> 66 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 67 | </td> 68 | </tr> 69 | </table> 70 | 71 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 72 | width="200" height="200" style="float:right"/> 73 | 74 | </body> 75 | </html> 76 | 77 | <!-- 78 | Local Variables: 79 | mode:HTML 80 | tab-width:4 81 | c-basic-offset:4 82 | End: 83 | --> 84 | -------------------------------------------------------------------------------- /docs/HTML/gen_uniform_real_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_uniform_real_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | It generates n uniform real distribution random numbers.<BR> 54 | <PRE> 55 | 1 56 | P(i|a,b) = ------- 57 | b − a 58 | </PRE> 59 | It returns the vector of results<BR> 60 | Optional parameters to set:<BR> 61 | max_value, min_value, seed 62 | </td> 63 | <td> 64 | <B>T</B>: Type can only be float, double, or long double<BR> 65 | <B>n</B>: Number of numerics to generate<BR> 66 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 67 | </td> 68 | </tr> 69 | </table> 70 | 71 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 72 | width="200" height="200" style="float:right"/> 73 | 74 | </body> 75 | </html> 76 | 77 | <!-- 78 | Local Variables: 79 | mode:HTML 80 | tab-width:4 81 | c-basic-offset:4 82 | End: 83 | --> 84 | -------------------------------------------------------------------------------- /docs/HTML/gen_weibull_dist.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> <th>Parameters</th> 43 | </tr> 44 | 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; "><</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#800080; ">></span></span> 48 | <span class="line_wrapper"><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">vector</span><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span></span> 49 | <span class="line_wrapper">gen_weibull_dist<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> n<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">const</span> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/RandGenParams.html">RandGenParams</a><span style="color:#800080; "><</span>T<span style="color:#800080; ">></span> <span style="color:#808030; ">&</span>params <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#800080; ">}</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | Produces random non-negative floating-point values x, distributed according to probability density function:<BR> 54 | see https://en.cppreference.com/w/cpp/numeric/random/weibull_distribution<BR> 55 | <BR> 56 | It returns the vector of results<BR> 57 | Optional parameters to set:<BR> 58 | alpha (shape), beta (scale), seed 59 | </td> 60 | <td> 61 | <B>T</B>: Type can only be float, double, or long double<BR> 62 | <B>n</B>: Number of numerics to generate<BR> 63 | <B>params</B>: List of all applicable parameters, see DataFrameTypes.h 64 | </td> 65 | </tr> 66 | </table> 67 | 68 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 69 | width="200" height="200" style="float:right"/> 70 | 71 | </body> 72 | </html> 73 | 74 | <!-- 75 | Local Variables: 76 | mode:HTML 77 | tab-width:4 78 | c-basic-offset:4 79 | End: 80 | --> 81 | -------------------------------------------------------------------------------- /docs/HTML/get_index.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> 43 | 44 | </tr> 45 | <tr bgcolor="Azure"> 46 | <td> 47 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">const</span> IndexVecType <span style="color:#808030; ">&</span></span> 48 | <span class="line_wrapper">get_index<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#800000; font-weight:bold; ">const</span><span style="color:#800080; ">;</span></span> 49 | <span class="line_wrapper"></span></pre> 50 | </td> 51 | <td> 52 | It returns a const reference to the index container 53 | </td> 54 | </tr> 55 | 56 | </tr> 57 | <tr bgcolor="Azure"> 58 | <td> 59 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper">IndexVecType <span style="color:#808030; ">&</span></span> 60 | <span class="line_wrapper">get_index<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span> 61 | <span class="line_wrapper"></span></pre> 62 | </td> 63 | <td> 64 | It returns a reference to the index container 65 | </td> 66 | </tr> 67 | </table> 68 | 69 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 70 | width="200" height="200" style="float:right"/> 71 | 72 | </body> 73 | </html> 74 | 75 | <!-- 76 | Local Variables: 77 | mode:HTML 78 | tab-width:4 79 | c-basic-offset:4 80 | End: 81 | --> 82 | -------------------------------------------------------------------------------- /docs/HTML/io_format.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> 43 | </tr> 44 | <tr bgcolor="Azure"> 45 | <td> 46 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">enum</span> <span style="color:#800000; font-weight:bold; ">class</span> io_format <span style="color:#800080; ">:</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">char</span> <span style="color:#800080; ">{</span></span> 47 | <span class="line_wrapper"> csv <span style="color:#808030; ">=</span> <span style="color:#008c00; ">1</span><span style="color:#808030; ">,</span> <span style="color:#696969; ">// DataFrame specific csv format</span></span> 48 | <span class="line_wrapper"> csv2 <span style="color:#808030; ">=</span> <span style="color:#008c00; ">2</span><span style="color:#808030; ">,</span> <span style="color:#696969; ">// Regular csv format (similar to Pandas)</span></span> 49 | <span class="line_wrapper"> json <span style="color:#808030; ">=</span> <span style="color:#008c00; ">3</span><span style="color:#808030; ">,</span></span> 50 | <span class="line_wrapper"> hdf5 <span style="color:#808030; ">=</span> <span style="color:#008c00; ">4</span><span style="color:#808030; ">,</span> <span style="color:#696969; ">// Not Implemented</span></span> 51 | <span class="line_wrapper"> binary <span style="color:#808030; ">=</span> <span style="color:#008c00; ">5</span><span style="color:#808030; ">,</span></span> 52 | <span class="line_wrapper"><span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span> 53 | <span class="line_wrapper"></span></pre> 54 | </td> 55 | <td> 56 | This specifies the I/O format for reading and writing to/from files, streams, etc.<BR> 57 | Currently only CSV, CSV2, JSON, and binary formats are supported. In CSV[2] formats, any empty line or any line starting with # will be ignored<BR><BR> 58 | See read/write docs for format specifications 59 | </td> 60 | </tr> 61 | </table> 62 | 63 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 64 | width="200" height="200" style="float:right"/> 65 | 66 | </body> 67 | </html> 68 | 69 | <!-- 70 | Local Variables: 71 | mode:HTML 72 | tab-width:4 73 | c-basic-offset:4 74 | End: 75 | --> 76 | -------------------------------------------------------------------------------- /docs/HTML/mean_type.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> 43 | </tr> 44 | <tr bgcolor="Azure"> 45 | <td> 46 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">enum</span> <span style="color:#800000; font-weight:bold; ">class</span> mean_type <span style="color:#800080; ">:</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">char</span> <span style="color:#800080; ">{</span></span> 47 | <span class="line_wrapper"></span> 48 | <span class="line_wrapper"> arithmetic <span style="color:#808030; ">=</span> <span style="color:#008c00; ">1</span><span style="color:#808030; ">,</span> <span style="color:#696969; ">// sum(value) / count</span></span> 49 | <span class="line_wrapper"> weighted <span style="color:#808030; ">=</span> <span style="color:#008c00; ">2</span><span style="color:#808030; ">,</span> <span style="color:#696969; ">// sum(weighted value) / ((count * (count + 1)) / 2)</span></span> 50 | <span class="line_wrapper"> geometric <span style="color:#808030; ">=</span> <span style="color:#008c00; ">3</span><span style="color:#808030; ">,</span> <span style="color:#696969; ">// exp(log(sum(value)) / count)</span></span> 51 | <span class="line_wrapper"> harmonic <span style="color:#808030; ">=</span> <span style="color:#008c00; ">4</span><span style="color:#808030; ">,</span> <span style="color:#696969; ">// count / sum(1 / value)</span></span> 52 | <span class="line_wrapper"> quadratic <span style="color:#808030; ">=</span> <span style="color:#008c00; ">5</span><span style="color:#808030; ">,</span> <span style="color:#696969; ">// sqrt(sum(value * value) / count)</span></span> 53 | <span class="line_wrapper"><span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span> 54 | <span class="line_wrapper"></span></pre> 55 | </td> 56 | <td> 57 | This specifies the type of mean/average calculation 58 | </td> 59 | </tr> 60 | </table> 61 | 62 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 63 | width="200" height="200" style="float:right"/> 64 | 65 | </body> 66 | </html> 67 | 68 | <!-- 69 | Local Variables: 70 | mode:HTML 71 | tab-width:4 72 | c-basic-offset:4 73 | End: 74 | --> 75 | -------------------------------------------------------------------------------- /docs/HTML/multithreading.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | <head> 28 | <style> 29 | * { 30 | box-sizing: border-box; 31 | } 32 | 33 | body { 34 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 35 | } 36 | 37 | </style> 38 | </head> 39 | 40 | <body style="font-family: Georgia, serif"> 41 | 42 | Multithreading is used for two main reasons; one is to increase throughput and/or decrease latency, and also increase scalability and other is to make the code more succinct, structured, and the separation of concerns.<BR> 43 | Using multithreading to increase throughput and decrease latency is very tricky. It is often counterproductive because it is not implemented right. Unfortunately, it is very hard to have a <I>generic</I> multithreading solution for all problems. It is heavily dependent on the nature of the problem and the hardware/software platform. That is why the multithreading solution in DataFrame is very tunable and requires careful user adjustments. I suggest to always start with a single thread and later when the system is working correctly experiment with multithreading. DataFrame gives you the tools and plumbing to do that.<BR> 44 | Also, watch this video: <a href="https://www.youtube.com/watch?v=WDIkqP4JbkE">Scott Meyers: Cpu Caches and Why You Care</a> 45 | <BR> 46 | <BR> 47 | <BR> 48 | 49 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 50 | width="200" height="200" style="float:right"/> 51 | 52 | </body> 53 | </html> 54 | 55 | <!-- 56 | Local Variables: 57 | mode:HTML 58 | tab-width:4 59 | c-basic-offset:4 60 | End: 61 | --> 62 | -------------------------------------------------------------------------------- /docs/HTML/nan_policy.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> 43 | </tr> 44 | <tr bgcolor="Azure"> 45 | <td> 46 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">enum</span> <span style="color:#800000; font-weight:bold; ">class</span> nan_policy <span style="color:#800080; ">:</span> <span style="color:#800000; font-weight:bold; ">bool</span> <span style="color:#800080; ">{</span></span> 47 | <span class="line_wrapper"> pad_with_nans <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">true</span><span style="color:#808030; ">,</span></span> 48 | <span class="line_wrapper"> dont_pad_with_nans <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">false</span></span> 49 | <span class="line_wrapper"><span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | Enumerated type of Boolean type to specify whether data should be padded with NaN or not 54 | </td> 55 | </tr> 56 | </table> 57 | 58 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 59 | width="200" height="200" style="float:right"/> 60 | 61 | </body> 62 | </html> 63 | 64 | <!-- 65 | Local Variables: 66 | mode:HTML 67 | tab-width:4 68 | c-basic-offset:4 69 | End: 70 | --> 71 | -------------------------------------------------------------------------------- /docs/HTML/pointers.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | <head> 28 | <style> 29 | * { 30 | box-sizing: border-box; 31 | } 32 | 33 | body { 34 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 35 | } 36 | 37 | </style> 38 | </head> 39 | 40 | <body style="font-family: Georgia, serif"> 41 | 42 | Containers of pointers to data are very inefficient because of two main reasons:<BR> 43 | <OL> 44 | <LI>Each pointer points to a "different" memory location. In other words, the data is not stored contiguously. That breaks cache locality and therefore it is a major inefficiency.</LI> 45 | <LI>To access data through a pointer, in general, you must do two things; first you must dereference the pointer and then access the data it is pointing to. For large datasets it becomes an inefficiency.</LI> 46 | </OL> 47 | 48 | <BR> 49 | <BR> 50 | <BR> 51 | 52 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 53 | width="200" height="200" style="float:right"/> 54 | 55 | </body> 56 | </html> 57 | 58 | <!-- 59 | Local Variables: 60 | mode:HTML 61 | tab-width:4 62 | c-basic-offset:4 63 | End: 64 | --> 65 | -------------------------------------------------------------------------------- /docs/HTML/roll_policy.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> 43 | </tr> 44 | <tr bgcolor="Azure"> 45 | <td> 46 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">enum</span> <span style="color:#800000; font-weight:bold; ">class</span> roll_policy <span style="color:#800080; ">:</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">char</span> <span style="color:#800080; ">{</span></span> 47 | <span class="line_wrapper"> <span style="color:#696969; ">// Roll one block of data at a time</span></span> 48 | <span class="line_wrapper"> <span style="color:#696969; ">// The length of result will be "input length / rolling period"</span></span> 49 | <span class="line_wrapper"> <span style="color:#696969; ">//</span></span> 50 | <span class="line_wrapper"> blocks <span style="color:#808030; ">=</span> <span style="color:#008c00; ">1</span><span style="color:#808030; ">,</span></span> 51 | <span class="line_wrapper"></span> 52 | <span class="line_wrapper"> <span style="color:#696969; ">// Roll one data point at a time</span></span> 53 | <span class="line_wrapper"> <span style="color:#696969; ">// The length of result will be "input length - rolling period"</span></span> 54 | <span class="line_wrapper"> <span style="color:#696969; ">//</span></span> 55 | <span class="line_wrapper"> continuous <span style="color:#808030; ">=</span> <span style="color:#008c00; ">2</span><span style="color:#808030; ">,</span></span> 56 | <span class="line_wrapper"><span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span> 57 | <span class="line_wrapper"></span></pre> 58 | </td> 59 | <td> 60 | Enumerated type to specify how to roll different statistics over input series 61 | </td> 62 | </tr> 63 | </table> 64 | 65 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 66 | width="200" height="200" style="float:right"/> 67 | 68 | </body> 69 | </html> 70 | 71 | <!-- 72 | Local Variables: 73 | mode:HTML 74 | tab-width:4 75 | c-basic-offset:4 76 | End: 77 | --> 78 | -------------------------------------------------------------------------------- /docs/HTML/self_contained.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | <head> 28 | <style> 29 | * { 30 | box-sizing: border-box; 31 | } 32 | 33 | body { 34 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 35 | } 36 | 37 | </style> 38 | </head> 39 | 40 | <body style="font-family: Georgia, serif"> 41 | 42 | Not allowing third-party libraries in your software package has many advantages: 43 | <UL> 44 | <LI>You are not worried (your reputation is not tarnished) about other people’s bugs which are out of your control</LI> 45 | <LI>Releasing, deploying, and versioning become simpler to <I>a lot simpler</I></LI> 46 | <LI>Debugging becomes simpler to <I>a lot simpler</I></LI> 47 | <LI>Backward compatibility comes under your control</LI> 48 | <LI>You have a free hand to revise your design and code</LI> 49 | </UL> 50 | 51 | It also has some disadvantages: 52 | <UL> 53 | <LI>There might be functionalities that are hard/time-consuming to implement that are already there</LI> 54 | <LI>If you find a battle-tested library, the debugging is already done for you</LI> 55 | <LI>There might be industry-wide standards/trends that you want to follow by using a reputed library</LI> 56 | </UL> 57 | <BR> 58 | <BR> 59 | <BR> 60 | 61 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 62 | width="200" height="200" style="float:right"/> 63 | 64 | </body> 65 | </html> 66 | 67 | <!-- 68 | Local Variables: 69 | mode:HTML 70 | tab-width:4 71 | c-basic-offset:4 72 | End: 73 | --> 74 | -------------------------------------------------------------------------------- /docs/HTML/sort_state.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | 28 | <head> 29 | <style> 30 | body { 31 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 32 | } 33 | </style> 34 | </head> 35 | 36 | <body style="font-family: Georgia, serif"> 37 | <font size="+3">←</font> <a href="https://htmlpreview.github.io/?https://github.com/hosseinmoein/DataFrame/blob/master/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR> 38 | 39 | <table border="1"> 40 | 41 | <tr bgcolor="lightblue"> 42 | <th>Signature</th> <th>Description</th> 43 | </tr> 44 | <tr bgcolor="Azure"> 45 | <td> 46 | <pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">enum</span> <span style="color:#800000; font-weight:bold; ">class</span> sort_state <span style="color:#800080; ">:</span> <span style="color:#800000; font-weight:bold; ">bool</span> <span style="color:#800080; ">{</span></span> 47 | <span class="line_wrapper"> sorted <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">true</span><span style="color:#808030; ">,</span></span> 48 | <span class="line_wrapper"> not_sorted <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">false</span></span> 49 | <span class="line_wrapper"><span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span> 50 | <span class="line_wrapper"></span></pre> 51 | </td> 52 | <td> 53 | Enumerated type of Boolean type to specify whether data is currently sorted or not 54 | </td> 55 | </tr> 56 | </table> 57 | 58 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 59 | width="200" height="200" style="float:right"/> 60 | 61 | </body> 62 | </html> 63 | 64 | <!-- 65 | Local Variables: 66 | mode:HTML 67 | tab-width:4 68 | c-basic-offset:4 69 | End: 70 | --> 71 | -------------------------------------------------------------------------------- /docs/HTML/std_variant.html: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Hossein Moein and/or the DataFrame nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | --> 25 | <!DOCTYPE html> 26 | <html> 27 | <head> 28 | <style> 29 | * { 30 | box-sizing: border-box; 31 | } 32 | 33 | body { 34 | background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke); 35 | } 36 | 37 | </style> 38 | </head> 39 | 40 | <body style="font-family: Georgia, serif"> 41 | 42 | For small to small-medium size datasets std::variant (aka type-safe union) is a neat trick. For that kind of datasets combining std::variant with std::visit can be a good substitute for runtime polymorphism. But for large datasets std::variant has two main problems:<BR> 43 | <OL> 44 | <LI>There is extra code that compilers/users must insert to figure out the type of each item inside std::variant in conjunction with std::visit and what to do with it</LI> 45 | <LI>Size of std::variant is the size of its largest member. So, you could be wasting significant memory space</LI> 46 | </OL> 47 | <BR> 48 | <BR> 49 | <BR> 50 | 51 | <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame" 52 | width="200" height="200" style="float:right"/> 53 | 54 | </body> 55 | </html> 56 | 57 | <!-- 58 | Local Variables: 59 | mode:HTML 60 | tab-width:4 61 | c-basic-offset:4 62 | End: 63 | --> 64 | -------------------------------------------------------------------------------- /docs/LionLookingUp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosseinmoein/DataFrame/606d1bca2cdfd6564ade3aa6abdb6a2448ea8ed3/docs/LionLookingUp.jpg -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(hello_world hello_world.cc) 2 | target_link_libraries(hello_world PRIVATE DataFrame Threads::Threads) 3 | target_compile_options( 4 | hello_world 5 | PRIVATE lt;lt;CXX_COMPILER_ID:MSVC>:/bigobj> 6 | lt;lt;CXX_COMPILER_ID:MSVC>:/wd4251> 7 | lt;lt;CXX_COMPILER_ID:MSVC>:/wd5030> 8 | lt;lt;CXX_COMPILER_ID:MSVC>:/wd5222> 9 | # TODO: fix these warnings 10 | PUBLIC lt;lt;CXX_COMPILER_ID:MSVC>:/wd4244> 11 | lt;lt;CXX_COMPILER_ID:MSVC>:/wd4267> 12 | lt;lt;CXX_COMPILER_ID:MSVC>:/wd4996> 13 | ) 14 | # add_test(NAME hello_world COMMAND hello_world) 15 | 16 | -------------------------------------------------------------------------------- /include/DataFrame/DataFrameExports.h: -------------------------------------------------------------------------------- 1 | // @SpaceIm 2 | // January 15, 2022 3 | /* 4 | Copyright (c) 2019-2026, Hossein Moein 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of Hossein Moein and/or the DataFrame nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #pragma once 31 | 32 | #ifdef HMDF_SHARED 33 | # ifdef _WIN32 34 | # ifdef DataFrame_EXPORTS 35 | # define HMDF_API __declspec(dllexport) 36 | # else 37 | # define HMDF_API __declspec(dllimport) 38 | # endif // DataFrame_EXPORTS 39 | # else 40 | # define HMDF_API __attribute__((visibility("default"))) 41 | # endif // _WIN32 42 | #else 43 | # define HMDF_API 44 | #endif // HMDF_SHARED 45 | -------------------------------------------------------------------------------- /include/DataFrame/Utils/FixedSizePriorityQueue.h: -------------------------------------------------------------------------------- 1 | // Hossein Moein 2 | // October 16 2020 3 | /* 4 | Copyright (c) 2019-2026, Hossein Moein 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of Hossein Moein and/or the DataFrame nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #pragma once 31 | 32 | #include <algorithm> 33 | #include <array> 34 | #include <functional> 35 | #include <iterator> 36 | #include <utility> 37 | #include <vector> 38 | 39 | // ---------------------------------------------------------------------------- 40 | 41 | namespace hmdf 42 | { 43 | 44 | // Fixed size priority queue. By default, it is a max heap 45 | // 46 | template <typename T, std::size_t N, typename Cmp = std::less<T>> 47 | class FixedSizePriorityQueue { 48 | 49 | using container_type = std::array<T, N>; 50 | using iterator = typename container_type::iterator; 51 | using const_iterator = typename container_type::const_iterator; 52 | 53 | public: 54 | 55 | using value_type = T; 56 | using compare_type = Cmp; 57 | using size_type = std::size_t; 58 | 59 | void push(value_type &&item) { 60 | 61 | if (data_end_ != array_.end()) { 62 | *data_end_++ = std::move(item); 63 | std::push_heap(array_.begin(), data_end_, cmp_); 64 | } 65 | else { 66 | std::sort_heap(array_.begin(), array_.end(), cmp_); 67 | if (cmp_(array_.front(), item)) 68 | array_[0] = std::move(item); 69 | std::make_heap(array_.begin(), array_.end(), cmp_); 70 | } 71 | } 72 | 73 | [[nodiscard]] inline const value_type 74 | &top() const noexcept { return (array_.front()); } 75 | inline void pop() { 76 | 77 | if (! empty()) 78 | std::pop_heap(array_.begin(), data_end_--, cmp_); 79 | } 80 | 81 | [[nodiscard]] inline size_type size() const noexcept { 82 | 83 | return (std::distance(array_.begin(), 84 | static_cast<const_iterator>(data_end_))); 85 | } 86 | [[nodiscard]] inline bool empty() const noexcept { return (size() == 0); } 87 | 88 | inline void clear() { data_end_ = array_.begin(); } 89 | 90 | [[nodiscard]] inline std::vector<value_type> data() const { 91 | 92 | std::vector<value_type> result; 93 | 94 | result.reserve(size()); 95 | for (auto citer = array_.begin(); citer < data_end_; ++citer) 96 | result.push_back(*citer); 97 | std::sort_heap(result.begin(), result.end(), cmp_); 98 | return (result); 99 | } 100 | 101 | private: 102 | 103 | container_type array_ { }; 104 | iterator data_end_ { array_.begin() }; 105 | compare_type cmp_ { }; 106 | }; 107 | 108 | } // namespace std 109 | 110 | // ---------------------------------------------------------------------------- 111 | 112 | // Local Variables: 113 | // mode:C++ 114 | // tab-width:4 115 | // c-basic-offset:4 116 | // End: 117 | -------------------------------------------------------------------------------- /include/DataFrame/Utils/Threads/SharedQueue.h: -------------------------------------------------------------------------------- 1 | // Hossein Moein 2 | // August 9, 2023 3 | /* 4 | Copyright (c) 2023-2028, Hossein Moein 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of Hossein Moein and/or the DataFrame nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #pragma once 31 | 32 | #include <condition_variable> 33 | #include <deque> 34 | #include <mutex> 35 | #include <optional> 36 | #include <queue> 37 | #include <chrono> 38 | 39 | // ---------------------------------------------------------------------------- 40 | 41 | namespace hmdf 42 | { 43 | 44 | template<typename T> 45 | class SharedQueue { 46 | 47 | public: 48 | 49 | using value_type = T; 50 | using size_type = std::size_t; 51 | using optional_ret = std::optional<value_type>; 52 | 53 | SharedQueue() = default; 54 | SharedQueue(SharedQueue &&) = default; 55 | SharedQueue &operator = (SharedQueue &&) = default; 56 | SharedQueue(const SharedQueue &) = delete; 57 | SharedQueue &operator = (const SharedQueue &) = delete; 58 | 59 | inline void push(const value_type &element) noexcept; 60 | 61 | // NOTE: The following method returns the data by value. 62 | // Therefore, it is not as efficient as front(). 63 | // Use it only if you have to. 64 | // 65 | inline optional_ret 66 | pop_front(bool wait_on_front = true) noexcept; 67 | 68 | bool empty() const noexcept; 69 | size_type size() const noexcept; 70 | 71 | private: 72 | 73 | using QueueType = std::queue<value_type, std::deque<value_type>>; 74 | using AutoLockable = std::lock_guard<std::mutex>; 75 | 76 | mutable std::mutex mutex_ { }; 77 | mutable std::condition_variable cvx_ { }; 78 | QueueType queue_ { }; 79 | }; 80 | 81 | } // namespace hmdf 82 | 83 | // ---------------------------------------------------------------------------- 84 | 85 | #ifndef HMDF_DO_NOT_INCLUDE_TCC_FILES 86 | # include <DataFrame/Utils/Threads/SharedQueue.tcc> 87 | #endif // HMDF_DO_NOT_INCLUDE_TCC_FILES 88 | 89 | // ---------------------------------------------------------------------------- 90 | 91 | // Local Variables: 92 | // mode:C++ 93 | // tab-width:4 94 | // c-basic-offset:4 95 | // End: 96 | -------------------------------------------------------------------------------- /include/DataFrame/Utils/Threads/SharedQueue.tcc: -------------------------------------------------------------------------------- 1 | // Hossein Moein 2 | // August 9, 2023 3 | /* 4 | Copyright (c) 2023-2028, Hossein Moein 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of Hossein Moein and/or the DataFrame nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include <DataFrame/Utils/Threads/SharedQueue.h> 31 | 32 | using namespace std::chrono_literals; 33 | 34 | // ---------------------------------------------------------------------------- 35 | 36 | namespace hmdf 37 | { 38 | 39 | template<typename T> 40 | inline void 41 | SharedQueue<T>::push(const value_type &element) noexcept { 42 | 43 | const AutoLockable lock { mutex_ }; 44 | const bool was_empty { queue_.empty() }; 45 | 46 | queue_.push (element); 47 | if (was_empty) cvx_.notify_all(); 48 | } 49 | 50 | // ---------------------------------------------------------------------------- 51 | 52 | template<typename T> 53 | inline typename SharedQueue<T>::optional_ret 54 | SharedQueue<T>::pop_front(bool wait_on_front) noexcept { 55 | 56 | optional_ret ret { }; 57 | std::unique_lock<std::mutex> ul { mutex_ }; 58 | 59 | if (queue_.empty() && wait_on_front) 60 | cvx_.wait_for(ul, 2s); 61 | 62 | if (! queue_.empty()) { 63 | ret = queue_.front(); 64 | queue_.pop(); 65 | } 66 | return (ret); 67 | } 68 | 69 | // ---------------------------------------------------------------------------- 70 | 71 | template<typename T> 72 | bool SharedQueue<T>::empty() const noexcept { 73 | 74 | const AutoLockable lock { mutex_ }; 75 | 76 | return (queue_.empty()); 77 | } 78 | 79 | // ---------------------------------------------------------------------------- 80 | 81 | template<typename T> 82 | typename SharedQueue<T>::size_type 83 | SharedQueue<T>::size() const noexcept { 84 | 85 | const AutoLockable lock { mutex_ }; 86 | 87 | return (queue_.size()); 88 | } 89 | 90 | } // namespace hmdf 91 | 92 | // ---------------------------------------------------------------------------- 93 | 94 | // Local Variables: 95 | // mode:C++ 96 | // tab-width:4 97 | // c-basic-offset:4 98 | // End: 99 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DataFrame", 3 | "version": "3.3.0", 4 | "homepage": "https://github.com/hosseinmoein/DataFrame", 5 | "repository": "github:hosseinmoein/DataFrame", 6 | "author": "Hossein Moein <myseajune@aol.com>", 7 | "description": "C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ using native types and contiguous memory storage", 8 | "license": "BSD 3-Clause" 9 | } 10 | -------------------------------------------------------------------------------- /src/Makefile.Linux.GCC64: -------------------------------------------------------------------------------- 1 | ## Hossein Moein 2 | ## September 12 2017 3 | 4 | BUILD_PLATFORM = Linux.GCC64 5 | BUILD_DEFINE = Linux_GCC64 6 | 7 | # ----------------------------------------------------------------------------- 8 | 9 | CXX = /usr/local/bin/g++-15 10 | # CXX = /usr/bin/g++ 11 | 12 | INCLUDES = 13 | 14 | LFLAGS = 15 | CXXFLAGS = -O3 -march=native $(INCLUDES) $(DEFINES) -Wno-strict-aliasing -std=c++23 16 | 17 | PLATFORM_LIBS = -lpthread -ldl -lm -lstdc++ 18 | 19 | # ----------------------------------------------------------------------------- 20 | 21 | include CommonMakefile.mk 22 | 23 | # ----------------------------------------------------------------------------- 24 | 25 | ## Local Variables: 26 | ## mode:Makefile 27 | ## tab-width:4 28 | ## End: 29 | 30 | -------------------------------------------------------------------------------- /src/Makefile.Linux.GCC64D: -------------------------------------------------------------------------------- 1 | ## Hossein Moein 2 | ## September 12 2017 3 | 4 | BUILD_PLATFORM = Linux.GCC64D 5 | BUILD_DEFINE = Linux_GCC64 6 | 7 | # ----------------------------------------------------------------------------- 8 | 9 | CXX = /usr/local/bin/g++-15 10 | # CXX = /usr/bin/g++ 11 | 12 | INCLUDES = 13 | 14 | LFLAGS = 15 | CXXFLAGS = -g1 $(INCLUDES) $(DEFINES) -D_GLIBCXX_DEBUG -DHMDF_SANITY_EXCEPTIONS -Wno-implicit-fallthrough -pedantic -Wall -Wextra -std=c++23 16 | 17 | PLATFORM_LIBS = -lpthread -ldl -lm -lstdc++ -fsanitize-address-use-after-scope 18 | 19 | # ----------------------------------------------------------------------------- 20 | 21 | include CommonMakefile.mk 22 | 23 | # ----------------------------------------------------------------------------- 24 | 25 | ## Local Variables: 26 | ## mode:Makefile 27 | ## tab-width:4 28 | ## End: 29 | -------------------------------------------------------------------------------- /src/build_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # cd src 4 | make -f Makefile.Linux.GCC64 clobber 5 | make -f Makefile.Linux.GCC64D clobber 6 | make -f Makefile.Linux.GCC64 7 | make -f Makefile.Linux.GCC64D 8 | make -f Makefile.Linux.GCC64 install_lib 9 | make -f Makefile.Linux.GCC64D install_lib 10 | make -f Makefile.Linux.GCC64 install_hdr 11 | 12 | -------------------------------------------------------------------------------- /test/dataframe_thread_safety.cc: -------------------------------------------------------------------------------- 1 | #include <DataFrame/DataFrame.h> 2 | 3 | #include <cassert> 4 | #include <iostream> 5 | #include <string> 6 | 7 | using namespace hmdf; 8 | 9 | typedef StdDataFrame<unsigned long> MyDataFrame; 10 | 11 | static void test_thread_safety() { 12 | 13 | constexpr size_t thread_count = 4; 14 | 15 | std::cout << "Testing Thread safety ..." << std::endl; 16 | 17 | SpinLock lock; 18 | 19 | MyDataFrame::set_lock(&lock); 20 | 21 | std::vector<std::thread> thr_vec; 22 | 23 | std::cout << "* starting threads ..." << std::endl; 24 | for (size_t i = 0; i < thread_count; ++i) 25 | thr_vec.push_back(std::thread([]() { 26 | constexpr size_t jobs_per_thread = 2500; 27 | constexpr unsigned long vec_len = 100; 28 | 29 | for (size_t j = 0; j < jobs_per_thread; ++j) { 30 | MyDataFrame df; 31 | std::vector<double> vec(vec_len); 32 | 33 | std::iota(vec.begin(), vec.end(), 0); 34 | df.load_index(MyDataFrame::gen_sequence_index(0, vec_len, 1)); 35 | df.load_column("abc", std::move(vec)); 36 | } 37 | })); 38 | 39 | std::cout << "* waiting for threads to collect results ..." << std::endl; 40 | for (size_t i = 0; i < thread_count; ++i) 41 | thr_vec[i].join(); 42 | 43 | MyDataFrame::remove_lock(); 44 | } 45 | 46 | // ---------------------------------------------------------------------------- 47 | 48 | int main(int, char *[]) { 49 | 50 | test_thread_safety(); 51 | return (0); 52 | } 53 | 54 | // ---------------------------------------------------------------------------- 55 | 56 | // Local Variables: 57 | // mode:C++ 58 | // tab-width:4 59 | // c-basic-offset:4 60 | // End: 61 | -------------------------------------------------------------------------------- /test/iso_tree_tester.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2019-2026, Hossein Moein 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Hossein Moein and/or the DataFrame nor the 13 | names of its contributors may be used to endorse or promote products 14 | derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include <DataFrame/Utils/IsolationTree.h> 29 | 30 | #include <cassert> 31 | #include <chrono> 32 | #include <iostream> 33 | 34 | using namespace hmdf; 35 | 36 | // ---------------------------------------------------------------------------- 37 | 38 | int main(int, char *[]) { 39 | 40 | std::vector<double> data = 41 | { 1.2, 1.8, 0.99, 10.4, 2.0, 1.86, 0.899, 1.3, 0.901, 1.345, 42 | 1.25, 1.9, 0.96, 1.48, 1.97, 1.867, 1.9, 1.48, 0.001, 1.45, }; 43 | 44 | IsoForest<double> forest { 25, 100 }; 45 | 46 | forest.fit(data.begin(), data.end()); 47 | for (const auto &val : data) 48 | std::cout << forest.outlier_score(val, data.size()) << std::endl; 49 | 50 | return (0); 51 | } 52 | 53 | // ---------------------------------------------------------------------------- 54 | 55 | // Local Variables: 56 | // mode:C++ 57 | // tab-width:4 58 | // c-basic-offset:4 59 | // End: 60 | --------------------------------------------------------------------------------