1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! # KunQuant-rs
//!
//! Rust bindings for the KunQuant financial factor computation library.
//!
//! KunQuant is an optimizer, code generator and executor for financial expressions
//! and factors. This crate provides safe Rust bindings to the KunQuant C API.
//!
//! ## Features
//!
//! - Batch mode computation for historical data analysis
//! - Stream mode computation for real-time factor calculation
//! - Thread-safe executors with single-thread and multi-thread support
//! - Memory-safe buffer management
//! - Support for both single and double precision floating point data
//!
//! ## Example
//!
//! ```rust,no_run
//! use kunquant_rs::{Executor, Library, BufferNameMap, BatchParams, run_graph, Result};
//!
//! fn main() -> Result<()> {
//! // Create executor and load library
//! let executor = Executor::single_thread()?;
//! let library = Library::load("path/to/factor_library.so")?;
//! let module = library.get_module("my_module")?;
//!
//! // Set up input/output buffers
//! let mut buffers = BufferNameMap::new()?;
//! let mut input_data = vec![1.0f32; 8 * 100]; // 8 stocks, 100 time points
//! let mut output_data = vec![0.0f32; 8 * 100];
//!
//! buffers.set_buffer_slice("input", &mut input_data)?;
//! buffers.set_buffer_slice("output", &mut output_data)?;
//!
//! // Run computation
//! let params = BatchParams::full_range(8, 100)?;
//! run_graph(&executor, &module, &buffers, ¶ms)?;
//!
//! Ok(())
//! }
//! ```
// Re-export main types for convenience
pub use ;
pub use BufferNameMap;
pub use ;
pub use Executor;
pub use ;
pub use StreamContext;