Class DenseFieldVectorOps

java.lang.Object
org.flag4j.linalg.ops.dense.field_ops.DenseFieldVectorOps

public final class DenseFieldVectorOps extends Object
This class provides low level implementations for vector ops with two dense Field vectors.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends Field<T>>
    T
    dotProduct(T[] src1, T[] src2)
    Computes the vector dot product for two vectors.
    static <T extends Field<T>>
    T
    innerProduct(T[] src1, T[] src2)
    Computes the vector inner product for two vectors.
    static double
    Computes the inner product (dot product) of a vector with itself.
    static <T extends Field<T>>
    void
    outerProduct(T[] src1, T[] src2, T[] dest)
    Computes the vector outer product between two real dense vectors.
    static <T extends Field<T>>
    void
    outerProductConcurrent(T[] src1, T[] src2, T[] dest)
    Computes the vector outer product between two real dense vectors using a concurrent implementation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • innerProduct

      public static <T extends Field<T>> T innerProduct(T[] src1, T[] src2)
      Computes the vector inner product for two vectors.
      Parameters:
      src1 - Entries of the first vector.
      src2 - Entries of the second vector.
      Returns:
      The inner product of the two vectors.
    • innerSelfProduct

      public static double innerSelfProduct(Complex128[] src1)
      Computes the inner product (dot product) of a vector with itself.
      Parameters:
      vector - The input complex vector.
      Returns:
      The inner product of the vector with itself as a double.
    • dotProduct

      public static <T extends Field<T>> T dotProduct(T[] src1, T[] src2)
      Computes the vector dot product for two vectors.
      Parameters:
      src1 - Entries of the first vector.
      src2 - Entries of the second vector.
      Returns:
      The dot product of the two vectors.
    • outerProduct

      public static <T extends Field<T>> void outerProduct(T[] src1, T[] src2, T[] dest)
      Computes the vector outer product between two real dense vectors.
      Parameters:
      src1 - Entries of first vector.
      src2 - Entries of second vector.
      dest - Array to store the result of the vector outer product (modified).
    • outerProductConcurrent

      public static <T extends Field<T>> void outerProductConcurrent(T[] src1, T[] src2, T[] dest)
      Computes the vector outer product between two real dense vectors using a concurrent implementation.
      Parameters:
      src1 - Entries of first vector.
      src2 - Entries of second vector.
      dest - Array to store the result of the vector outer product in (modified). Must have length src1.length*src2.length.