;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; LUSH Lisp Universal Shell
;;;   Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI.
;;; Includes parts of TL3:
;;;   Copyright (C) 1987-1999 Leon Bottou and Neuristique.
;;; Includes selected parts of SN3.2:
;;;   Copyright (C) 1991-2001 AT&T Corp.
;;;
;;; Includes information derived from the GSL (Gnu Scientific Library)
;;;   header files which are copyrighted and distributed under the GPL
;;;   by their respective authors.
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(libload "torch/torch-config")
(libload "torch/level4")



#? *** level5

;; dummy function that adds torch header files in C file
(eval `(de dummy_level5 () ,torch-cpheader-cmd ()))

#? * torch_kmeans
;;.TYPE CLASS
#? (==> <torch_kmeans> get_min_cluster)
#? (==> <torch_kmeans> set_min_cluster <s>)
#? (new torch_kmeans <flag> <n_inputs> <n_gaussians_>>
#? (==> <torch_kmeans> setdataset <data_>)
#? (==> <torch_kmeans> emiterinitialize)
#? (==> <torch_kmeans> frameemaccposteriors <s> <inputs> <log_posterior>)
#? (==> <torch_kmeans> emupdate)
#? (==> <torch_kmeans> emsequenceinitialize <inputs>)
#? (==> <torch_kmeans> framelogprobability <s> <inputs>)
#? (==> <torch_kmeans> framelogprobabilityonegaussian <g> <inputs>)
#? (==> <torch_kmeans> -destructor)

#? * torch_mapdiagonalgmm
;;.TYPE CLASS
#? (==> <torch_mapdiagonalgmm> get_prior_distribution)
#? (==> <torch_mapdiagonalgmm> set_prior_distribution <s>)
#? (==> <torch_mapdiagonalgmm> get_weight_on_prior)
#? (==> <torch_mapdiagonalgmm> set_weight_on_prior <s>)
#? (==> <torch_mapdiagonalgmm> get_learn_weights)
#? (==> <torch_mapdiagonalgmm> set_learn_weights <s>)
#? (==> <torch_mapdiagonalgmm> get_learn_variances)
#? (==> <torch_mapdiagonalgmm> set_learn_variances <s>)
#? (==> <torch_mapdiagonalgmm> get_learn_means)
#? (==> <torch_mapdiagonalgmm> set_learn_means <s>)
#? (new torch_mapdiagonalgmm <flag> <prior_distribution_>>
#? (==> <torch_mapdiagonalgmm> frameviterbiaccposteriors <s> <inputs> <log_posterior>)
#? (==> <torch_mapdiagonalgmm> frameemaccposteriors <s> <inputs> <log_posterior>)
#? (==> <torch_mapdiagonalgmm> emupdate)
#? (==> <torch_mapdiagonalgmm> setdataset <data_>)
#? (==> <torch_mapdiagonalgmm> -destructor)

#? * torch_maphmm
;;.TYPE CLASS
#? (==> <torch_maphmm> get_prior_distribution)
#? (==> <torch_maphmm> set_prior_distribution <s>)
#? (==> <torch_maphmm> get_weight_on_prior)
#? (==> <torch_maphmm> set_weight_on_prior <s>)
#? (==> <torch_maphmm> get_log_weight_on_prior)
#? (==> <torch_maphmm> set_log_weight_on_prior <s>)
#? (==> <torch_maphmm> get_log_1_weight_on_prior)
#? (==> <torch_maphmm> set_log_1_weight_on_prior <s>)
#? (new torch_maphmm <flag> <n_states_> <states_> <transitions_> <prior_distribution_>>
#? (==> <torch_maphmm> setweightonprior <weight_on_prior_>)
#? (==> <torch_maphmm> emupdate)
#? (==> <torch_maphmm> -destructor)

#? * torch_speechhmm
;;.TYPE CLASS
#? (==> <torch_speechhmm> get_n_models)
#? (==> <torch_speechhmm> set_n_models <s>)
#? (==> <torch_speechhmm> get_models)
#? (==> <torch_speechhmm> set_models <s>)
#? (==> <torch_speechhmm> get_data)
#? (==> <torch_speechhmm> set_data <s>)
#? (==> <torch_speechhmm> get_initial_models_trainer_measurers)
#? (==> <torch_speechhmm> set_initial_models_trainer_measurers <s>)
#? (==> <torch_speechhmm> get_model_trainer)
#? (==> <torch_speechhmm> set_model_trainer <s>)
#? (==> <torch_speechhmm> get_dict)
#? (==> <torch_speechhmm> set_dict <s>)
#? (==> <torch_speechhmm> get_word_transitions)
#? (==> <torch_speechhmm> set_word_transitions <s>)
#? (==> <torch_speechhmm> get_max_n_states)
#? (==> <torch_speechhmm> set_max_n_states <s>)
#? (==> <torch_speechhmm> get_states_to_model_states)
#? (==> <torch_speechhmm> set_states_to_model_states <s>)
#? (==> <torch_speechhmm> get_states_to_model)
#? (==> <torch_speechhmm> set_states_to_model <s>)
#? (==> <torch_speechhmm> get_states_to_word)
#? (==> <torch_speechhmm> set_states_to_word <s>)
#? (new torch_speechhmm <flag> <n_models_> <models_> <model_names_> <dict_> <model_trainer_>>
#? (==> <torch_speechhmm> setdataset <data_>)
#? (==> <torch_speechhmm> splitdataset <data_> <split_data_>)
#? (==> <torch_speechhmm> loadxfile <file>)
#? (==> <torch_speechhmm> savexfile <file>)
#? (==> <torch_speechhmm> iterinitialize)
#? (==> <torch_speechhmm> emiterinitialize)
#? (==> <torch_speechhmm> emsequenceinitialize <inputs>)
#? (==> <torch_speechhmm> sequenceinitialize <inputs>)
#? (==> <torch_speechhmm> emaccposteriors <inputs> <log_posterior>)
#? (==> <torch_speechhmm> viterbiaccposteriors <inputs> <log_posterior>)
#? (==> <torch_speechhmm> emupdate)
#? (==> <torch_speechhmm> logviterbi <inputs>)
#? (==> <torch_speechhmm> preparetrainmodel <input>)
#? (==> <torch_speechhmm> addwordtomodel <word> <current_state>)
#? (==> <torch_speechhmm> setmaxnstates <max_n_states_>)
#? (==> <torch_speechhmm> addconnectionsbetweenwordstomodel <word> <next_word> <current_state> <next_current_state> <log_n_next>)
#? (==> <torch_speechhmm> nstatesinword <word>)
#? (==> <torch_speechhmm> nstatesinwordpronunciation <word> <pronun>)
#? (==> <torch_speechhmm> backward <inputs> <alpha>)
#? (==> <torch_speechhmm> -destructor)

#? * (dummy_level5)

;; ********************************************************


;;class KMeans : public DiagonalGMM
(defclass  torch_KMeans   torch_DiagonalGMM)

(defmethod  torch_KMeans  get_min_cluster ()
  
  (gptr #{ ((Torch::KMeans *)$p)->min_cluster   #} ))        ;; Sequence*  -> gptr

(defmethod  torch_KMeans  set_min_cluster (s )
  
  ((-gptr- "Torch::Sequence*") s)  
  #{ ((Torch::KMeans *)$p)->min_cluster = $s  ; #} 
  ())

(defmethod  torch_KMeans  torch_KMeans ( flag n_inputs  n_gaussians_ )
  ((-bool-) flag)
  
  ((-int-) n_inputs)  
  ((-int-) n_gaussians_)  
  #{ if($flag == false) {
            $shell_flag = false;
            $p = new Torch::KMeans($n_inputs  ,$n_gaussians_); 
     }
     else
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_KMeans  setDataSet (data_ )
  
  ((-gptr- "Torch::DataSet*") data_)  
  #{ ((Torch::KMeans *)$p)->setDataSet($data_)  ; #} 
  ())

(defmethod  torch_KMeans  eMIterInitialize ()
  
  #{ ((Torch::KMeans *)$p)->eMIterInitialize()  ; #} 
  ())

(defmethod  torch_KMeans  frameEMAccPosteriors (s  inputs  log_posterior )
  
  ((-int-) s)  
  ((-gptr- "double *") inputs)  
  ((-double-) log_posterior)  
  #{ ((Torch::KMeans *)$p)->frameEMAccPosteriors($s  ,$inputs  ,$log_posterior)  ; #} 
  ())

(defmethod  torch_KMeans  eMUpdate ()
  
  #{ ((Torch::KMeans *)$p)->eMUpdate()  ; #} 
  ())

(defmethod  torch_KMeans  eMSequenceInitialize (inputs )
  
  ((-gptr- "Torch::Sequence*") inputs)  
  #{ ((Torch::KMeans *)$p)->eMSequenceInitialize($inputs)  ; #} 
  ())

(defmethod  torch_KMeans  frameLogProbability (s  inputs )
  
  ((-int-) s)  
  ((-gptr- "double *") inputs)  
  (double #{ ((Torch::KMeans *)$p)->frameLogProbability($s  ,$inputs)  #} ))

(defmethod  torch_KMeans  frameLogProbabilityOneGaussian (g  inputs )
  
  ((-int-) g)  
  ((-gptr- "double *") inputs)  
  (double #{ ((Torch::KMeans *)$p)->frameLogProbabilityOneGaussian($g  ,$inputs)  #} ))

(defmethod  torch_KMeans  -destructor  ()
  
  #{ if ( $shell_flag == false )  {
             delete  ((Torch::KMeans *)$p);
             $p = NULL;
             $shell_flag = true; 
     }
  #} 
  ())




;;class MAPDiagonalGMM : public DiagonalGMM
(defclass  torch_MAPDiagonalGMM   torch_DiagonalGMM)

(defmethod  torch_MAPDiagonalGMM  get_prior_distribution ()
  
  (gptr #{ ((Torch::MAPDiagonalGMM *)$p)->prior_distribution   #} ))        ;; DiagonalGMM*  -> gptr

(defmethod  torch_MAPDiagonalGMM  set_prior_distribution (s )
  
  ((-gptr- "Torch::DiagonalGMM*") s)  
  #{ ((Torch::MAPDiagonalGMM *)$p)->prior_distribution = $s  ; #} 
  ())

(defmethod  torch_MAPDiagonalGMM  get_weight_on_prior ()
  
  (double #{ ((Torch::MAPDiagonalGMM *)$p)->weight_on_prior   #} ))

(defmethod  torch_MAPDiagonalGMM  set_weight_on_prior (s )
  
  ((-double-) s)  
  #{ ((Torch::MAPDiagonalGMM *)$p)->weight_on_prior = $s  ; #} 
  ())

(defmethod  torch_MAPDiagonalGMM  get_learn_weights ()
  
  (bool #{ ((Torch::MAPDiagonalGMM *)$p)->learn_weights   #} ))

(defmethod  torch_MAPDiagonalGMM  set_learn_weights (s )
  
  ((-bool-) s)  
  #{ ((Torch::MAPDiagonalGMM *)$p)->learn_weights = $s  ; #} 
  ())

(defmethod  torch_MAPDiagonalGMM  get_learn_variances ()
  
  (bool #{ ((Torch::MAPDiagonalGMM *)$p)->learn_variances   #} ))

(defmethod  torch_MAPDiagonalGMM  set_learn_variances (s )
  
  ((-bool-) s)  
  #{ ((Torch::MAPDiagonalGMM *)$p)->learn_variances = $s  ; #} 
  ())

(defmethod  torch_MAPDiagonalGMM  get_learn_means ()
  
  (bool #{ ((Torch::MAPDiagonalGMM *)$p)->learn_means   #} ))

(defmethod  torch_MAPDiagonalGMM  set_learn_means (s )
  
  ((-bool-) s)  
  #{ ((Torch::MAPDiagonalGMM *)$p)->learn_means = $s  ; #} 
  ())

(defmethod  torch_MAPDiagonalGMM  torch_MAPDiagonalGMM ( flag prior_distribution_ )
  ((-bool-) flag)
  
  ((-gptr- "Torch::DiagonalGMM*") prior_distribution_)  
  #{ if($flag == false) {
            $shell_flag = false;
            $p = new Torch::MAPDiagonalGMM($prior_distribution_); 
     }
     else
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_MAPDiagonalGMM  frameViterbiAccPosteriors (s  inputs  log_posterior )
  
  ((-int-) s)  
  ((-gptr- "double *") inputs)  
  ((-double-) log_posterior)  
  #{ ((Torch::MAPDiagonalGMM *)$p)->frameViterbiAccPosteriors($s  ,$inputs  ,$log_posterior)  ; #} 
  ())

(defmethod  torch_MAPDiagonalGMM  frameEMAccPosteriors (s  inputs  log_posterior )
  
  ((-int-) s)  
  ((-gptr- "double *") inputs)  
  ((-double-) log_posterior)  
  #{ ((Torch::MAPDiagonalGMM *)$p)->frameEMAccPosteriors($s  ,$inputs  ,$log_posterior)  ; #} 
  ())

(defmethod  torch_MAPDiagonalGMM  eMUpdate ()
  
  #{ ((Torch::MAPDiagonalGMM *)$p)->eMUpdate()  ; #} 
  ())

(defmethod  torch_MAPDiagonalGMM  setDataSet (data_ )
  
  ((-gptr- "Torch::DataSet*") data_)  
  #{ ((Torch::MAPDiagonalGMM *)$p)->setDataSet($data_)  ; #} 
  ())

(defmethod  torch_MAPDiagonalGMM  -destructor  ()
  
  #{ if ( $shell_flag == false )  {
             delete  ((Torch::MAPDiagonalGMM *)$p);
             $p = NULL;
             $shell_flag = true; 
     }
  #} 
  ())





;;class MAPHMM : public HMM
(defclass  torch_MAPHMM   torch_HMM)

(defmethod  torch_MAPHMM  get_prior_distribution ()
  
  (gptr #{ ((Torch::MAPHMM *)$p)->prior_distribution   #} ))        ;; HMM*  -> gptr

(defmethod  torch_MAPHMM  set_prior_distribution (s )
  
  ((-gptr- "Torch::HMM*") s)  
  #{ ((Torch::MAPHMM *)$p)->prior_distribution = $s  ; #} 
  ())

(defmethod  torch_MAPHMM  get_weight_on_prior ()
  
  (double #{ ((Torch::MAPHMM *)$p)->weight_on_prior   #} ))

(defmethod  torch_MAPHMM  set_weight_on_prior (s )
  
  ((-double-) s)  
  #{ ((Torch::MAPHMM *)$p)->weight_on_prior = $s  ; #} 
  ())

(defmethod  torch_MAPHMM  get_log_weight_on_prior ()
  
  (double #{ ((Torch::MAPHMM *)$p)->log_weight_on_prior   #} ))

(defmethod  torch_MAPHMM  set_log_weight_on_prior (s )
  
  ((-double-) s)  
  #{ ((Torch::MAPHMM *)$p)->log_weight_on_prior = $s  ; #} 
  ())

(defmethod  torch_MAPHMM  get_log_1_weight_on_prior ()
  
  (double #{ ((Torch::MAPHMM *)$p)->log_1_weight_on_prior   #} ))

(defmethod  torch_MAPHMM  set_log_1_weight_on_prior (s )
  
  ((-double-) s)  
  #{ ((Torch::MAPHMM *)$p)->log_1_weight_on_prior = $s  ; #} 
  ())

(defmethod  torch_MAPHMM  torch_MAPHMM ( flag n_states_  states_  transitions_  prior_distribution_ )
  ((-bool-) flag)
  
  ((-int-) n_states_)  
  ((-gptr- "Torch::Distribution **") states_)  
  ((-gptr- "double **") transitions_)  
  ((-gptr- "Torch::HMM*") prior_distribution_)  
  #{ if($flag == false) {
            $shell_flag = false;
            $p = new Torch::MAPHMM($n_states_  ,$states_  ,$transitions_  ,$prior_distribution_); 
     }
     else
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_MAPHMM  setWeightOnPrior (weight_on_prior_ )
  
  ((-double-) weight_on_prior_)  
  #{ ((Torch::MAPHMM *)$p)->setWeightOnPrior($weight_on_prior_)  ; #} 
  ())

(defmethod  torch_MAPHMM  eMUpdate ()
  
  #{ ((Torch::MAPHMM *)$p)->eMUpdate()  ; #} 
  ())

(defmethod  torch_MAPHMM  -destructor  ()
  
  #{ if ( $shell_flag == false )  {
             delete  ((Torch::MAPHMM *)$p);
             $p = NULL;
             $shell_flag = true; 
     }
  #} 
  ())





;;class SpeechHMM : public HMM
(defclass  torch_SpeechHMM   torch_HMM)

(defmethod  torch_SpeechHMM  get_n_models ()
  
  (int #{ ((Torch::SpeechHMM *)$p)->n_models   #} ))

(defmethod  torch_SpeechHMM  set_n_models (s )
  
  ((-int-) s)  
  #{ ((Torch::SpeechHMM *)$p)->n_models = $s  ; #} 
  ())

(defmethod  torch_SpeechHMM  get_models ()
  
  (gptr #{ ((Torch::SpeechHMM *)$p)->models   #} ))        ;; HMM**  -> gptr

(defmethod  torch_SpeechHMM  set_models (s )
  
  ((-gptr- "Torch::HMM**") s)  
  #{ ((Torch::SpeechHMM *)$p)->models = $s  ; #} 
  ())

(defmethod  torch_SpeechHMM  get_data ()
  
  (gptr #{ ((Torch::SpeechHMM *)$p)->data   #} ))        ;; DataSet*  -> gptr

(defmethod  torch_SpeechHMM  set_data (s )
  
  ((-gptr- "Torch::DataSet*") s)  
  #{ ((Torch::SpeechHMM *)$p)->data = $s  ; #} 
  ())

(defmethod  torch_SpeechHMM  get_initial_models_trainer_measurers ()
  
  (gptr #{ ((Torch::SpeechHMM *)$p)->initial_models_trainer_measurers   #} ))        ;; MeasurerList*  -> gptr

(defmethod  torch_SpeechHMM  set_initial_models_trainer_measurers (s )
  
  ((-gptr- "Torch::MeasurerList*") s)  
  #{ ((Torch::SpeechHMM *)$p)->initial_models_trainer_measurers = $s  ; #} 
  ())

(defmethod  torch_SpeechHMM  get_model_trainer ()
  
  (gptr #{ ((Torch::SpeechHMM *)$p)->model_trainer   #} ))        ;; EMTrainer**  -> gptr

(defmethod  torch_SpeechHMM  set_model_trainer (s )
  
  ((-gptr- "Torch::EMTrainer**") s)  
  #{ ((Torch::SpeechHMM *)$p)->model_trainer = $s  ; #} 
  ())

(defmethod  torch_SpeechHMM  get_lexicon ()
  
  (gptr #{ ((Torch::SpeechHMM *)$p)->lexicon   #} ))        

(defmethod  torch_SpeechHMM  set_lexicon (s )
  
  ((-gptr- "Torch::LexiconInfo *") s)  
  #{ ((Torch::SpeechHMM *)$p)->lexicon = $s  ; #} 
  ())


(defmethod  torch_SpeechHMM  get_word_transitions ()
  
  (gptr #{ ((Torch::SpeechHMM *)$p)->word_transitions   #} ))        ;; bool **  -> gptr

(defmethod  torch_SpeechHMM  set_word_transitions (s )
  
  ((-gptr- "bool **") s)  
  #{ ((Torch::SpeechHMM *)$p)->word_transitions = $s  ; #} 
  ())

(defmethod  torch_SpeechHMM  get_max_n_states ()
  
  (int #{ ((Torch::SpeechHMM *)$p)->max_n_states   #} ))

(defmethod  torch_SpeechHMM  set_max_n_states (s )
  
  ((-int-) s)  
  #{ ((Torch::SpeechHMM *)$p)->max_n_states = $s  ; #} 
  ())

(defmethod  torch_SpeechHMM  get_states_to_model_states ()
  
  (gptr #{ ((Torch::SpeechHMM *)$p)->states_to_model_states   #} ))        ;; int*  -> gptr

(defmethod  torch_SpeechHMM  set_states_to_model_states (s )
  
  ((-gptr- "int*") s)  
  #{ ((Torch::SpeechHMM *)$p)->states_to_model_states = $s  ; #} 
  ())

(defmethod  torch_SpeechHMM  get_states_to_model ()
  
  (gptr #{ ((Torch::SpeechHMM *)$p)->states_to_model   #} ))        ;; int*  -> gptr

(defmethod  torch_SpeechHMM  set_states_to_model (s )
  
  ((-gptr- "int*") s)  
  #{ ((Torch::SpeechHMM *)$p)->states_to_model = $s  ; #} 
  ())

(defmethod  torch_SpeechHMM  get_states_to_word ()
  
  (gptr #{ ((Torch::SpeechHMM *)$p)->states_to_word   #} ))        ;; int*  -> gptr

(defmethod  torch_SpeechHMM  set_states_to_word (s )
  
  ((-gptr- "int*") s)  
  #{ ((Torch::SpeechHMM *)$p)->states_to_word = $s  ; #} 
  ())

(defmethod  torch_SpeechHMM  torch_SpeechHMM ( flag n_models_  models_  lex_  model_trainer_ )
  ((-bool-) flag)
  
  ((-int-) n_models_)  
  ((-gptr- "Torch::HMM **") models_)  
  ((-gptr- "Torch::LexiconInfo*") lex_)  
  ((-gptr- "Torch::EMTrainer**") model_trainer_)  
  #{ if($flag == false) {
            $shell_flag = false;
            $p = new Torch::SpeechHMM($n_models_  ,$models_  ,$lex_  ,$model_trainer_); 
     }
     else
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_SpeechHMM  setDataSet (data_ )
  
  ((-gptr- "Torch::DataSet*") data_)  
  #{ ((Torch::SpeechHMM *)$p)->setDataSet($data_)  ; #} 
  ())

(defmethod  torch_SpeechHMM  splitDataSet (data_  split_data_ )
  
  ((-gptr- "Torch::DataSet*") data_)  
  ((-gptr- "Torch::ExampleFrameSelectorDataSet**") split_data_)  
  #{ ((Torch::SpeechHMM *)$p)->splitDataSet($data_  ,$split_data_)  ; #} 
  ())

(defmethod  torch_SpeechHMM  loadXFile (file )
  
  ((-gptr- "Torch::XFile *") file)  
  #{ ((Torch::SpeechHMM *)$p)->loadXFile($file)  ; #} 
  ())

(defmethod  torch_SpeechHMM  saveXFile (file )
  
  ((-gptr- "Torch::XFile *") file)  
  #{ ((Torch::SpeechHMM *)$p)->saveXFile($file)  ; #} 
  ())

(defmethod  torch_SpeechHMM  iterInitialize ()
  
  #{ ((Torch::SpeechHMM *)$p)->iterInitialize()  ; #} 
  ())

(defmethod  torch_SpeechHMM  eMIterInitialize ()
  
  #{ ((Torch::SpeechHMM *)$p)->eMIterInitialize()  ; #} 
  ())

(defmethod  torch_SpeechHMM  eMSequenceInitialize (inputs )
  
  ((-gptr- "Torch::Sequence*") inputs)  
  #{ ((Torch::SpeechHMM *)$p)->eMSequenceInitialize($inputs)  ; #} 
  ())

(defmethod  torch_SpeechHMM  sequenceInitialize (inputs )
  
  ((-gptr- "Torch::Sequence*") inputs)  
  #{ ((Torch::SpeechHMM *)$p)->sequenceInitialize($inputs)  ; #} 
  ())

(defmethod  torch_SpeechHMM  eMAccPosteriors (inputs  log_posterior )
  
  ((-gptr- "Torch::Sequence *") inputs)  
  ((-double-) log_posterior)  
  #{ ((Torch::SpeechHMM *)$p)->eMAccPosteriors($inputs  ,$log_posterior)  ; #} 
  ())

(defmethod  torch_SpeechHMM  viterbiAccPosteriors (inputs  log_posterior )
  
  ((-gptr- "Torch::Sequence *") inputs)  
  ((-double-) log_posterior)  
  #{ ((Torch::SpeechHMM *)$p)->viterbiAccPosteriors($inputs  ,$log_posterior)  ; #} 
  ())

(defmethod  torch_SpeechHMM  eMUpdate ()
  
  #{ ((Torch::SpeechHMM *)$p)->eMUpdate()  ; #} 
  ())

(defmethod  torch_SpeechHMM  logViterbi (inputs )
  
  ((-gptr- "Torch::Sequence*") inputs)  
  #{ ((Torch::SpeechHMM *)$p)->logViterbi($inputs)  ; #} 
  ())

(defmethod  torch_SpeechHMM  prepareTrainModel (input )
  
  ((-gptr- "Torch::Sequence*") input)  
  #{ ((Torch::SpeechHMM *)$p)->prepareTrainModel($input)  ; #} 
  ())

(defmethod  torch_SpeechHMM  addWordToModel (word  current_state )
  
  ((-int-) word)  
  ((-int-) current_state)  
  (int #{ ((Torch::SpeechHMM *)$p)->addWordToModel($word  ,$current_state)  #} ))

(defmethod  torch_SpeechHMM  setMaxNStates (max_n_states_ )
  
  ((-int-) max_n_states_)  
  #{ ((Torch::SpeechHMM *)$p)->setMaxNStates($max_n_states_);  #} 
  ())

(defmethod  torch_SpeechHMM  addConnectionsBetweenWordsToModel (word  next_word  current_state  next_current_state  log_n_next )
  
  ((-int-) word)  
  ((-int-) next_word)  
  ((-int-) current_state)  
  ((-int-) next_current_state)  
  ((-double-) log_n_next)  
  #{ ((Torch::SpeechHMM *)$p)->addConnectionsBetweenWordsToModel($word  ,$next_word  ,$current_state  ,$next_current_state  ,$log_n_next)  ; #} 
  ())

(defmethod  torch_SpeechHMM  nStatesInWord (word )
  
  ((-int-) word)  
  (int #{ ((Torch::SpeechHMM *)$p)->nStatesInWord($word)  #} ))

(defmethod  torch_SpeechHMM  nStatesInWordPronunciation (word  pronun )
  
  ((-int-) word)  
  ((-int-) pronun)  
  (int #{ ((Torch::SpeechHMM *)$p)->nStatesInWordPronunciation($word  ,$pronun)  #} ))

(defmethod  torch_SpeechHMM  backward (inputs  alpha )
  
  ((-gptr- "Torch::Sequence *") inputs)  
  ((-gptr- "Torch::Sequence *") alpha)  
  #{ ((Torch::SpeechHMM *)$p)->backward($inputs  ,$alpha)  ; #} 
  ())

(defmethod  torch_SpeechHMM  -destructor  ()
  
  #{ if ( $shell_flag == false )  {
             delete  ((Torch::SpeechHMM *)$p);
             $p = NULL;
             $shell_flag = true; 
     }
  #} 
  ())



;; ********************************************************

(dhc-make-with-c++ () (list torch-libtorch) 
  dummy_level5
  (torch_kmeans  -destructor  framelogprobabilityonegaussian  framelogprobability  emsequenceinitialize  emupdate  frameemaccposteriors  emiterinitialize  setdataset  torch_kmeans  set_min_cluster  get_min_cluster)
  (torch_mapdiagonalgmm  -destructor  setdataset  emupdate  frameemaccposteriors  frameviterbiaccposteriors  torch_mapdiagonalgmm  set_learn_means  get_learn_means  set_learn_variances  get_learn_variances  set_learn_weights  get_learn_weights  set_weight_on_prior  get_weight_on_prior  set_prior_distribution  get_prior_distribution)
  (torch_maphmm  -destructor  emupdate  setweightonprior  torch_maphmm  set_log_1_weight_on_prior  get_log_1_weight_on_prior  set_log_weight_on_prior  get_log_weight_on_prior  set_weight_on_prior  get_weight_on_prior  set_prior_distribution  get_prior_distribution)
  (torch_speechhmm  -destructor  backward  nstatesinwordpronunciation  nstatesinword  addconnectionsbetweenwordstomodel  setmaxnstates  addwordtomodel  preparetrainmodel  logviterbi  emupdate  viterbiaccposteriors  emaccposteriors  sequenceinitialize  emsequenceinitialize  emiterinitialize  iterinitialize  savexfile  loadxfile  splitdataset  setdataset  torch_speechhmm  set_states_to_word  get_states_to_word  set_states_to_model  get_states_to_model  set_states_to_model_states  get_states_to_model_states  set_max_n_states  get_max_n_states  set_word_transitions  get_word_transitions  set_lexicon  get_lexicon  set_model_trainer  get_model_trainer   set_initial_models_trainer_measurers  get_initial_models_trainer_measurers  set_data  get_data  set_models  get_models  set_n_models  get_n_models)
)
