/// <summary> /// Cvms the mul. /// 非同期による行列の掛け算 /// </summary> /// <returns>The mul.</returns> /// <param name="z">The z coordinate.</param> /// <param name="w">The width.</param> /// <param name="callback">Callback.</param> public static System.Collections.IEnumerator cvmMul(ArrayMat z, ArrayMat w, Action <ArrayMat> callback) { if (z.Cols != w.Rows) { throw new OutLookARException("Mat type must bu equal to the number of w.rows and z.cols."); } System.Diagnostics.Stopwatch sw = System.Diagnostics.Stopwatch.StartNew(); ArrayMat v = ArrayMat.zeros(z.Rows, w.Cols); for (int r = 0; r < v.Rows; r++) { for (int c = 0; c < v.Cols; c++) { double pt = 0; for (int b = 0; b < z.Cols; b++) { pt += z.At(r, b) * w.At(b, c); if (sw.Elapsed.Milliseconds > 100) { sw.Reset(); Debug.Log(string.Format("cvmMul :... {0}/{1} ... {2} %", r, v.Rows, r * 100 / v.Rows)); yield return(null); } sw.Start(); } v.At(r, c, pt); } } callback(v); }