cudf-cxx 0.3.1

cxx-based FFI bridge between Rust and NVIDIA libcudf C++ API
Documentation
#pragma once

#include <cudf/replace.hpp>
#include <cudf/types.hpp>
#include <memory>
#include "rust/cxx.h"
#include "column_shim.h"
#include "scalar_shim.h"

namespace cudf_shims {

/// Replace null values with corresponding values from another column.
std::unique_ptr<OwnedColumn> replace_nulls_column(
    const OwnedColumn& col,
    const OwnedColumn& replacement);

/// Replace null values with a scalar.
std::unique_ptr<OwnedColumn> replace_nulls_scalar(
    const OwnedColumn& col,
    const OwnedScalar& replacement);

/// Replace NaN values with a scalar.
std::unique_ptr<OwnedColumn> replace_nans_scalar(
    const OwnedColumn& col,
    const OwnedScalar& replacement);

/// Replace NaN values with corresponding values from another column.
std::unique_ptr<OwnedColumn> replace_nans_column(
    const OwnedColumn& col,
    const OwnedColumn& replacement);

/// Clamp values to [lo, hi].
std::unique_ptr<OwnedColumn> clamp(
    const OwnedColumn& col,
    const OwnedScalar& lo,
    const OwnedScalar& hi);

/// Normalize -NaN to +NaN and -0.0 to +0.0.
std::unique_ptr<OwnedColumn> normalize_nans_and_zeros(
    const OwnedColumn& col);

/// Replace nulls using a policy (PRECEDING=0, FOLLOWING=1).
std::unique_ptr<OwnedColumn> replace_nulls_policy(
    const OwnedColumn& col,
    int32_t policy);

/// Find and replace all occurrences of old_values with new_values.
std::unique_ptr<OwnedColumn> find_and_replace_all(
    const OwnedColumn& col,
    const OwnedColumn& old_values,
    const OwnedColumn& new_values);

/// Normalize NaN and zeros in-place (modifies column).
void normalize_nans_and_zeros_inplace(OwnedColumn& col);

/// Clamp with replacement values: lo_replace for below lo, hi_replace for above hi.
std::unique_ptr<OwnedColumn> clamp_with_replace(
    const OwnedColumn& col,
    const OwnedScalar& lo,
    const OwnedScalar& lo_replace,
    const OwnedScalar& hi,
    const OwnedScalar& hi_replace);

} // namespace cudf_shims