use super::super::decompositions::*;
use crate::error::{Error, Result};
use crate::runtime::Runtime;
use crate::tensor::Tensor;
pub trait TensorDecomposeAlgorithms<R: Runtime> {
fn unfold(&self, tensor: &Tensor<R>, mode: usize) -> Result<Tensor<R>> {
let _ = (tensor, mode);
Err(Error::NotImplemented {
feature: "TensorDecomposeAlgorithms::unfold",
})
}
fn fold(&self, matrix: &Tensor<R>, mode: usize, shape: &[usize]) -> Result<Tensor<R>> {
let _ = (matrix, mode, shape);
Err(Error::NotImplemented {
feature: "TensorDecomposeAlgorithms::fold",
})
}
fn mode_n_product(
&self,
tensor: &Tensor<R>,
matrix: &Tensor<R>,
mode: usize,
) -> Result<Tensor<R>> {
let _ = (tensor, matrix, mode);
Err(Error::NotImplemented {
feature: "TensorDecomposeAlgorithms::mode_n_product",
})
}
fn hosvd(&self, tensor: &Tensor<R>, ranks: &[usize]) -> Result<TuckerDecomposition<R>> {
let _ = (tensor, ranks);
Err(Error::NotImplemented {
feature: "TensorDecomposeAlgorithms::hosvd",
})
}
fn tucker(
&self,
tensor: &Tensor<R>,
ranks: &[usize],
options: TuckerOptions,
) -> Result<TuckerDecomposition<R>> {
let _ = (tensor, ranks, options);
Err(Error::NotImplemented {
feature: "TensorDecomposeAlgorithms::tucker",
})
}
fn cp_decompose(
&self,
tensor: &Tensor<R>,
rank: usize,
options: CpOptions,
) -> Result<CpDecomposition<R>> {
let _ = (tensor, rank, options);
Err(Error::NotImplemented {
feature: "TensorDecomposeAlgorithms::cp_decompose",
})
}
fn tensor_train(
&self,
tensor: &Tensor<R>,
max_rank: usize,
tolerance: f64,
) -> Result<TensorTrainDecomposition<R>> {
let _ = (tensor, max_rank, tolerance);
Err(Error::NotImplemented {
feature: "TensorDecomposeAlgorithms::tensor_train",
})
}
fn tucker_reconstruct(&self, decomp: &TuckerDecomposition<R>) -> Result<Tensor<R>> {
let _ = decomp;
Err(Error::NotImplemented {
feature: "TensorDecomposeAlgorithms::tucker_reconstruct",
})
}
fn cp_reconstruct(&self, decomp: &CpDecomposition<R>, shape: &[usize]) -> Result<Tensor<R>> {
let _ = (decomp, shape);
Err(Error::NotImplemented {
feature: "TensorDecomposeAlgorithms::cp_reconstruct",
})
}
fn tt_reconstruct(&self, decomp: &TensorTrainDecomposition<R>) -> Result<Tensor<R>> {
let _ = decomp;
Err(Error::NotImplemented {
feature: "TensorDecomposeAlgorithms::tt_reconstruct",
})
}
}