public ParametricEquation <F> Kernel() { var result = new List <Vector <F> >(); var trap = ToTrap(); var rows = new List <int>(); int m = 0; for (int n = 0; n < N; ++n) { if (trap.Column(n).IsNull()) { result.Add(Vector <F> .UnitVector(N, n)); } else if (m < trap.M && trap[m][n].IsOne()) { rows.Add(n); ++m; } else { var vector = ContainerUtils.UniformArray(new F(), N); vector[n] = new F().ONE; for (int i = 0; i < rows.Count; ++i) { vector[rows[i]] = trap[i][n].AdditiveInverse(); } result.Add(new Vector <F>(vector)); } } return(new ParametricEquation <F>(Vector <F> .NullVector(N), result)); }
public Distributer(int inputs, int outputs) { Inputs = new ConnectionsArray(inputs); Outputs = new ConnectionsArray(outputs); InputWeights = new Weights(ContainerUtils.UniformArray(1f, inputs)); OutputWeights = new Weights(ContainerUtils.UniformArray(1f, outputs)); }
public static Matrix <F> DiagonalMatrix(IEnumerable <F> values) { var dim = values.Count(); var result = ContainerUtils.UniformArray(ContainerUtils.UniformArray(new F(), dim), dim); int i = 0; foreach (var f in values) { result[i][i] = f; ++i; } return(new Matrix <F>(result)); }
public static Vector <F> NullVector(int dim) { return(new Vector <F>(ContainerUtils.UniformArray(new F(), dim))); }