public string GetPhrase(int phraseIndex) { XmmInterface.setCurrentSetInstance(thisIndex); IntPtr phraseIntPtr = XmmInterface.getPhrase(phraseIndex); return(Marshal.PtrToStringAnsi(phraseIntPtr)); }
public float[] getRegression() { int nModels = XmmInterface.getNbOfModels(); float[] outputValues = new float[nModels]; IntPtr intPtrOutputValues = XmmInterface.getLikelihoods(); Marshal.Copy(intPtrOutputValues, outputValues, 0, nModels); return(outputValues); }
public float[] getTimeProgressions() { int nModels = XmmInterface.getNbOfModels(); float[] timeProgressions = new float[nModels]; IntPtr intPtrTimeProgressions = XmmInterface.getTimeProgressions(); Marshal.Copy(intPtrTimeProgressions, timeProgressions, 0, nModels); return(timeProgressions); }
public float[] getLikelihoods() { int nModels = XmmInterface.getNbOfModels(); float[] likelihoods = new float[nModels]; IntPtr intPtrLikelihoods = XmmInterface.getLikelihoods(); Marshal.Copy(intPtrLikelihoods, likelihoods, 0, nModels); return(likelihoods); }
public void filter(float[] observation) { IntPtr intPtrFArray = Marshal.AllocHGlobal(observation.Length * sizeof(float)); Marshal.Copy(observation, 0, intPtrFArray, observation.Length); XmmInterface.filter(intPtrFArray, observation.Length); Marshal.FreeHGlobal(intPtrFArray); }
public float[] GetTimeProgressions() { XmmInterface.setCurrentModelInstance(thisIndex); int nModels = XmmInterface.getNbOfModels(); float[] timeProgressions = new float[nModels]; IntPtr intPtrTimeProgressions = XmmInterface.getTimeProgressions(); Marshal.Copy(intPtrTimeProgressions, timeProgressions, 0, nModels); return(timeProgressions); }
//==========================================================================// //================= Wrapper methods for the native plugin ==================// //==========================================================================// public void addPhraseFromData(string label, string[] colNames, float[] phrase, int dimIn, int dimOut) { IntPtr unmanagedFArray = Marshal.AllocHGlobal(phrase.Length * sizeof(float)); Marshal.Copy(phrase, 0, unmanagedFArray, phrase.Length); XmmInterface.addPhraseFromData(label, colNames, unmanagedFArray, dimIn, dimOut, phrase.Length / (dimIn + dimOut)); Marshal.FreeHGlobal(unmanagedFArray); }
public float[] GetRegression() { XmmInterface.setCurrentModelInstance(thisIndex); int nModels = XmmInterface.getNbOfModels(); float[] outputValues = new float[nModels]; IntPtr intPtrOutputValues = XmmInterface.getLikelihoods(); Marshal.Copy(intPtrOutputValues, outputValues, 0, nModels); return(outputValues); }
public float[] GetLikelihoods() { XmmInterface.setCurrentModelInstance(thisIndex); int nModels = XmmInterface.getNbOfModels(); float[] likelihoods = new float[nModels]; IntPtr intPtrLikelihoods = XmmInterface.getLikelihoods(); Marshal.Copy(intPtrLikelihoods, likelihoods, 0, nModels); return(likelihoods); }
public void Filter(float[] observation) { XmmInterface.setCurrentModelInstance(thisIndex); IntPtr intPtrFArray = Marshal.AllocHGlobal(observation.Length * sizeof(float)); Marshal.Copy(observation, 0, intPtrFArray, observation.Length); XmmInterface.filter(intPtrFArray, observation.Length); Marshal.FreeHGlobal(intPtrFArray); }
public string[] getTrainingSetLabels() { int nLabels = XmmInterface.getTrainingSetNbOfLabels(); string[] labels = new string[nLabels]; IntPtr stringArrayIntPtr = XmmInterface.getTrainingSetLabels(); for (int i = 0; i < nLabels; i++) { IntPtr currentIntPtr = Marshal.ReadIntPtr(stringArrayIntPtr, i * IntPtr.Size); labels[i] = Marshal.PtrToStringAnsi(currentIntPtr); } return(labels); }
public string[] GetLabels() { XmmInterface.setCurrentModelInstance(thisIndex); int nLabels = XmmInterface.getNbOfModels(); string[] labels = new string[nLabels]; IntPtr stringArrayIntPtr = XmmInterface.getModelLabels(); for (int i = 0; i < nLabels; i++) { IntPtr currentIntPtr = Marshal.ReadIntPtr(stringArrayIntPtr, i * IntPtr.Size); labels[i] = Marshal.PtrToStringAnsi(currentIntPtr); } return(labels); }
public void Clear() { XmmInterface.setCurrentModelInstance(thisIndex); XmmInterface.clearModel(); }
//==========================================================================// public int GetLikelihoodWindow() { XmmInterface.setCurrentModelInstance(thisIndex); return(XmmInterface.getLikelihoodWindow()); }
public void SetLikelihoodWindow(int window) { XmmInterface.setCurrentModelInstance(thisIndex); XmmInterface.setLikelihoodWindow(window); }
public void SetTransitionMode(int transitionMode) { XmmInterface.setCurrentModelInstance(thisIndex); XmmInterface.setTransitionMode(transitionMode); }
public void SetRegressionEstimator(int regressionEstimator) { XmmInterface.setCurrentModelInstance(thisIndex); XmmInterface.setRegressionEstimator(regressionEstimator); }
public int GetStates() { XmmInterface.setCurrentModelInstance(thisIndex); return(XmmInterface.getStates()); }
public bool GetHierarchical() { XmmInterface.setCurrentModelInstance(thisIndex); return(XmmInterface.getHierarchical() != 0); }
public string GetFilteringResults() { XmmInterface.setCurrentModelInstance(thisIndex); return(Marshal.PtrToStringAnsi(XmmInterface.getFilteringResults())); }
public int GetTransitionMode() { XmmInterface.setCurrentModelInstance(thisIndex); return(XmmInterface.getTransitionMode()); }
public void SetRelativeRegularization(float relReg) { XmmInterface.setCurrentModelInstance(thisIndex); XmmInterface.setRelativeRegularization(relReg); }
//==========================================================================// public void SetGaussians(int gaussians) { XmmInterface.setCurrentModelInstance(thisIndex); XmmInterface.setGaussians(gaussians); }
public int GetRegressionEstimator() { XmmInterface.setCurrentModelInstance(thisIndex); return(XmmInterface.getRegressionEstimator()); }
public string GetLikeliest() { XmmInterface.setCurrentModelInstance(thisIndex); return(Marshal.PtrToStringAnsi(XmmInterface.getLikeliest())); }
public void SetHierarchical(bool hierarchical) { XmmInterface.setCurrentModelInstance(thisIndex); XmmInterface.setHierarchical(hierarchical ? 1 : 0); }
public void SetAbsoluteRegularization(float absReg) { XmmInterface.setCurrentModelInstance(thisIndex); XmmInterface.setAbsoluteRegularization(absReg); }
public void SetStates(int states) { XmmInterface.setCurrentModelInstance(thisIndex); XmmInterface.setStates(states); }
public void Reset() { XmmInterface.setCurrentModelInstance(thisIndex); XmmInterface.reset(); }
public void SetCovarianceMode(int covarianceMode) { XmmInterface.setCurrentModelInstance(thisIndex); XmmInterface.setCovarianceMode(covarianceMode); }