#[cfg(test)]
extern crate assert;
#[cfg(feature = "acceleration")]
extern crate blas;
#[cfg(feature = "acceleration")]
extern crate lapack;
#[cfg(feature = "acceleration-src")]
extern crate openblas_src;
extern crate num_complex;
extern crate num_traits;
pub use num_traits::Num as Number;
#[allow(non_camel_case_types)]
pub type c32 = num_complex::Complex<f32>;
#[allow(non_camel_case_types)]
pub type c64 = num_complex::Complex<f64>;
use std::convert::Into;
use std::{error, fmt};
use format::Conventional;
pub trait Matrix: Into<Conventional<<Self as Matrix>::Element>> + Size {
type Element: Element;
fn nonzeros(&self) -> usize;
fn zero<S: Size>(S) -> Self;
}
#[macro_export]
macro_rules! matrix {
($([$tail:expr,];)* -> [$($head:expr,)*]) => (
vec![$($head,)* $($tail,)*]
);
($([$middle:expr, $($tail:expr,)*];)* -> [$($head:expr,)*]) => (
matrix!($([$($tail,)*];)* -> [$($head,)* $($middle,)*])
);
($($($item:expr),*;)*) => (
matrix!($([$($item,)*];)* -> [])
);
($($($item:expr,)*;)*) => (
matrix!($([$($item,)*];)* -> [])
);
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Error(String);
pub type Result<T> = std::result::Result<T, Error>;
#[cfg(feature = "acceleration")]
macro_rules! raise(
($message:expr) => (
return Err(::Error($message.to_string()));
);
);
impl fmt::Display for Error {
#[inline]
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
self.0.fmt(formatter)
}
}
impl error::Error for Error {
#[inline]
fn description(&self) -> &str {
&self.0
}
}
mod element;
mod position;
mod size;
pub use element::Element;
pub use position::Position;
pub use size::Size;
pub mod decomposition;
pub mod format;
pub mod operation;
pub mod prelude;