test_class.file: modules/ml/src/test/java/org/apache/ignite/ml/clustering/gmm/CovarianceMatricesAggregatorTest.java
test_class.identifier: CovarianceMatricesAggregatorTest
test_case.body: @Test
      public void testAdd() {
          CovarianceMatricesAggregator agg = new CovarianceMatricesAggregator(VectorUtils.of(1., 0.));
          assertEquals(0, agg.rowCount());
  
          agg.add(VectorUtils.of(1., 0.), 100.);
          assertArrayEquals(VectorUtils.of(1., 0.).asArray(), agg.mean().asArray(), 1e-4);
          assertArrayEquals(
              agg.weightedSum().getStorage().data(),
              fromArray(2, 0., 0., 0., 0.).getStorage().data(),
              1e-4
          );
          assertEquals(1, agg.rowCount());
  
          agg.add(VectorUtils.of(0., 1.), 10.);
          assertArrayEquals(VectorUtils.of(1., 0.).asArray(), agg.mean().asArray(), 1e-4);
          assertArrayEquals(
              agg.weightedSum().getStorage().data(),
              fromArray(2, 10., -10., -10., 10.).getStorage().data(),
              1e-4
          );
          assertEquals(2, agg.rowCount());
      }
test_case.class_method_signature: CovarianceMatricesAggregatorTest.testAdd()
test_case.full_signature: @Test public void testAdd()
test_case.identifier: testAdd
test_case.invocations: of assertEquals rowCount add of assertArrayEquals asArray of asArray mean assertArrayEquals data getStorage weightedSum data getStorage fromArray assertEquals rowCount add of assertArrayEquals asArray of asArray mean assertArrayEquals data getStorage weightedSum data getStorage fromArray assertEquals rowCount
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAdd()
focal_class.declarator: serialVersionUID = 4163253784526780812L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 4163253784526780812L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: mean
focal_class.modifier: private final
focal_class.original_string: private final Vector mean;
focal_class.type: Vector
focal_class.var_name: mean
focal_class.declarator: weightedSum
focal_class.modifier: private
focal_class.original_string: private Matrix weightedSum;
focal_class.type: Matrix
focal_class.var_name: weightedSum
focal_class.declarator: rowCount
focal_class.modifier: private
focal_class.original_string: private int rowCount;
focal_class.type: int
focal_class.var_name: rowCount
focal_class.file: modules/ml/src/main/java/org/apache/ignite/ml/clustering/gmm/CovarianceMatricesAggregator.java
focal_class.identifier: CovarianceMatricesAggregator
focal_class.interfaces: implements Serializable
focal_class.class_method_signature: CovarianceMatricesAggregator.CovarianceMatricesAggregator(Vector mean)
focal_class.full_signature:   CovarianceMatricesAggregator(Vector mean)
focal_class.identifier: CovarianceMatricesAggregator
focal_class.parameters: (Vector mean)
focal_class.signature:  CovarianceMatricesAggregator(Vector mean)
focal_class.class_method_signature: CovarianceMatricesAggregator.CovarianceMatricesAggregator(Vector mean, Matrix weightedSum, int rowCount)
focal_class.full_signature:   CovarianceMatricesAggregator(Vector mean, Matrix weightedSum, int rowCount)
focal_class.identifier: CovarianceMatricesAggregator
focal_class.parameters: (Vector mean, Matrix weightedSum, int rowCount)
focal_class.signature:  CovarianceMatricesAggregator(Vector mean, Matrix weightedSum, int rowCount)
focal_class.class_method_signature: CovarianceMatricesAggregator.computeCovariances(Dataset<EmptyContext, GmmPartitionData> dataset,
          Vector clusterProbs, Vector[] means)
focal_class.full_signature: static List<Matrix> computeCovariances(Dataset<EmptyContext, GmmPartitionData> dataset,
          Vector clusterProbs, Vector[] means)
focal_class.identifier: computeCovariances
focal_class.modifiers: static
focal_class.parameters: (Dataset<EmptyContext, GmmPartitionData> dataset,
          Vector clusterProbs, Vector[] means)
focal_class.return: List<Matrix>
focal_class.signature: List<Matrix> computeCovariances(Dataset<EmptyContext, GmmPartitionData> dataset,
          Vector clusterProbs, Vector[] means)
focal_class.class_method_signature: CovarianceMatricesAggregator.add(Vector x, double pcxi)
focal_class.full_signature:  void add(Vector x, double pcxi)
focal_class.identifier: add
focal_class.parameters: (Vector x, double pcxi)
focal_class.return: void
focal_class.signature: void add(Vector x, double pcxi)
focal_class.class_method_signature: CovarianceMatricesAggregator.plus(CovarianceMatricesAggregator other)
focal_class.full_signature:  CovarianceMatricesAggregator plus(CovarianceMatricesAggregator other)
focal_class.identifier: plus
focal_class.parameters: (CovarianceMatricesAggregator other)
focal_class.return: CovarianceMatricesAggregator
focal_class.signature: CovarianceMatricesAggregator plus(CovarianceMatricesAggregator other)
focal_class.class_method_signature: CovarianceMatricesAggregator.map(GmmPartitionData data, Vector[] means)
focal_class.full_signature: static List<CovarianceMatricesAggregator> map(GmmPartitionData data, Vector[] means)
focal_class.identifier: map
focal_class.modifiers: static
focal_class.parameters: (GmmPartitionData data, Vector[] means)
focal_class.return: List<CovarianceMatricesAggregator>
focal_class.signature: List<CovarianceMatricesAggregator> map(GmmPartitionData data, Vector[] means)
focal_class.class_method_signature: CovarianceMatricesAggregator.covariance(double clusterProb)
focal_class.full_signature: private Matrix covariance(double clusterProb)
focal_class.identifier: covariance
focal_class.modifiers: private
focal_class.parameters: (double clusterProb)
focal_class.return: Matrix
focal_class.signature: Matrix covariance(double clusterProb)
focal_class.class_method_signature: CovarianceMatricesAggregator.reduce(List<CovarianceMatricesAggregator> l,
          List<CovarianceMatricesAggregator> r)
focal_class.full_signature: static List<CovarianceMatricesAggregator> reduce(List<CovarianceMatricesAggregator> l,
          List<CovarianceMatricesAggregator> r)
focal_class.identifier: reduce
focal_class.modifiers: static
focal_class.parameters: (List<CovarianceMatricesAggregator> l,
          List<CovarianceMatricesAggregator> r)
focal_class.return: List<CovarianceMatricesAggregator>
focal_class.signature: List<CovarianceMatricesAggregator> reduce(List<CovarianceMatricesAggregator> l,
          List<CovarianceMatricesAggregator> r)
focal_class.class_method_signature: CovarianceMatricesAggregator.mean()
focal_class.full_signature:  Vector mean()
focal_class.identifier: mean
focal_class.parameters: ()
focal_class.return: Vector
focal_class.signature: Vector mean()
focal_class.class_method_signature: CovarianceMatricesAggregator.weightedSum()
focal_class.full_signature:  Matrix weightedSum()
focal_class.identifier: weightedSum
focal_class.parameters: ()
focal_class.return: Matrix
focal_class.signature: Matrix weightedSum()
focal_class.class_method_signature: CovarianceMatricesAggregator.rowCount()
focal_class.full_signature: public int rowCount()
focal_class.identifier: rowCount
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int rowCount()
focal_method.body: void add(Vector x, double pcxi) {
          Matrix deltaCol = x.minus(mean).toMatrix(false);
          Matrix weightedCovComponent = deltaCol.times(deltaCol.transpose()).times(pcxi);
          if (weightedSum == null)
              weightedSum = weightedCovComponent;
          else
              weightedSum = weightedSum.plus(weightedCovComponent);
          rowCount += 1;
      }
focal_method.class_method_signature: CovarianceMatricesAggregator.add(Vector x, double pcxi)
focal_method.full_signature:  void add(Vector x, double pcxi)
focal_method.identifier: add
focal_method.invocations: toMatrix minus times times transpose plus
focal_method.parameters: (Vector x, double pcxi)
focal_method.return: void
focal_method.signature: void add(Vector x, double pcxi)