#![allow(non_snake_case)]
use crate::algebra::FloatT;
use enum_dispatch::*;
mod expcone;
mod nonnegativecone;
mod powcone;
mod socone;
mod zerocone;
mod compositecone;
mod supportedcone;
mod exppow_common;
mod symmetric_common;
pub use compositecone::*;
pub use compositecone::*;
pub use expcone::*;
use exppow_common::*;
pub use nonnegativecone::*;
pub use powcone::*;
pub use socone::*;
pub use supportedcone::*;
pub use symmetric_common::*;
pub use zerocone::*;
use crate::solver::{core::ScalingStrategy, CoreSettings};
#[enum_dispatch]
pub trait Cone<T>
where
T: FloatT,
{
fn dim(&self) -> usize;
fn degree(&self) -> usize;
fn numel(&self) -> usize;
fn is_symmetric(&self) -> bool;
fn rectify_equilibration(&self, δ: &mut [T], e: &[T]) -> bool;
fn shift_to_cone(&self, z: &mut [T]);
fn unit_initialization(&self, z: &mut [T], s: &mut [T]);
fn set_identity_scaling(&mut self);
fn update_scaling(&mut self, s: &[T], z: &[T], μ: T, scaling_strategy: ScalingStrategy);
fn Hs_is_diagonal(&self) -> bool;
fn get_Hs(&self, Hsblock: &mut [T]);
fn mul_Hs(&self, y: &mut [T], x: &[T], work: &mut [T]);
fn affine_ds(&self, ds: &mut [T], s: &[T]);
fn combined_ds_shift(&mut self, shift: &mut [T], step_z: &mut [T], step_s: &mut [T], σμ: T);
fn Δs_from_Δz_offset(&self, out: &mut [T], ds: &[T], work: &mut [T]);
fn step_length(
&self,
dz: &[T],
ds: &[T],
z: &[T],
s: &[T],
settings: &CoreSettings<T>,
αmax: T,
) -> (T, T);
fn compute_barrier(&self, z: &[T], s: &[T], dz: &[T], ds: &[T], α: T) -> T;
}