org.apache.sysml.runtime.compress.utils

Class LinearAlgebraUtils



  • public class LinearAlgebraUtils
    extends Object
    This library contains all vector primitives that are used compressed linear algebra. For primitives that exist in LibMatrixMult, these calls are simply forwarded to ensure consistency in performance and result correctness.
    • Constructor Detail

      • LinearAlgebraUtils

        public LinearAlgebraUtils()
    • Method Detail

      • dotProduct

        public static double dotProduct(double[] a,
                                        double[] b,
                                        int len)
      • dotProduct

        public static double dotProduct(double[] a,
                                        double[] b,
                                        int ai,
                                        int bi,
                                        int len)
      • vectMultiplyAdd

        public static void vectMultiplyAdd(double aval,
                                           double[] b,
                                           double[] c,
                                           int bi,
                                           int ci,
                                           int len)
      • vectMultiplyAdd

        public static void vectMultiplyAdd(double aval,
                                           double[] b,
                                           double[] c,
                                           int[] bix,
                                           int bi,
                                           int ci,
                                           int len)
      • vectAdd

        public static void vectAdd(double[] a,
                                   double[] c,
                                   int ai,
                                   int ci,
                                   int len)
      • vectAdd

        public static void vectAdd(double aval,
                                   double[] c,
                                   char[] bix,
                                   int bi,
                                   int ci,
                                   int len)
      • vectAdd

        public static void vectAdd(double aval,
                                   double[] c,
                                   int ci,
                                   int len)
      • vectSum

        public static double vectSum(double[] a,
                                     char[] bix,
                                     int ai,
                                     int bi,
                                     int len)
      • vectSum

        public static double vectSum(double[] a,
                                     int ai,
                                     int len)
      • copyUpperToLowerTriangle

        public static long copyUpperToLowerTriangle(MatrixBlock ret)
      • copyNonZerosToUpperTriangle

        public static void copyNonZerosToUpperTriangle(MatrixBlock ret,
                                                       MatrixBlock tmp,
                                                       int ix)
      • getClosestK

        public static int getClosestK(int[] a,
                                      int x)
        Obtain the index of the closest element in a to the value x.
        Parameters:
        a - array of ints
        x - value
        Returns:
        the index of the closest element in a to the value x

Copyright © 2017 The Apache Software Foundation. All rights reserved.