public SpeakerCluster(Segment s, Array2DRowRealMatrix featureMatrix, double bicValue) { _segmentSet = new SortedSet <Segment>(); this.FeatureMatrix = new Array2DRowRealMatrix(featureMatrix.getData()); this._bicValue = bicValue; AddSegment(s); }
public SpeakerCluster(Segment s, Array2DRowRealMatrix featureMatrix, double bicValue) { this.segmentSet = new TreeSet(); this.featureMatrix = new Array2DRowRealMatrix(featureMatrix.getData()); this.bicValue = bicValue; this.addSegment(s); }
public void MergeWith(SpeakerCluster target) { if (target == null) { throw new NullReferenceException(); } var it = target._segmentSet.GetEnumerator(); while (it.MoveNext()) { if (!AddSegment(it.Current)) { Console.WriteLine("Something doesn't work in mergeWith method, Cluster class"); } } int rowDim = FeatureMatrix.getRowDimension() + target.FeatureMatrix.getRowDimension(); int colDim = FeatureMatrix.getColumnDimension(); var combinedFeatures = new Array2DRowRealMatrix(rowDim, colDim); combinedFeatures.setSubMatrix(FeatureMatrix.getData(), 0, 0); combinedFeatures .setSubMatrix(target.FeatureMatrix.getData(), FeatureMatrix.getRowDimension(), 0); _bicValue = SpeakerIdentification.GetBICValue(combinedFeatures); FeatureMatrix = new Array2DRowRealMatrix(combinedFeatures.getData()); }
public virtual void mergeWith(SpeakerCluster target) { if (target == null) { throw new NullPointerException(); } Iterator iterator = target.segmentSet.iterator(); while (iterator.hasNext()) { if (!this.addSegment((Segment)iterator.next()).booleanValue()) { [email protected]("Something doesn't work in mergeWith method, Cluster class"); } } int rowDimension = this.featureMatrix.getRowDimension() + target.getFeatureMatrix().getRowDimension(); int columnDimension = this.featureMatrix.getColumnDimension(); Array2DRowRealMatrix array2DRowRealMatrix = new Array2DRowRealMatrix(rowDimension, columnDimension); array2DRowRealMatrix.setSubMatrix(this.featureMatrix.getData(), 0, 0); array2DRowRealMatrix.setSubMatrix(target.getFeatureMatrix().getData(), this.featureMatrix.getRowDimension(), 0); this.bicValue = SpeakerIdentification.getBICValue(array2DRowRealMatrix); this.featureMatrix = new Array2DRowRealMatrix(array2DRowRealMatrix.getData()); }