1. 17 Oct, 2025 1 commit
  2. 21 Mar, 2021 1 commit
    • Alberto Ferreira's avatar
      [SWIG] Add streaming data support + cpp tests (#3997) · 4ded1342
      Alberto Ferreira authored
      * [feature] Add ChunkedArray to SWIG
      
      * Add ChunkedArray
      * Add ChunkedArray_API_extensions.i
      * Add SWIG class wrappers
      
      * Address some review comments
      
      * Fix linting issues
      
      * Move test to tests/test_ChunkedArray_manually.cpp
      
      * Add test note
      
      * Move ChunkedArray to include/LightGBM/utils/
      
      * Declare more explicit types of ChunkedArray in the SWIG API.
      
      * Port ChunkedArray tests to googletest
      
      * Please C++ linter
      
      * Address StrikerRUS' review comments
      
      * Update SWIG doc & disable ChunkedArray<int64_t>
      
      * Use CHECK_EQ instead of assert
      
      * Change include order (linting)
      
      * Rename ChunkedArray -> chunked_array files
      
      * Change header guards
      
      * Address last comments from StrikerRUS
      4ded1342
  3. 07 Oct, 2020 1 commit
  4. 20 Mar, 2020 1 commit
    • Alberto Ferreira's avatar
      Fix SWIG methods that return char** (#2850) · 91185c3a
      Alberto Ferreira authored
      
      
      * [swig] Fix SWIG methods that return char** with StringArray.
      
      + [new] Add StringArray class to manage and manipulate arrays of fixed-length strings:
      
        This class is now used to wrap any char** parameters, manage memory and
        manipulate the strings.
      
        Such class is defined at swig/StringArray.hpp and wrapped in StringArray.i.
      
      + [API+fix] Wrap LGBM_BoosterGetFeatureNames it resulted in segfault before:
      
        Added wrapper LGBM_BoosterGetFeatureNamesSWIG(BoosterHandle) that
        only receives the booster handle and figures how much memory to allocate
        for strings and returns a StringArray which can be easily converted to String[].
      
      + [API+safety] For consistency, LGBM_BoosterGetEvalNamesSWIG was wrapped as well:
      
        * Refactor to detect any kind of errors and removed all the parameters
          besides the BoosterHandle (much simpler API to use in Java).
        * No assumptions are made about the required string space necessary (128 before).
        * The amount of required string memory is computed internally
      
      + [safety] No possibility of undefined behaviour
      
        The two methods wrapped above now compute the necessary string storage space
        prior to allocation, as the low-level C API calls would crash the process
        irreversibly if they write more memory than which is passed to them.
      
      * Changes to C API and wrappers support char**
      
      To support the latest SWIG changes that enable proper char**
      return support that is safe, the C API was changed.
      
      The respecive wrappers in R and Python were changed too.
      
      * Cleanup indentation in new lightgbm_R.cpp code
      
      * Adress review code-style comments.
      
      * Update swig/StringArray.hpp
      Co-Authored-By: default avatarNikita Titov <nekit94-08@mail.ru>
      
      * Update python-package/lightgbm/basic.py
      Co-Authored-By: default avatarNikita Titov <nekit94-08@mail.ru>
      
      * Update src/lightgbm_R.cpp
      Co-Authored-By: default avatarNikita Titov <nekit94-08@mail.ru>
      Co-authored-by: default avataralberto.ferreira <alberto.ferreira@feedzai.com>
      Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>
      91185c3a