Esempio n. 1
0
        public _nMatrix MultiplyByAnotherMatrix(_nMatrix matrix)
        {
            _nVector[] _row = new _nVector[n];
            double[]   a    = new double[n];
            for (int k = 1; k <= n; k++)
            {
                for (int j = 1; j <= n; j++)
                {
                    for (int i = 1; i <= n; i++)
                    {
                        var tmp1 = GetValueAt(k, i); var tmp2 = matrix.GetValueAt(i, j);
                        a[j - 1] += GetValueAt(k, i) * matrix.GetValueAt(i, j);
                    }
                    var tmp3 = a[j - 1];
                }

                _row[k - 1] = new _nVector(a.ToList());
                a           = new double[n];
            }
            return(new _nMatrix(_row.ToList(), n));
        }
Esempio n. 2
0
        public _mnMatrix MultiplyMeByNMatrix(_nMatrix matrix)
        {
            _nVector[] _row = new _nVector[n];
            var        mm   = matrix.rows.Count();

            double[] a = new double[n];
            for (int k = 1; k <= n; k++)
            {
                for (int j = 1; j <= mm; j++)
                {
                    for (int i = 1; i <= mm; i++)
                    {
                        //var tmp1 = GetValueAt(k, i); var tmp2 = matrix.GetValueAt(i, j);
                        a[j - 1] += GetValueAt(k, i) * matrix.GetValueAt(i, j);
                    }
                    // var tmp3 = a[j - 1];
                }

                _row[k - 1] = new _nVector(a.ToList());
                a           = new double[n];
            }
            return(new _mnMatrix(_row.ToList(), n, mm));
        }