content: /*
   *
   *
   *    Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
   *    See the NOTICE file distributed with this work for additional information regarding copyright ownership.
   *    The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use
   *    this file except in compliance with the License.  You may obtain a copy of the License at
   *
   *            http://www.apache.org/licenses/LICENSE-2.0
   *
   *    Unless required by applicable law or agreed to in writing, software distributed under the License is
   *    distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *    See the License for the specific language governing permissions and limitations under the License.
   *
   *
   */
  
  package eu.amidst.core.exponentialfamily;
  
  import eu.amidst.core.utils.Vector;
  
  
  // TODO: This is not stateless operation!!!!. However it works if we accumulate in the second argument!!! TEST!!!
  
  /**
   * This interface extends the interface {@link Vector} and handles classes for representing the sufficient statistics vector
   * of an exponential family distribution in canonical form.
   *
   * <p> For further details about how exponential family models are considered in this toolbox, take a look at the following paper:
   * <i>Representation, Inference and Learning of Bayesian Networks as Conjugate Exponential Family Models. Technical Report.</i>
   * (<a href="http://amidst.github.io/toolbox/docs/ce-BNs.pdf">pdf</a>) </p>
   */
  public interface SufficientStatistics extends Vector {
  
      /**
       * Sums two sufficient statistics vectors having the same size.
       * @param vec1 a first input {@link SufficientStatistics} object.
       * @param vec2 a second input {@link SufficientStatistics} object.
       * @return a {@link SufficientStatistics} object including the sumNonStateless of the two input vectors.
       */
      static SufficientStatistics sumVectorNonStateless(SufficientStatistics vec1, SufficientStatistics vec2){
          vec2.sum(vec1);
          return vec2;
      }
  
      // Look at the code below
      /*
               List<ArrayVector> vectorList = IntStream.range(0,10).mapToObj(i -> {
              ArrayVector vec = new ArrayVector(2);
              vec.set(0, 1);
              vec.set(1, 1);
              return vec;
          }).collect(Collectors.toList());
  
          Vector out1 = vectorList.parallelStream()
                  .reduce(new ArrayVector(2), (u, v) -> {
                      ArrayVector outvec = new ArrayVector(2);
                      outvec.sumNonStateless(v);
                      outvec.sumNonStateless(u);
                      return outvec;});
  
          Vector out2 = vectorList.parallelStream().reduce(new ArrayVector(2), (u, v) -> {u.sumNonStateless(v); return u;});
          Vector out3 = vectorList.parallelStream().reduce(new ArrayVector(2), (u, v) -> {v.sumNonStateless(u); return v;});
  
          System.out.println(out1.get(0) + ", " + out1.get(1));
          System.out.println(out2.get(0) + ", " + out2.get(1));
          System.out.println(out3.get(0) + ", " + out3.get(1));
       */
  }
  