コード例 #1
0
        public static void dzasum()
        {
            var silent = true;

            (var method, var msg) = intro(silent);

            var n    = 4;
            var incx = 1;
            var x    = ComplexF64.Load(doubles(1.2, 2.5, 3.0, 1.7, 4.0, 0.53, -5.5, -0.29));

            msg += input(x.FormatVector(), silent);

            var expect = x.Map(z => Math.Abs(z.re) + Math.Abs(z.im)).Reduce((a, b) => a + b);

            expected(expect);


            var time   = start();
            var result = CBLAS.cblas_dzasum(n, ref x[0], incx);

            output("result", result, snapshot(time));
        }
コード例 #2
0
 static double asum(Span <ComplexF64> X)
 => CBLAS.cblas_dzasum(X.Length, ref X[0], 1);