All Downloads are FREE. Search and download functionalities are using the official Maven repository.

breeze.linalg.functions.cond.scala Maven / Gradle / Ivy

There is a newer version: 1.0
Show newest version
package breeze.linalg

import breeze.generic.UFunc
import breeze.linalg.svd.{SVD, DenseSVD}


/**
 * Computes the condition number of the given real matrix.
 */
object cond extends UFunc {
  implicit def canDetUsingSVD[T](implicit svdImpl: svd.Impl[T, DenseSVD]):Impl[T, Double] = {
    new Impl[T, Double] {
      def apply(X: T): Double = {
        val SVD(_, vecs, _) = svd(X)
        vecs(0)/vecs(vecs.length - 1)
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy