gspx 0.1.2

Sparse graph signal processing and spectral graph wavelets in Rust
Documentation
//! Local resource loading for example-data directories and direct files.
//!
//! [`ExampleData`] is the high-level entry point when you want the named sample
//! datasets used by the examples from a local directory. For one-off files, use
//! the direct MAT and PLY loaders in this module.

mod dataset;
mod mat;
mod ply;

use std::path::Path;

use ndarray::Array2;

use crate::{Laplacian, error::GspError};

use self::mat::{load_mat_dense, load_mat_laplacian};

pub use self::dataset::{Dataset, ExampleData, GraphKind, KernelPreset};
pub use self::ply::{load_ply_laplacian, load_ply_xyz};

/// Loads a Laplacian from a MAT file path.
///
/// # Errors
/// Returns an error when parsing fails.
pub fn load_laplacian(path: &Path) -> Result<Laplacian, GspError> {
    load_mat_laplacian(path)
}

/// Loads a dense signal matrix from a MAT file path.
///
/// # Errors
/// Returns an error when parsing fails.
pub fn load_signal(path: &Path) -> Result<Array2<f64>, GspError> {
    load_mat_dense(path)
}