fix: renames FloatExt to RealNumber

This commit is contained in:
Volodymyr Orlov
2020-08-29 20:17:01 -07:00
parent 8705867386
commit fa0918cee3
43 changed files with 238 additions and 208 deletions
+4 -4
View File
@@ -1,11 +1,11 @@
#![allow(non_snake_case)]
use crate::linalg::BaseMatrix;
use crate::math::num::FloatExt;
use crate::math::num::RealNumber;
use std::fmt::Debug;
#[derive(Debug, Clone)]
pub struct SVD<T: FloatExt, M: SVDDecomposableMatrix<T>> {
pub struct SVD<T: RealNumber, M: SVDDecomposableMatrix<T>> {
pub U: M,
pub V: M,
pub s: Vec<T>,
@@ -15,7 +15,7 @@ pub struct SVD<T: FloatExt, M: SVDDecomposableMatrix<T>> {
tol: T,
}
pub trait SVDDecomposableMatrix<T: FloatExt>: BaseMatrix<T> {
pub trait SVDDecomposableMatrix<T: RealNumber>: BaseMatrix<T> {
fn svd_solve_mut(self, b: Self) -> Self {
self.svd_mut().solve(b)
}
@@ -367,7 +367,7 @@ pub trait SVDDecomposableMatrix<T: FloatExt>: BaseMatrix<T> {
}
}
impl<T: FloatExt, M: SVDDecomposableMatrix<T>> SVD<T, M> {
impl<T: RealNumber, M: SVDDecomposableMatrix<T>> SVD<T, M> {
pub fn new(U: M, V: M, s: Vec<T>) -> SVD<T, M> {
let m = U.shape().0;
let n = V.shape().0;