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

scalismo.statisticalmodel.experimental.SVIMCoefficients.scala Maven / Gradle / Ivy

There is a newer version: 1.0-RC1
Show newest version
package scalismo.statisticalmodel.experimental

import breeze.linalg.DenseVector

case class SVIMCoefficients(shape: DenseVector[Double], intensity: DenseVector[Double]) {
  def *(f: Float): SVIMCoefficients = this * f.toDouble
  def *(d: Double): SVIMCoefficients = copy(shape = shape * d, intensity = intensity * d)
  def +(other: SVIMCoefficients): SVIMCoefficients =
    copy(shape = shape + other.shape, intensity = intensity + other.intensity)
  def -(other: SVIMCoefficients): SVIMCoefficients =
    copy(shape = shape - other.shape, intensity = intensity - other.intensity)
}

object SVIMCoefficients {
  def apply(shape: IndexedSeq[Double], intensity: IndexedSeq[Double]) =
    new SVIMCoefficients(DenseVector(shape.toArray), DenseVector(intensity.toArray))

  /** get 0 coefficients of specified length */
  def zeros(shapeComponents: Int, intensityComponents: Int): SVIMCoefficients = {
    new SVIMCoefficients(DenseVector.zeros(shapeComponents), DenseVector.zeros(intensityComponents))
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy