示例#1
0
        public async Task <double> Blas1([FromBody] VecVecMulClass input)
        {
            int     id        = input.Id;
            ActorId actorId   = new ActorId(id);
            var     actor     = ActorProxy.Create <ILA>(actorId, new Uri("fabric:/Application/LAActorService"));
            string  jsonInput = JsonConvert.SerializeObject(input);
            double  output    = await actor.VecVecMultiply(jsonInput);

            return(output);
        }
示例#2
0
文件: LA.cs 项目: yshin1209/EaaS
        Task <double> ILA.VecVecMultiply(string jsonInput)
        {
            VecVecMulClass inputObject = JsonConvert.DeserializeObject <VecVecMulClass>(jsonInput);

            double[] vector1 = inputObject.Vector1;
            double[] vector2 = inputObject.Vector2;
            var      n       = vector1.Length;
            double   product = 0;

            for (int i = 0; i < n; i++)
            {
                product = product + vector1[i] * vector2[i];
            }
            return(Task.FromResult <double>(product));
        }