public ArrayKalmanFilter(int length) { filters = new KalmanFilter[length]; for (int i = 0; i < length; i++) { filters[i] = new KalmanFilter(); } }
public KalmanFilter Clone() { KalmanFilter filter = new KalmanFilter { x = x, z = z, P = P, K = K, initialized = initialized }; return(filter); }
public double[] Calculate(double[] array) { if (filters == null) { filters = new KalmanFilter[array.Length]; for (int i = 0; i < filters.Length; i++) { filters[i] = new KalmanFilter(); } } if (array.Length != filters.Length) { throw new ArgumentOutOfRangeException(); } double[] ret = new double[array.Length]; for (int i = 0; i < array.Length; i++) { ret[i] = filters[i].Calculate(array[i]); } return(ret); }