예제 #1
0
		/// <summary>
		/// Reads the xml representation of an object form the xml input stream.<br>
		/// </summary>
		/// <param name="parser">XMLStreamReader the xml input stream</param>
		/// <example>
		/// mandelEllis.ReadXML(new XmlTextReader("mandelellis.xml"));
		/// </example>
		public void ReadXML(XmlTextReader xmlTextReader)
		{
			XDocument xdoc = XDocument.Load(xmlTextReader);
			
			XElement feature = xdoc.Element("feature");
			if (feature == null) {
				throw new MissingFieldException("Could not find feature section - no GmmMe Loaded!");
			}
			
			Matrix mean = new Matrix(0,0);
			mean.ReadXML(xdoc, "mean");

			Matrix covarMatrix = new Matrix(0,0);
			covarMatrix.ReadXML(xdoc, "cov");

			Matrix covarMatrixInv = new Matrix(0,0);
			covarMatrixInv.ReadXML(xdoc, "icov");
			
			this.gmmMe = new GmmMe(mean, covarMatrix, covarMatrixInv);
			xmlTextReader.Close();
		}