示例#1
0
        I4DTensor _FormIntoTensor(ILinearAlgebraProvider lap, IVector vector, I4DTensor tensor)
        {
            var indexableVector = vector.AsIndexable();
            var tensorList      = new List <I3DTensor>();

            for (var i = 0; i < tensor.Count; i++)
            {
                var matrixList = new List <IMatrix>();
                for (var j = 0; j < tensor.Depth; j++)
                {
                    matrixList.Add(lap.CreateMatrix(tensor.RowCount, tensor.ColumnCount, indexableVector[j]));
                }
                tensorList.Add(lap.Create3DTensor(matrixList));
            }
            return(lap.Create4DTensor(tensorList));
        }