pub fn adaptive_decomposition<F>(
matrix: &ArrayView2<'_, F>,
config: &ScalableConfig,
) -> LinalgResult<AdaptiveResult<F>>
Expand description
Adaptive algorithm selection based on matrix aspect ratio
This function automatically selects the most appropriate algorithm based on the matrix dimensions and configuration, providing detailed performance analytics and optimization recommendations.
§Arguments
matrix
- Input matrixconfig
- Configuration parameters
§Returns
- Comprehensive adaptive decomposition result with performance metrics
§Examples
use scirs2_core::ndarray::Array2;
use scirs2_linalg::scalable::{adaptive_decomposition, ScalableConfig, AspectRatio};
// Tall matrix - should select TSQR
let tallmatrix = Array2::from_shape_fn((500, 20), |(i, j)| {
(i + j + 1) as f64
});
let config = ScalableConfig::default();
let result = adaptive_decomposition(&tallmatrix.view(), &config).unwrap();
assert_eq!(result.aspect_ratio, AspectRatio::TallSkinny);