;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; 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/level0")


#? *** level1

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

#? * torch_classformat
;;.TYPE CLASS
#? (==> <torch_classformat> get_n_classes)
#? (==> <torch_classformat> set_n_classes <s>)
#? (==> <torch_classformat> get_class_labels)
#? (==> <torch_classformat> set_class_labels <s>)
#? (new torch_classformat <flag>>
#? (==> <torch_classformat> -destructor)

#? * torch_cmdline
;;.TYPE CLASS
#? (==> <torch_cmdline> get_n_master_switches)
#? (==> <torch_cmdline> set_n_master_switches <s>)
#? (==> <torch_cmdline> get_n_cmd_options)
#? (==> <torch_cmdline> set_n_cmd_options <s>)
#? (==> <torch_cmdline> get_n_cmd_params)
#? (==> <torch_cmdline> set_n_cmd_params <s>)
#? (==> <torch_cmdline> get_cmd_options)
#? (==> <torch_cmdline> set_cmd_options <s>)
#? (==> <torch_cmdline> get_text_info)
#? (==> <torch_cmdline> set_text_info <s>)
#? (==> <torch_cmdline> get_working_directory)
#? (==> <torch_cmdline> set_working_directory <s>)
#? (==> <torch_cmdline> get_associated_files)
#? (==> <torch_cmdline> set_associated_files <s>)
#? (==> <torch_cmdline> get_n_associated_files)
#? (==> <torch_cmdline> set_n_associated_files <s>)
#? (==> <torch_cmdline> get_master_switch)
#? (==> <torch_cmdline> set_master_switch <s>)
#? (==> <torch_cmdline> get_argv)
#? (==> <torch_cmdline> set_argv <s>)
#? (==> <torch_cmdline> get_argc)
#? (==> <torch_cmdline> set_argc <s>)
#? (new torch_cmdline <flag>>
#? (==> <torch_cmdline> read <argc_> <argv_>)
#? (==> <torch_cmdline> help <name>)
#? (==> <torch_cmdline> addicmdoption <name> <ptr> <initvalue> <help> <save_it>)
#? (==> <torch_cmdline> addbcmdoption <name> <ptr> <initvalue> <help> <save_it>)
#? (==> <torch_cmdline> addrcmdoption <name> <ptr> <initvalue> <help> <save_it>)
#? (==> <torch_cmdline> addscmdoption <name> <ptr> <initvalue> <help> <save_it>)
#? (==> <torch_cmdline> addicmdarg <name> <ptr> <help> <save_it>)
#? (==> <torch_cmdline> addbcmdarg <name> <ptr> <help> <save_it>)
#? (==> <torch_cmdline> addrcmdarg <name> <ptr> <help> <save_it>)
#? (==> <torch_cmdline> addscmdarg <name> <ptr> <help> <save_it>)
#? (==> <torch_cmdline> addtext <text>)
#? (==> <torch_cmdline> info <text>)
#? (==> <torch_cmdline> addmasterswitch <text>)
#? (==> <torch_cmdline> setworkingdirectory <dirname>)
#? (==> <torch_cmdline> getpath <filename>)
#? (==> <torch_cmdline> getxfile <filename>)
#? (==> <torch_cmdline> loadxfile <file>)
#? (==> <torch_cmdline> savexfile <file>)
#? (==> <torch_cmdline> addcmdoption <name> <ptr> <init_value> <type> <help> <status> <save_it>)
#? (==> <torch_cmdline> setcmdoption <argc_> <argv_> <current> <ptro> <current_master_switch>)
#? (==> <torch_cmdline> printcmdoption <ptro>)
#? (==> <torch_cmdline> -destructor)

#? * torch_dataset
;;.TYPE CLASS
#? (==> <torch_dataset> get_subsets)
#? (==> <torch_dataset> set_subsets <s>)
#? (==> <torch_dataset> get_n_examples_subsets)
#? (==> <torch_dataset> set_n_examples_subsets <s>)
#? (==> <torch_dataset> get_n_subsets)
#? (==> <torch_dataset> set_n_subsets <s>)
#? (==> <torch_dataset> get_pushed_examples)
#? (==> <torch_dataset> set_pushed_examples <s>)
#? (==> <torch_dataset> get_select_examples)
#? (==> <torch_dataset> set_select_examples <s>)
#? (==> <torch_dataset> get_selected_examples)
#? (==> <torch_dataset> set_selected_examples <s>)
#? (==> <torch_dataset> get_n_inputs)
#? (==> <torch_dataset> set_n_inputs <s>)
#? (==> <torch_dataset> get_n_targets)
#? (==> <torch_dataset> set_n_targets <s>)
#? (==> <torch_dataset> get_real_current_example_index)
#? (==> <torch_dataset> set_real_current_example_index <s>)
#? (==> <torch_dataset> get_inputs)
#? (==> <torch_dataset> set_inputs <s>)
#? (==> <torch_dataset> get_targets)
#? (==> <torch_dataset> set_targets <s>)
#? (==> <torch_dataset> get_n_examples)
#? (==> <torch_dataset> set_n_examples <s>)
#? (==> <torch_dataset> get_n_real_examples)
#? (==> <torch_dataset> set_n_real_examples <s>)
#? (new torch_dataset <flag>>
#? (==> <torch_dataset> init <n_examples_> <n_inputs_> <n_targets_>)
#? (==> <torch_dataset> setexample <s> <set_inputs> <set_targets>)
#? (==> <torch_dataset> pushsubset <subset_> <n_examples_>)
#? (==> <torch_dataset> popsubset)
#? (==> <torch_dataset> -destructor)


#? * torch_editdistance
;;.TYPE CLASS
#? (==> <torch_editdistance> get_accuracy)
#? (==> <torch_editdistance> set_accuracy <s>)
#? (==> <torch_editdistance> get_n_insert)
#? (==> <torch_editdistance> set_n_insert <s>)
#? (==> <torch_editdistance> get_n_delete)
#? (==> <torch_editdistance> set_n_delete <s>)
#? (==> <torch_editdistance> get_n_subst)
#? (==> <torch_editdistance> set_n_subst <s>)
#? (==> <torch_editdistance> get_n_seq)
#? (==> <torch_editdistance> set_n_seq <s>)
#? (==> <torch_editdistance> get_insert_cost)
#? (==> <torch_editdistance> set_insert_cost <s>)
#? (==> <torch_editdistance> get_delete_cost)
#? (==> <torch_editdistance> set_delete_cost <s>)
#? (==> <torch_editdistance> get_subst_cost)
#? (==> <torch_editdistance> set_subst_cost <s>)
#? (==> <torch_editdistance> get_obtained)
#? (==> <torch_editdistance> set_obtained <s>)
#? (==> <torch_editdistance> get_obt_size)
#? (==> <torch_editdistance> set_obt_size <s>)
#? (==> <torch_editdistance> get_desired)
#? (==> <torch_editdistance> set_desired <s>)
#? (==> <torch_editdistance> get_des_size)
#? (==> <torch_editdistance> set_des_size <s>)
#? (new torch_editdistance <flag>>
#? (==> <torch_editdistance> setcosts <i_cost> <d_cost> <s_cost>)
#? (==> <torch_editdistance> distance <obtained> <obt_size> <desired> <des_size>)
#? (==> <torch_editdistance> add <d>)
#? (==> <torch_editdistance> print <f>)
#? (==> <torch_editdistance> printratio <f>)
#? (==> <torch_editdistance> reset)
#? (==> <torch_editdistance> -destructor)

#? * torch_iosequence
;;.TYPE CLASS
#? (==> <torch_iosequence> get_n_sequences)
#? (==> <torch_iosequence> set_n_sequences <s>)
#? (==> <torch_iosequence> get_frame_size)
#? (==> <torch_iosequence> set_frame_size <s>)
#? (new torch_iosequence <flag>>
#? (==> <torch_iosequence> -destructor)

#? * torch_iosequencearray
;;.TYPE CLASS
#? (new torch_iosequencearray <flag>>
#? (==> <torch_iosequencearray> read <file> <sequences_array> <n_sequences> <allocator_>)
#? (==> <torch_iosequencearray> write <file> <sequences_array> <n_sequences>)
#? (==> <torch_iosequencearray> -destructor)

#? * torch_kfold
;;.TYPE CLASS
#? (==> <torch_kfold> get_train_subsets)
#? (==> <torch_kfold> set_train_subsets <s>)
#? (==> <torch_kfold> get_test_subsets)
#? (==> <torch_kfold> set_test_subsets <s>)
#? (==> <torch_kfold> get_n_train_subsets)
#? (==> <torch_kfold> set_n_train_subsets <s>)
#? (==> <torch_kfold> get_n_test_subsets)
#? (==> <torch_kfold> set_n_test_subsets <s>)
#? (==> <torch_kfold> get_trainer)
#? (==> <torch_kfold> set_trainer <s>)
#? (==> <torch_kfold> get_kfold)
#? (==> <torch_kfold> set_kfold <s>)
#? (new torch_kfold <flag> <trainer_> <kfold_>>
#? (==> <torch_kfold> crossvalidate <data> <train_measurers> <test_measurers> <cross_valid_measurers>)
#? (==> <torch_kfold> sample <n_examples>)
#? (==> <torch_kfold> -destructor)

#? * torch_kernel
;;.TYPE CLASS
#? (new torch_kernel <flag>>
#? (==> <torch_kernel> -destructor)

#? * torch_machine
;;.TYPE CLASS
#? (==> <torch_machine> get_outputs)
#? (==> <torch_machine> set_outputs <s>)
#? (new torch_machine <flag>>
#? (==> <torch_machine> reset)
#? (==> <torch_machine> setdataset <dataset_>)
#? (==> <torch_machine> -destructor)

#? * torch_mat
;;.TYPE CLASS
#? (==> <torch_mat> get_n)
#? (==> <torch_mat> set_n <s>)
#? (==> <torch_mat> get_m)
#? (==> <torch_mat> set_m <s>)
#? (==> <torch_mat> get_ptr)
#? (==> <torch_mat> set_ptr <s>)
#? (==> <torch_mat> get_base)
#? (==> <torch_mat> set_base <s>)
#? (new torch_mat <flag> <ptr_> <n_rows> <n_cols>>
#? (new torch_mat <flag> <n_rows> <n_cols>>
#? (==> <torch_mat> copy <mat>)
#? (==> <torch_mat> zero)
#? (==> <torch_mat> norm1)
#? (==> <torch_mat> normfrobenius)
#? (==> <torch_mat> norminf)
#? (==> <torch_mat> getrow <row> <vec>)
#? (==> <torch_mat> getcol <col> <vec>)
#? (==> <torch_mat> setrow <row> <vec>)
#? (==> <torch_mat> setcol <row> <vec>)
#? (==> <torch_mat> submat <row1> <col1> <row2> <col2>)
#? (==> <torch_mat> -destructor)

#? * torch_measurer
;;.TYPE CLASS
#? (==> <torch_measurer> get_file)
#? (==> <torch_measurer> set_file <s>)
#? (==> <torch_measurer> get_data)
#? (==> <torch_measurer> set_data <s>)
#? (==> <torch_measurer> get_binary_mode)
#? (==> <torch_measurer> set_binary_mode <s>)
#? (new torch_measurer <flag> <data_> <file_>>
#? (==> <torch_measurer> measureexample)
#? (==> <torch_measurer> measureiteration)
#? (==> <torch_measurer> measureend)
#? (==> <torch_measurer> reset)
#? (==> <torch_measurer> -destructor)

#? * torch_parameters
;;.TYPE CLASS
#? (==> <torch_parameters> get_data)
#? (==> <torch_parameters> set_data <s>)
#? (==> <torch_parameters> get_n_data)
#? (==> <torch_parameters> set_n_data <s>)
#? (==> <torch_parameters> get_size)
#? (==> <torch_parameters> set_size <s>)
#? (==> <torch_parameters> get_n_params)
#? (==> <torch_parameters> set_n_params <s>)
#? (new torch_parameters <flag>>
#? (new torch_parameters <flag> <n_params_>>
#? (==> <torch_parameters> addparameters <params> <n_params_> <do_copy>)
#? (==> <torch_parameters> add <params> <do_copy>)
#? (==> <torch_parameters> copy <from>)
#? (==> <torch_parameters> copyfrom <vec>)
#? (==> <torch_parameters> copyto <vec>)
#? (==> <torch_parameters> savexfile <file>)
#? (==> <torch_parameters> loadxfile <file>)
#? (==> <torch_parameters> -destructor)

#? * torch_perm
;;.TYPE CLASS
#? (==> <torch_perm> get_n)
#? (==> <torch_perm> set_n <s>)
#? (==> <torch_perm> get_ptr)
#? (==> <torch_perm> set_ptr <s>)
#? (new torch_perm <flag> <n_dim>>
#? (==> <torch_perm> copy <perm>)
#? (==> <torch_perm> -destructor)

#? * torch_preprocessing
;;.TYPE CLASS
#? (new torch_preprocessing <flag>>
#? (==> <torch_preprocessing> -destructor)

#? * torch_qccache
;;.TYPE CLASS
#? (new torch_qccache <flag>>
#? (==> <torch_qccache> -destructor)

#? * torch_sequence
;;.TYPE CLASS
#? (==> <torch_sequence> get_n_real_frames)
#? (==> <torch_sequence> set_n_real_frames <s>)
#? (==> <torch_sequence> get_frames)
#? (==> <torch_sequence> set_frames <s>)
#? (==> <torch_sequence> get_n_frames)
#? (==> <torch_sequence> set_n_frames <s>)
#? (==> <torch_sequence> get_frame_size)
#? (==> <torch_sequence> set_frame_size <s>)
#? (==> <torch_sequence> frames_setval <i> <j> <val>)
#? (==> <torch_sequence> frames_getval <i> <j>)
#? (new torch_sequence <flag>>
#? (new torch_sequence <flag> <frames_> <n_frames_> <frame_size_>>
#? (new torch_sequence <flag> <n_frames_> <frame_size_>>
#? (==> <torch_sequence> resize <n_frames_> <allocate_new_frames>)
#? (==> <torch_sequence> addframe <frame> <do_copy>)
#? (==> <torch_sequence> add <sequence> <do_copy>)
#? (==> <torch_sequence> copy <from>)
#? (==> <torch_sequence> copyfrom <vec>)
#? (==> <torch_sequence> copyto <vec>)
#? (==> <torch_sequence> getsequencespace)
#? (==> <torch_sequence> getframesspace)
#? (==> <torch_sequence> clone <allocator_> <sequence_memory> <frames_memory>)
#? (==> <torch_sequence> savexfile <file>)
#? (==> <torch_sequence> loadxfile <file>)
#? (==> <torch_sequence> -destructor)

#? * torch_stack
;;.TYPE CLASS
#? (==> <torch_stack> get_stack)
#? (==> <torch_stack> set_stack <s>)
#? (==> <torch_stack> get_n_stacked_objects)
#? (==> <torch_stack> set_n_stacked_objects <s>)
#? (new torch_stack <flag>>
#? (==> <torch_stack> push <ptr> <size>)
#? (==> <torch_stack> pop)
#? (==> <torch_stack> -destructor)

#? * torch_timer
;;.TYPE CLASS
#? (==> <torch_timer> get_is_running)
#? (==> <torch_timer> set_is_running <s>)
#? (==> <torch_timer> get_total_time)
#? (==> <torch_timer> set_total_time <s>)
#? (==> <torch_timer> get_start_time)
#? (==> <torch_timer> set_start_time <s>)
#? (new torch_timer <flag>>
#? (==> <torch_timer> reset)
#? (==> <torch_timer> stop)
#? (==> <torch_timer> resume)
#? (==> <torch_timer> gettime)
#? (==> <torch_timer> getruntime)
#? (==> <torch_timer> -destructor)

#? * torch_trainer
;;.TYPE CLASS
#? (==> <torch_trainer> get_machine)
#? (==> <torch_trainer> set_machine <s>)
#? (new torch_trainer <flag> <machine_>>
#? (==> <torch_trainer> test <measurers>)
#? (==> <torch_trainer> extractmeasurers <measurers> <train> <datas> <meas> <n_meas> <n_datas>)
#? (==> <torch_trainer> loadxfile <file>)
#? (==> <torch_trainer> savexfile <file>)
#? (==> <torch_trainer> -destructor)

#? * torch_vec
;;.TYPE CLASS
#? (==> <torch_vec> get_n)
#? (==> <torch_vec> set_n <s>)
#? (==> <torch_vec> get_ptr)
#? (==> <torch_vec> set_ptr <s>)
#? (new torch_vec <flag> <ptr_> <n_dim>>
#? (new torch_vec <flag> <n_dim>>
#? (==> <torch_vec> copy <vec> <start_i>)
#? (==> <torch_vec> zero)
#? (==> <torch_vec> norm1 <weights>)
#? (==> <torch_vec> norm2 <weights>)
#? (==> <torch_vec> norminf)
#? (==> <torch_vec> ip <vec> <start_i>)
#? (==> <torch_vec> subvec <dim1> <dim2>)
#? (==> <torch_vec> -destructor)

#? * torch_xfile
;;.TYPE CLASS
#? (new torch_xfile <flag>>
#? (==> <torch_xfile> taggedread <ptr> <block_size> <n_blocks> <tag>)
#? (==> <torch_xfile> taggedwrite <ptr> <block_size> <n_blocks> <tag>)
#? (==> <torch_xfile> -destructor)

#? * (dummy_level1)

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


;;class ClassFormat : public Object
(defclass  torch_ClassFormat   torch_Object)

(defmethod  torch_ClassFormat  get_n_classes ()
  
  (int #{ ((Torch::ClassFormat *)$p)->n_classes   #} ))

(defmethod  torch_ClassFormat  set_n_classes (s )
  
  ((-int-) s)  
  #{ ((Torch::ClassFormat *)$p)->n_classes = $s  ; #} 
  ())

(defmethod  torch_ClassFormat  get_class_labels ()
  
  (gptr #{ ((Torch::ClassFormat *)$p)->class_labels   #} ))        ;; double **  -> gptr

(defmethod  torch_ClassFormat  set_class_labels (s )
  
  ((-gptr- "double **") s)  
  #{ ((Torch::ClassFormat *)$p)->class_labels = $s  ; #} 
  ())

(defmethod  torch_ClassFormat  torch_ClassFormat ( flag )
  ((-bool-) flag)
  
;;  #{ if($flag == 0) {
;;            $shell_flag = 0;
;;            $p = new Torch::ClassFormat(); 
;;     }
;;  #} 
  ())

(defmethod  torch_ClassFormat  -destructor  ()
  
;;  #{ if ( $shell_flag == 0 )  delete  ((Torch::ClassFormat *)$p);   #} 
  ())





;;class Sequence : public Object
(defclass  torch_Sequence   torch_Object)

(defmethod  torch_Sequence  get_n_real_frames ()
  
  (int #{ ((Torch::Sequence *)$p)->n_real_frames   #} ))

(defmethod  torch_Sequence  set_n_real_frames (s )
  
  ((-int-) s)  
  #{ ((Torch::Sequence *)$p)->n_real_frames = $s  ; #} 
  ())

(defmethod  torch_Sequence  get_frames ()
  
  (gptr #{ ((Torch::Sequence *)$p)->frames   #} ))        ;; double **  -> gptr

(defmethod  torch_Sequence  set_frames (s )
  
  ((-gptr- "double **") s)  
  #{ ((Torch::Sequence *)$p)->frames = $s  ; #} 
  ())

(defmethod  torch_Sequence  get_n_frames ()
  
  (int #{ ((Torch::Sequence *)$p)->n_frames   #} ))

(defmethod  torch_Sequence  set_n_frames (s )
  
  ((-int-) s)  
  #{ ((Torch::Sequence *)$p)->n_frames = $s  ; #} 
  ())

(defmethod  torch_Sequence  get_frame_size ()
  
  (int #{ ((Torch::Sequence *)$p)->frame_size   #} ))

(defmethod  torch_Sequence  set_frame_size (s )
  
  ((-int-) s)  
  #{ ((Torch::Sequence *)$p)->frame_size = $s  ; #} 
  ())

(defmethod torch_Sequence frames_setval ( i j val)
  ((-int-) i j)
  ((-double-) val)
  #{ ((Torch::Sequence *)$p)->frames[$i][$j] = $val; #}
  ())

(defmethod torch_Sequence frames_getval (i j)
  ((-int-) i j)
  (double #{ ((Torch::Sequence *)$p)->frames[$i][$j] #} ))

;;(defmethod  torch_Sequence  torch_Sequence ( flag )
;;  ((-bool-) flag)
;;  
;;  #{ if($flag == 0) {
;;            $shell_flag = 0;
;;            $p = new Torch::Sequence(); 
;;     }
;;  #} 
;;  ())

;;(defmethod  torch_Sequence  torch_Sequence ( flag frames_  n_frames_  frame_size_ )
;;  ((-bool-) flag)
;;  
;;  ((-gptr- "double **") frames_)  
;;  ((-int-) n_frames_)  
;;  ((-int-) frame_size_)  
;;  #{ if($flag == 0) {
;;            $shell_flag = 0;
;;            $p = new Torch::Sequence($frames_  ,$n_frames_  ,$frame_size_); 
;;     }
;;  #} 
;;  ())

(defmethod  torch_Sequence  torch_Sequence ( flag n_frames_  frame_size_ )
  ((-bool-) flag)
  
  ((-int-) n_frames_)  
  ((-int-) frame_size_)  
  #{ if($flag == false) {
            $shell_flag = false;
            $p = new Torch::Sequence($n_frames_  ,$frame_size_); 
     }
     else 
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_Sequence  resize (n_frames_  allocate_new_frames )
  
  ((-int-) n_frames_)  
  ((-bool-) allocate_new_frames)  
  #{ ((Torch::Sequence *)$p)->resize($n_frames_  ,$allocate_new_frames)  ; #} 
  ())

(defmethod  torch_Sequence  addFrame (frame  do_copy )
  
  ((-gptr- "double *") frame)  
  ((-bool-) do_copy)  
  #{ ((Torch::Sequence *)$p)->addFrame($frame  ,$do_copy)  ; #} 
  ())

(defmethod  torch_Sequence  add (sequence  do_copy )
  
  ((-gptr- "Torch::Sequence *") sequence)  
  ((-bool-) do_copy)  
  #{ ((Torch::Sequence *)$p)->add($sequence  ,$do_copy)  ; #} 
  ())

(defmethod  torch_Sequence  copy (from )
  
  ((-gptr- "Torch::Sequence *") from)  
  #{ ((Torch::Sequence *)$p)->copy($from)  ; #} 
  ())

(defmethod  torch_Sequence  copyFrom (vec )
  
  ((-gptr- "double *") vec)  
  #{ ((Torch::Sequence *)$p)->copyFrom($vec)  ; #} 
  ())

(defmethod  torch_Sequence  copyTo (vec )
  
  ((-gptr- "double *") vec)  
  #{ ((Torch::Sequence *)$p)->copyTo($vec)  ; #} 
  ())

(defmethod  torch_Sequence  getSequenceSpace ()
  
  (int #{ ((Torch::Sequence *)$p)->getSequenceSpace()  #} ))

(defmethod  torch_Sequence  getFramesSpace ()
  
  (int #{ ((Torch::Sequence *)$p)->getFramesSpace()  #} ))

(defmethod  torch_Sequence  clone (allocator_  sequence_memory  frames_memory )
  
  ((-gptr- "Torch::Allocator *") allocator_)  
  ((-gptr-) sequence_memory)  
  ((-gptr-) frames_memory)  
  (gptr #{ ((Torch::Sequence *)$p)->clone($allocator_  ,$sequence_memory  ,$frames_memory)  #} ))        ;; Sequence *  -> gptr

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

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

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




;;class DataSet : public Object
(defclass  torch_DataSet   torch_Object)

(defmethod  torch_DataSet  get_subsets ()
  
  (gptr #{ ((Torch::DataSet *)$p)->subsets   #} ))        ;; int **  -> gptr

(defmethod  torch_DataSet  set_subsets (s )
  
  ((-gptr- "int **") s)  
  #{ ((Torch::DataSet *)$p)->subsets = $s  ; #} 
  ())

(defmethod  torch_DataSet  get_n_examples_subsets ()
  
  (gptr #{ ((Torch::DataSet *)$p)->n_examples_subsets   #} ))        ;; int *  -> gptr

(defmethod  torch_DataSet  set_n_examples_subsets (s )
  
  ((-gptr- "int *") s)  
  #{ ((Torch::DataSet *)$p)->n_examples_subsets = $s  ; #} 
  ())

(defmethod  torch_DataSet  get_n_subsets ()
  
  (int #{ ((Torch::DataSet *)$p)->n_subsets   #} ))

(defmethod  torch_DataSet  set_n_subsets (s )
  
  ((-int-) s)  
  #{ ((Torch::DataSet *)$p)->n_subsets = $s  ; #} 
  ())

(defmethod  torch_DataSet  get_pushed_examples ()
  
  (gptr #{ ((Torch::DataSet *)$p)->pushed_examples   #} ))        ;; Stack *  -> gptr

(defmethod  torch_DataSet  set_pushed_examples (s )
  
  ((-gptr- "Torch::Stack *") s)  
  #{ ((Torch::DataSet *)$p)->pushed_examples = $s  ; #} 
  ())

(defmethod  torch_DataSet  get_select_examples ()
  
  (bool #{ ((Torch::DataSet *)$p)->select_examples   #} ))

(defmethod  torch_DataSet  set_select_examples (s )
  
  ((-bool-) s)  
  #{ ((Torch::DataSet *)$p)->select_examples = $s  ; #} 
  ())

(defmethod  torch_DataSet  get_selected_examples ()
  
  (gptr #{ ((Torch::DataSet *)$p)->selected_examples   #} ))        ;; int *  -> gptr

(defmethod  torch_DataSet  set_selected_examples (s )
  
  ((-gptr- "int *") s)  
  #{ ((Torch::DataSet *)$p)->selected_examples = $s  ; #} 
  ())

(defmethod  torch_DataSet  get_n_inputs ()
  
  (int #{ ((Torch::DataSet *)$p)->n_inputs   #} ))

(defmethod  torch_DataSet  set_n_inputs (s )
  
  ((-int-) s)  
  #{ ((Torch::DataSet *)$p)->n_inputs = $s  ; #} 
  ())

(defmethod  torch_DataSet  get_n_targets ()
  
  (int #{ ((Torch::DataSet *)$p)->n_targets   #} ))

(defmethod  torch_DataSet  set_n_targets (s )
  
  ((-int-) s)  
  #{ ((Torch::DataSet *)$p)->n_targets = $s  ; #} 
  ())

(defmethod  torch_DataSet  get_real_current_example_index ()
  
  (int #{ ((Torch::DataSet *)$p)->real_current_example_index   #} ))

(defmethod  torch_DataSet  set_real_current_example_index (s )
  
  ((-int-) s)  
  #{ ((Torch::DataSet *)$p)->real_current_example_index = $s  ; #} 
  ())

(defmethod  torch_DataSet  get_inputs ()
  
  (let ((ret_obj (new torch_Sequence t 0 0)))
    #{ $ret_obj->p = ((Torch::DataSet *)$p)->inputs;   #} 
    ret_obj))      

(defmethod  torch_DataSet  set_inputs (s )
  
  ((-gptr- "Torch::Sequence *") s)  
  #{ ((Torch::DataSet *)$p)->inputs = $s  ; #} 
  ())

(defmethod  torch_DataSet  get_targets ()
  
  (let ((ret_obj (new torch_Sequence t 0 0)))
    #{ $ret_obj->p = ((Torch::DataSet *)$p)->targets;   #} 
    ret_obj))      

(defmethod  torch_DataSet  set_targets (s )
  
  ((-gptr- "Torch::Sequence *") s)  
  #{ ((Torch::DataSet *)$p)->targets = $s  ; #} 
  ())

(defmethod  torch_DataSet  get_n_examples ()
  
  (int #{ ((Torch::DataSet *)$p)->n_examples   #} ))

(defmethod  torch_DataSet  set_n_examples (s )
  
  ((-int-) s)  
  #{ ((Torch::DataSet *)$p)->n_examples = $s  ; #} 
  ())

(defmethod  torch_DataSet  get_n_real_examples ()
  
  (int #{ ((Torch::DataSet *)$p)->n_real_examples   #} ))

(defmethod  torch_DataSet  set_n_real_examples (s )
  
  ((-int-) s)  
  #{ ((Torch::DataSet *)$p)->n_real_examples = $s  ; #} 
  ())

(defmethod  torch_DataSet  torch_DataSet ( flag )
  ((-bool-) flag)
  
;;  #{ if($flag == 0) {
;;           $shell_flag = 0;
;;            $p = new Torch::DataSet(); 
;;     }
;;  #} 
  ())

(defmethod  torch_DataSet  init (n_examples_  n_inputs_  n_targets_ )
  
  ((-int-) n_examples_)  
  ((-int-) n_inputs_)  
  ((-int-) n_targets_)  
  #{ ((Torch::DataSet *)$p)->init($n_examples_  ,$n_inputs_  ,$n_targets_)  ; #} 
  ())

(defmethod  torch_DataSet  setExample (s  set_inputs  set_targets )
  
  ((-int-) s)  
  ((-bool-) set_inputs)  
  ((-bool-) set_targets)  
  #{ ((Torch::DataSet *)$p)->setExample($s  ,$set_inputs  ,$set_targets)  ; #} 
  ())

(defmethod  torch_DataSet  pushSubset (subset_  n_examples_ )
  
  ((-gptr- "int *") subset_)  
  ((-int-) n_examples_)  
  #{ ((Torch::DataSet *)$p)->pushSubset($subset_  ,$n_examples_)  ; #} 
  ())

(defmethod  torch_DataSet  popSubset ()
  
  #{ ((Torch::DataSet *)$p)->popSubset()  ; #} 
  ())

(defmethod  torch_DataSet  -destructor  ()
  
;;  #{ if ( $shell_flag == 0 )  delete  ((Torch::DataSet *)$p);   #} 
  ())





;;class EditDistance : public Object
(defclass  torch_EditDistance   torch_Object)

(defmethod  torch_EditDistance  get_accuracy ()
  
  (double #{ ((Torch::EditDistance *)$p)->accuracy   #} ))

(defmethod  torch_EditDistance  set_accuracy (s )
  
  ((-double-) s)  
  #{ ((Torch::EditDistance *)$p)->accuracy = $s  ; #} 
  ())

(defmethod  torch_EditDistance  get_n_insert ()
  
  (int #{ ((Torch::EditDistance *)$p)->n_insert   #} ))

(defmethod  torch_EditDistance  set_n_insert (s )
  
  ((-int-) s)  
  #{ ((Torch::EditDistance *)$p)->n_insert = $s  ; #} 
  ())

(defmethod  torch_EditDistance  get_n_delete ()
  
  (int #{ ((Torch::EditDistance *)$p)->n_delete   #} ))

(defmethod  torch_EditDistance  set_n_delete (s )
  
  ((-int-) s)  
  #{ ((Torch::EditDistance *)$p)->n_delete = $s  ; #} 
  ())

(defmethod  torch_EditDistance  get_n_subst ()
  
  (int #{ ((Torch::EditDistance *)$p)->n_subst   #} ))

(defmethod  torch_EditDistance  set_n_subst (s )
  
  ((-int-) s)  
  #{ ((Torch::EditDistance *)$p)->n_subst = $s  ; #} 
  ())

(defmethod  torch_EditDistance  get_n_seq ()
  
  (int #{ ((Torch::EditDistance *)$p)->n_seq   #} ))

(defmethod  torch_EditDistance  set_n_seq (s )
  
  ((-int-) s)  
  #{ ((Torch::EditDistance *)$p)->n_seq = $s  ; #} 
  ())

(defmethod  torch_EditDistance  get_insert_cost ()
  
  (int #{ ((Torch::EditDistance *)$p)->insert_cost   #} ))

(defmethod  torch_EditDistance  set_insert_cost (s )
  
  ((-int-) s)  
  #{ ((Torch::EditDistance *)$p)->insert_cost = $s  ; #} 
  ())

(defmethod  torch_EditDistance  get_delete_cost ()
  
  (int #{ ((Torch::EditDistance *)$p)->delete_cost   #} ))

(defmethod  torch_EditDistance  set_delete_cost (s )
  
  ((-int-) s)  
  #{ ((Torch::EditDistance *)$p)->delete_cost = $s  ; #} 
  ())

(defmethod  torch_EditDistance  get_subst_cost ()
  
  (int #{ ((Torch::EditDistance *)$p)->subst_cost   #} ))

(defmethod  torch_EditDistance  set_subst_cost (s )
  
  ((-int-) s)  
  #{ ((Torch::EditDistance *)$p)->subst_cost = $s  ; #} 
  ())

(defmethod  torch_EditDistance  get_obtained ()
  
  (gptr #{ ((Torch::EditDistance *)$p)->obtained   #} ))        ;; int*  -> gptr

(defmethod  torch_EditDistance  set_obtained (s )
  
  ((-gptr- "int*") s)  
  #{ ((Torch::EditDistance *)$p)->obtained = $s  ; #} 
  ())

(defmethod  torch_EditDistance  get_obt_size ()
  
  (int #{ ((Torch::EditDistance *)$p)->obt_size   #} ))

(defmethod  torch_EditDistance  set_obt_size (s )
  
  ((-int-) s)  
  #{ ((Torch::EditDistance *)$p)->obt_size = $s  ; #} 
  ())

(defmethod  torch_EditDistance  get_desired ()
  
  (gptr #{ ((Torch::EditDistance *)$p)->desired   #} ))        ;; int*  -> gptr

(defmethod  torch_EditDistance  set_desired (s )
  
  ((-gptr- "int*") s)  
  #{ ((Torch::EditDistance *)$p)->desired = $s  ; #} 
  ())

(defmethod  torch_EditDistance  get_des_size ()
  
  (int #{ ((Torch::EditDistance *)$p)->des_size   #} ))

(defmethod  torch_EditDistance  set_des_size (s )
  
  ((-int-) s)  
  #{ ((Torch::EditDistance *)$p)->des_size = $s  ; #} 
  ())

(defmethod  torch_EditDistance  torch_EditDistance ( flag )
  ((-bool-) flag)
  
  #{ if($flag == false ) {
            $shell_flag = false;
            $p = new Torch::EditDistance(); 
     }
     else
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_EditDistance  setCosts (i_cost  d_cost  s_cost )
  
  ((-int-) i_cost)  
  ((-int-) d_cost)  
  ((-int-) s_cost)  
  #{ ((Torch::EditDistance *)$p)->setCosts($i_cost  ,$d_cost  ,$s_cost)  ; #} 
  ())

(defmethod  torch_EditDistance  distance (obtained  obt_size  desired  des_size )
  
  ((-gptr- "int*") obtained)  
  ((-int-) obt_size)  
  ((-gptr- "int*") desired)  
  ((-int-) des_size)  
  #{ ((Torch::EditDistance *)$p)->distance($obtained  ,$obt_size  ,$desired  ,$des_size)  ; #} 
  ())

(defmethod  torch_EditDistance  add (d )
  
  ((-gptr- "Torch::EditDistance*") d)  
  #{ ((Torch::EditDistance *)$p)->add($d)  ; #} 
  ())

(defmethod  torch_EditDistance  print (f )
  
  ((-gptr- "Torch::XFile *") f)  
  #{ ((Torch::EditDistance *)$p)->print($f)  ; #} 
  ())

(defmethod  torch_EditDistance  printRatio (f )
  
  ((-gptr- "Torch::XFile *") f)  
  #{ ((Torch::EditDistance *)$p)->printRatio($f)  ; #} 
  ())

(defmethod  torch_EditDistance  reset ()
  
  #{ ((Torch::EditDistance *)$p)->reset()  ; #} 
  ())

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




;;class IOSequence : public Object
(defclass  torch_IOSequence   torch_Object)

(defmethod  torch_IOSequence  get_n_sequences ()
  
  (int #{ ((Torch::IOSequence *)$p)->n_sequences   #} ))

(defmethod  torch_IOSequence  set_n_sequences (s )
  
  ((-int-) s)  
  #{ ((Torch::IOSequence *)$p)->n_sequences = $s  ; #} 
  ())

(defmethod  torch_IOSequence  get_frame_size ()
  
  (int #{ ((Torch::IOSequence *)$p)->frame_size   #} ))

(defmethod  torch_IOSequence  set_frame_size (s )
  
  ((-int-) s)  
  #{ ((Torch::IOSequence *)$p)->frame_size = $s  ; #} 
  ())

(defmethod  torch_IOSequence  torch_IOSequence ( flag )
  ((-bool-) flag)
  
;;  #{ if($flag == 0) {
;;            $shell_flag = 0;
;;            $p = new Torch::IOSequence(); 
;;     }
;;  #} 
  ())

(defmethod  torch_IOSequence  -destructor  ()
  
;;  #{ if ( $shell_flag == 0 )  delete  ((Torch::IOSequence *)$p);   #} 
  ())




;;class IOSequenceArray : public Object
(defclass  torch_IOSequenceArray   torch_Object)

(defmethod  torch_IOSequenceArray  torch_IOSequenceArray ( flag )
  ((-bool-) flag)
  
  #{ if($flag == false) {
            $shell_flag = false;
            $p = new Torch::IOSequenceArray(); 
     }
     else 
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_IOSequenceArray  read (file  sequences_array  n_sequences  allocator_ )
  
  ((-gptr- "Torch::XFile *") file)  
  ((-gptr- "Torch::Sequence **") sequences_array)  
  ((-int-) n_sequences)  
  ((-gptr- "Torch::Allocator *") allocator_)  
  #{ ((Torch::IOSequenceArray *)$p)->read($file  ,$sequences_array  ,$n_sequences  ,$allocator_)  ; #} 
  ())

(defmethod  torch_IOSequenceArray  write (file  sequences_array  n_sequences )
  
  ((-gptr- "Torch::XFile *") file)  
  ((-gptr- "Torch::Sequence **") sequences_array)  
  ((-int-) n_sequences)  
  #{ ((Torch::IOSequenceArray *)$p)->write($file  ,$sequences_array  ,$n_sequences)  ; #} 
  ())

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




;;class KFold : public Object
(defclass  torch_KFold   torch_Object)

(defmethod  torch_KFold  get_train_subsets ()
  
  (gptr #{ ((Torch::KFold *)$p)->train_subsets   #} ))        ;; int**  -> gptr

(defmethod  torch_KFold  set_train_subsets (s )
  
  ((-gptr- "int**") s)  
  #{ ((Torch::KFold *)$p)->train_subsets = $s  ; #} 
  ())

(defmethod  torch_KFold  get_test_subsets ()
  
  (gptr #{ ((Torch::KFold *)$p)->test_subsets   #} ))        ;; int**  -> gptr

(defmethod  torch_KFold  set_test_subsets (s )
  
  ((-gptr- "int**") s)  
  #{ ((Torch::KFold *)$p)->test_subsets = $s  ; #} 
  ())

(defmethod  torch_KFold  get_n_train_subsets ()
  
  (gptr #{ ((Torch::KFold *)$p)->n_train_subsets   #} ))        ;; int*  -> gptr

(defmethod  torch_KFold  set_n_train_subsets (s )
  
  ((-gptr- "int*") s)  
  #{ ((Torch::KFold *)$p)->n_train_subsets = $s  ; #} 
  ())

(defmethod  torch_KFold  get_n_test_subsets ()
  
  (gptr #{ ((Torch::KFold *)$p)->n_test_subsets   #} ))        ;; int*  -> gptr

(defmethod  torch_KFold  set_n_test_subsets (s )
  
  ((-gptr- "int*") s)  
  #{ ((Torch::KFold *)$p)->n_test_subsets = $s  ; #} 
  ())

(defmethod  torch_KFold  get_trainer ()
  
  (gptr #{ ((Torch::KFold *)$p)->trainer   #} ))        ;; Trainer*  -> gptr

(defmethod  torch_KFold  set_trainer (s )
  
  ((-gptr- "Torch::Trainer*") s)  
  #{ ((Torch::KFold *)$p)->trainer = $s  ; #} 
  ())

(defmethod  torch_KFold  get_kfold ()
  
  (int #{ ((Torch::KFold *)$p)->kfold   #} ))

(defmethod  torch_KFold  set_kfold (s )
  
  ((-int-) s)  
  #{ ((Torch::KFold *)$p)->kfold = $s  ; #} 
  ())

(defmethod  torch_KFold  torch_KFold ( flag trainer_  kfold_ )
  ((-bool-) flag)
  
  ((-gptr- "Torch::Trainer*") trainer_)  
  ((-int-) kfold_)  
  #{ if($flag == false) {
            $shell_flag = false;
            $p = new Torch::KFold($trainer_  ,$kfold_); 
     }
     else 
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_KFold  crossValidate (data  train_measurers  test_measurers  cross_valid_measurers )
  
  ((-gptr- "Torch::DataSet *") data)  
  ((-gptr- "Torch::MeasurerList *") train_measurers)  
  ((-gptr- "Torch::MeasurerList *") test_measurers)  
  ((-gptr- "Torch::MeasurerList *") cross_valid_measurers)  
  #{ ((Torch::KFold *)$p)->crossValidate($data  ,$train_measurers  ,$test_measurers  ,$cross_valid_measurers)  ; #} 
  ())

(defmethod  torch_KFold  sample (n_examples )
  
  ((-int-) n_examples)  
  #{ ((Torch::KFold *)$p)->sample($n_examples)  ; #} 
  ())

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





;;class Kernel : public Object
(defclass  torch_Kernel   torch_Object)

(defmethod  torch_Kernel  torch_Kernel ( flag )
  ((-bool-) flag)
  
;;  #{ if($flag == false) {
;;            $shell_flag = false;
;;            $p = new Torch::Kernel(); 
;;     }
;;  #} 
  ())

(defmethod  torch_Kernel  -destructor  ()
  
;;  #{ if ( $shell_flag == 0 )  delete  ((Torch::Kernel *)$p);   #} 
  ())





;;class Machine : public Object
(defclass  torch_Machine   torch_Object)

(defmethod  torch_Machine  get_outputs ()
  
  (let ((ret_obj (new torch_Sequence t 0 0)))
    #{ $ret_obj->p = ((Torch::Machine *)$p)->outputs;   #} 
    ret_obj))        ;; Sequence *  -> gptr

(defmethod  torch_Machine  set_outputs (s )
  
  ((-gptr- "Torch::Sequence *") s)  
  #{ ((Torch::Machine *)$p)->outputs = $s  ; #} 
  ())

(defmethod  torch_Machine  torch_Machine ( flag )
  ((-bool-) flag)
  
;;  #{ if($flag == 0) {
;;            $shell_flag = 0;
;;            $p = new Torch::Machine(); 
;;     }
;;  #} 
  ())

(defmethod  torch_Machine  reset ()
  
  #{ ((Torch::Machine *)$p)->reset()  ; #} 
  ())

(defmethod  torch_Machine  setDataSet (dataset_ )
  
  ((-gptr- "Torch::DataSet *") dataset_)  
  #{ ((Torch::Machine *)$p)->setDataSet($dataset_)  ; #} 
  ())

(defmethod  torch_Machine  -destructor  ()
  
;;  #{ if ( $shell_flag == 0 )  delete  ((Torch::Machine *)$p);   #} 
  ())






;;class Mat : public Object
(defclass  torch_Mat   torch_Object)

(defmethod  torch_Mat  get_n ()
  
  (int #{ ((Torch::Mat *)$p)->n   #} ))

(defmethod  torch_Mat  set_n (s )
  
  ((-int-)  s)
  #{ ((Torch::Mat *)$p)->n = $s   ; #} 
  ())

(defmethod  torch_Mat  get_m ()
  
  (int #{ ((Torch::Mat *)$p)->m   #} ))

(defmethod  torch_Mat  set_m (s )
  
  ((-int-)  s)
  #{ ((Torch::Mat *)$p)->m = $s   ; #} 
  ())

(defmethod  torch_Mat  get_ptr ()
  
  (gptr #{ ((Torch::Mat *)$p)->ptr   #} ))        ;; double **  -> gptr

(defmethod  torch_Mat  set_ptr (s )
  
  ((-gptr- "double **") s)  
  #{ ((Torch::Mat *)$p)->ptr = $s  ; #} 
  ())

(defmethod  torch_Mat  get_base ()
  
  (gptr #{ ((Torch::Mat *)$p)->base   #} ))        ;; double *  -> gptr

(defmethod  torch_Mat  set_base (s )
  
  ((-gptr- "double *") s)  
  #{ ((Torch::Mat *)$p)->base = $s  ; #} 
  ())

;;(defmethod  torch_Mat  torch_Mat ( flag ptr_  n_rows  n_cols )
;;  ((-bool-) flag)
  
;;  ((-gptr- "double **") ptr_)  
;;  ((-int-) n_rows)  
;;  ((-int-) n_cols)  
;;  #{ if($flag == 0) {
;;            $shell_flag = 0;
;;            $p = new Torch::Mat($ptr_  ,$n_rows  ,$n_cols); 
;;     }
;;  #} 
;;  ())

(defmethod  torch_Mat  torch_Mat ( flag n_rows  n_cols )
  ((-bool-) flag)
  
  ((-int-) n_rows)  
  ((-int-) n_cols)  
  #{ if($flag == false) {
            $shell_flag = false;
            $p = new Torch::Mat($n_rows  ,$n_cols); 
     }
     else 
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_Mat  copy (mat )
  
  ((-gptr- "Torch::Mat *") mat)  
  #{ ((Torch::Mat *)$p)->copy($mat)  ; #} 
  ())

(defmethod  torch_Mat  zero ()
  
  #{ ((Torch::Mat *)$p)->zero()  ; #} 
  ())

(defmethod  torch_Mat  norm1 ()
  
  (double #{ ((Torch::Mat *)$p)->norm1()  #} ))

(defmethod  torch_Mat  normFrobenius ()
  
  (double #{ ((Torch::Mat *)$p)->normFrobenius()  #} ))

(defmethod  torch_Mat  normInf ()
  
  (double #{ ((Torch::Mat *)$p)->normInf()  #} ))

(defmethod  torch_Mat  getRow (row  vec )
  
  ((-int-) row)  
  ((-gptr- "Torch::Vec *") vec)  
  (gptr #{ ((Torch::Mat *)$p)->getRow($row  ,$vec)  #} ))        ;; Vec *  -> gptr

(defmethod  torch_Mat  getCol (col  vec )
  
  ((-int-) col)  
  ((-gptr- "Torch::Vec *") vec)  
  (gptr #{ ((Torch::Mat *)$p)->getCol($col  ,$vec)  #} ))        ;; Vec *  -> gptr

(defmethod  torch_Mat  setRow (row  vec )
  
  ((-int-) row)  
  ((-gptr- "Torch::Vec *") vec)  
  #{ ((Torch::Mat *)$p)->setRow($row  ,$vec)  ; #} 
  ())

(defmethod  torch_Mat  setCol (row  vec )
  
  ((-int-) row)  
  ((-gptr- "Torch::Vec *") vec)  
  #{ ((Torch::Mat *)$p)->setCol($row  ,$vec)  ; #} 
  ())

(defmethod  torch_Mat  subMat (row1  col1  row2  col2 )
  
  ((-int-) row1)  
  ((-int-) col1)  
  ((-int-) row2)  
  ((-int-) col2)  
  (gptr #{ ((Torch::Mat *)$p)->subMat($row1  ,$col1  ,$row2  ,$col2)  #} ))        ;; Mat *  -> gptr

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




;;class Measurer : public Object
(defclass  torch_Measurer   torch_Object)

(defmethod  torch_Measurer  get_file ()
  
  (gptr #{ ((Torch::Measurer *)$p)->file   #} ))        ;; XFile *  -> gptr

(defmethod  torch_Measurer  set_file (s )
  
  ((-gptr- "Torch::XFile *") s)  
  #{ ((Torch::Measurer *)$p)->file = $s  ; #} 
  ())

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

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

(defmethod  torch_Measurer  get_binary_mode ()
  
  (bool #{ ((Torch::Measurer *)$p)->binary_mode   #} ))

(defmethod  torch_Measurer  set_binary_mode (s )
  
  ((-bool-) s)  
  #{ ((Torch::Measurer *)$p)->binary_mode = $s  ; #} 
  ())

(defmethod  torch_Measurer  torch_Measurer ( flag data_  file_ )
  ((-bool-) flag)
  
  ((-gptr- "Torch::DataSet *") data_)  
  ((-gptr- "Torch::XFile *") file_)  
  #{ if($flag == false) {
            $shell_flag = false;
            $p = new Torch::Measurer($data_  ,$file_); 
     }
     else 
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_Measurer  measureExample ()
  
  #{ ((Torch::Measurer *)$p)->measureExample()  ; #} 
  ())

(defmethod  torch_Measurer  measureIteration ()
  
  #{ ((Torch::Measurer *)$p)->measureIteration()  ; #} 
  ())

(defmethod  torch_Measurer  measureEnd ()
  
  #{ ((Torch::Measurer *)$p)->measureEnd()  ; #} 
  ())

(defmethod  torch_Measurer  reset ()
  
  #{ ((Torch::Measurer *)$p)->reset()  ; #} 
  ())

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






;;class Parameters : public Object
(defclass  torch_Parameters   torch_Object)

(defmethod  torch_Parameters  get_data ()
  
  (gptr #{ ((Torch::Parameters *)$p)->data   #} ))        ;; double **  -> gptr

(defmethod  torch_Parameters  set_data (s )
  
  ((-gptr- "double **") s)  
  #{ ((Torch::Parameters *)$p)->data = $s  ; #} 
  ())

(defmethod  torch_Parameters  get_n_data ()
  
  (int #{ ((Torch::Parameters *)$p)->n_data   #} ))

(defmethod  torch_Parameters  set_n_data (s )
  
  ((-int-) s)  
  #{ ((Torch::Parameters *)$p)->n_data = $s  ; #} 
  ())

(defmethod  torch_Parameters  get_size ()
  
  (gptr #{ ((Torch::Parameters *)$p)->size   #} ))        ;; int *  -> gptr

(defmethod  torch_Parameters  set_size (s )
  
  ((-gptr- "int *") s)  
  #{ ((Torch::Parameters *)$p)->size = $s  ; #} 
  ())

(defmethod  torch_Parameters  get_n_params ()
  
  (int #{ ((Torch::Parameters *)$p)->n_params   #} ))

(defmethod  torch_Parameters  set_n_params (s )
  
  ((-int-) s)  
  #{ ((Torch::Parameters *)$p)->n_params = $s  ; #} 
  ())

;;(defmethod  torch_Parameters  torch_Parameters ( flag )
;;  ((-bool-) flag)
;;  
;;  #{ if($flag == 0) {
;;            $shell_flag = 0;
;;            $p = new Torch::Parameters(); 
;;     }
;;  #} 
;;  ())

(defmethod  torch_Parameters  torch_Parameters ( flag n_params_ )
  ((-bool-) flag)
  
  ((-int-) n_params_)  
  #{ if($flag == false) {
            $shell_flag = false;
            $p = new Torch::Parameters($n_params_); 
     }
     else 
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_Parameters  addParameters (params  n_params_  do_copy )
  
  ((-gptr- "double *") params)  
  ((-int-) n_params_)  
  ((-bool-) do_copy)  
  #{ ((Torch::Parameters *)$p)->addParameters($params  ,$n_params_  ,$do_copy)  ; #} 
  ())

(defmethod  torch_Parameters  add (params  do_copy )
  
  ((-gptr- "Torch::Parameters *") params)  
  ((-bool-) do_copy)  
  #{ ((Torch::Parameters *)$p)->add($params  ,$do_copy)  ; #} 
  ())

(defmethod  torch_Parameters  copy (from )
  
  ((-gptr- "Torch::Parameters *") from)  
  #{ ((Torch::Parameters *)$p)->copy($from)  ; #} 
  ())

(defmethod  torch_Parameters  copyFrom (vec )
  
  ((-gptr- "double *") vec)  
  #{ ((Torch::Parameters *)$p)->copyFrom($vec)  ; #} 
  ())

(defmethod  torch_Parameters  copyTo (vec )
  
  ((-gptr- "double *") vec)  
  #{ ((Torch::Parameters *)$p)->copyTo($vec)  ; #} 
  ())

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

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

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




;;class Perm : public Object
(defclass  torch_Perm   torch_Object)

(defmethod  torch_Perm  get_n ()
  
  (int #{ ((Torch::Perm *)$p)->n   #} ))

(defmethod  torch_Perm  set_n (s )
  
  ((-int-) s)  
  #{ ((Torch::Perm *)$p)->n = $s  ; #} 
  ())

(defmethod  torch_Perm  get_ptr ()
  
  (gptr #{ ((Torch::Perm *)$p)->ptr   #} ))        ;; int *  -> gptr

(defmethod  torch_Perm  set_ptr (s )
  
  ((-gptr- "int *") s)  
  #{ ((Torch::Perm *)$p)->ptr = $s  ; #} 
  ())

(defmethod  torch_Perm  torch_Perm ( flag n_dim )
  ((-bool-) flag)
  
  ((-int-) n_dim)  
  #{ if($flag == false ) {
            $shell_flag = false;
            $p = new Torch::Perm($n_dim); 
     }
     else 
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_Perm  copy (perm )
  
  ((-gptr- "Torch::Perm *") perm)  
  #{ ((Torch::Perm *)$p)->copy($perm)  ; #} 
  ())

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




;;class PreProcessing : public Object
(defclass  torch_PreProcessing   torch_Object)

(defmethod  torch_PreProcessing  torch_PreProcessing ( flag )
  ((-bool-) flag)
  
;;  #{ if($flag == 0) {
;;            $shell_flag = 0;
;;            $p = new Torch::PreProcessing(); 
;;     }
;;  #} 
  ())

(defmethod  torch_PreProcessing  -destructor  ()
  
;;  #{ if ( $shell_flag == 0 )  delete  ((Torch::PreProcessing *)$p);   #} 
  ())





;;class QCCache : public Object
(defclass  torch_QCCache   torch_Object)

(defmethod  torch_QCCache  torch_QCCache ( flag )
  ((-bool-) flag)
  
;;  #{ if($flag == 0) {
;;            $shell_flag = 0;
;;            $p = new Torch::QCCache(); 
;;     }
;;  #} 
  ())

(defmethod  torch_QCCache  -destructor  ()
  
;;  #{ if ( $shell_flag == 0 )  delete  ((Torch::QCCache *)$p);   #} 
  ())










;;class Stack : public Object
(defclass  torch_Stack   torch_Object)

(defmethod  torch_Stack  get_stack ()
  
  (gptr #{ ((Torch::Stack *)$p)->stack   #} ))        ;; StackNode *  -> gptr

(defmethod  torch_Stack  set_stack (s )
  
  ((-gptr- "Torch::StackNode *") s)  
  #{ ((Torch::Stack *)$p)->stack = $s  ; #} 
  ())

(defmethod  torch_Stack  get_n_stacked_objects ()
  
  (int #{ ((Torch::Stack *)$p)->n_stacked_objects   #} ))

(defmethod  torch_Stack  set_n_stacked_objects (s )
  
  ((-int-) s)  
  #{ ((Torch::Stack *)$p)->n_stacked_objects = $s  ; #} 
  ())

(defmethod  torch_Stack  torch_Stack ( flag )
  ((-bool-) flag)
  
  #{ if($flag == false) {
            $shell_flag = false;
            $p = new Torch::Stack(); 
     }
     else 
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_Stack  push (ptr  size )
  
  ((-gptr-) ptr)  
  ((-int-) size)  
  #{ ((Torch::Stack *)$p)->push($ptr  ,$size)  ; #} 
  ())

(defmethod  torch_Stack  pop ()
  
  #{ ((Torch::Stack *)$p)->pop()  ; #} 
  ())

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







;;class Timer : public Object
(defclass  torch_Timer   torch_Object)

(defmethod  torch_Timer  get_is_running ()
  
  (bool #{ ((Torch::Timer *)$p)->is_running   #} ))

(defmethod  torch_Timer  set_is_running (s )
  
  ((-bool-) s)  
  #{ ((Torch::Timer *)$p)->is_running = $s  ; #} 
  ())

(defmethod  torch_Timer  get_total_time ()
  
  (double #{ ((Torch::Timer *)$p)->total_time   #} ))

(defmethod  torch_Timer  set_total_time (s )
  
  ((-double-) s)  
  #{ ((Torch::Timer *)$p)->total_time = $s  ; #} 
  ())

(defmethod  torch_Timer  get_start_time ()
  
  (double #{ ((Torch::Timer *)$p)->start_time   #} ))

(defmethod  torch_Timer  set_start_time (s )
  
  ((-double-) s)  
  #{ ((Torch::Timer *)$p)->start_time = $s  ; #} 
  ())

(defmethod  torch_Timer  torch_Timer ( flag )
  ((-bool-) flag)
  
  #{ if($flag == false) {
            $shell_flag = false;
            $p = new Torch::Timer(); 
     }
     else 
            $shell_flag = true;
  #} 
  ())

(defmethod  torch_Timer  reset ()
  
  #{ ((Torch::Timer *)$p)->reset()  ; #} 
  ())

(defmethod  torch_Timer  stop ()
  
  #{ ((Torch::Timer *)$p)->stop()  ; #} 
  ())

(defmethod  torch_Timer  resume ()
  
  #{ ((Torch::Timer *)$p)->resume()  ; #} 
  ())

(defmethod  torch_Timer  getTime ()
  
  (double #{ ((Torch::Timer *)$p)->getTime()  #} ))

(defmethod  torch_Timer  getRunTime ()
  
  (double #{ Torch::Timer::getRunTime()  #} ))

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







;;class Trainer : public Object
(defclass  torch_Trainer   torch_Object)

(defmethod  torch_Trainer  get_machine ()
  
  (gptr #{ ((Torch::Trainer *)$p)->machine   #} ))        ;; Machine *  -> gptr

(defmethod  torch_Trainer  set_machine (s )
  
  ((-gptr- "Torch::Machine *") s)  
  #{ ((Torch::Trainer *)$p)->machine = $s  ; #} 
  ())

(defmethod  torch_Trainer  torch_Trainer ( flag machine_ )
  ((-bool-) flag)
  ((-gptr- "Torch::Machine *") machine_)  
  ())

(defmethod  torch_Trainer  test (measurers )
  
  ((-gptr- "Torch::MeasurerList *") measurers)  
  #{ ((Torch::Trainer *)$p)->test($measurers)  ; #} 
  ())

(defmethod  torch_Trainer  extractMeasurers (measurers  train  datas  meas  n_meas  n_datas )
  
  ((-gptr- "Torch::MeasurerList *") measurers)  
  ((-gptr- "Torch::DataSet *") train)  
  ((-gptr- "Torch::DataSet ***") datas)  
  ((-gptr- "Torch::Measurer ****") meas)  
  ((-gptr- "int **") n_meas)  
  ((-gptr- "int *") n_datas)  
  (gptr #{ Torch::Trainer::extractMeasurers($measurers  ,$train  ,$datas  ,$meas  ,$n_meas  ,$n_datas)  #} ))        ;; Allocator *  -> gptr

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

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

(defmethod  torch_Trainer  -destructor  ()
  ())




;;class Vec : public Object
(defclass  torch_Vec   torch_Object)

(defmethod  torch_Vec  get_n ()
  
  (int #{ ((Torch::Vec *)$p)->n   #} ))

(defmethod  torch_Vec  set_n (s )
  
  ((-int-) s)  
  #{ ((Torch::Vec *)$p)->n = $s  ; #} 
  ())

(defmethod  torch_Vec  get_ptr ()
  
  (gptr #{ ((Torch::Vec *)$p)->ptr   #} ))        ;; double *  -> gptr

(defmethod  torch_Vec  set_ptr (s )
  
  ((-gptr- "double *") s)  
  #{ ((Torch::Vec *)$p)->ptr = $s  ; #} 
  ())

;;(defmethod  torch_Vec  torch_Vec ( flag ptr_  n_dim )
;;  ((-bool-) flag)
  
;;  ((-gptr- "double *") ptr_)  
;;  ((-int-) n_dim)  
;;  #{ if($flag == 0) {
;;            $shell_flag = 0;
;;            $p = new Torch::Vec($ptr_  ,$n_dim); 
;;     }
;;  #} 
;;  ())

(defmethod  torch_Vec  torch_Vec ( flag n_dim )
  ((-bool-) flag)
  
  ((-int-) n_dim)  
  #{ if($flag == false ) {
            $shell_flag = false;
            $p = new Torch::Vec($n_dim); 
     }
     else 
            $shell_flag = true; 
  #} 
  ())

(defmethod  torch_Vec  copy (vec  start_i )
  
  ((-gptr- "Torch::Vec *") vec)  
  ((-int-) start_i)  
  #{ ((Torch::Vec *)$p)->copy($vec  ,$start_i)  ; #} 
  ())

(defmethod  torch_Vec  zero ()
  
  #{ ((Torch::Vec *)$p)->zero()  ; #} 
  ())

(defmethod  torch_Vec  norm1 (weights )
  
  ((-gptr- "Torch::Vec *") weights)  
  (double #{ ((Torch::Vec *)$p)->norm1($weights)  #} ))

(defmethod  torch_Vec  norm2 (weights )
  
  ((-gptr- "Torch::Vec *") weights)  
  (double #{ ((Torch::Vec *)$p)->norm2($weights)  #} ))

(defmethod  torch_Vec  normInf ()
  
  (double #{ ((Torch::Vec *)$p)->normInf()  #} ))

(defmethod  torch_Vec  iP (vec  start_i )
  
  ((-gptr- "Torch::Vec *") vec)  
  ((-int-) start_i)  
  (double #{ ((Torch::Vec *)$p)->iP($vec  ,$start_i)  #} ))

(defmethod  torch_Vec  subVec (dim1  dim2 )
  
  ((-int-) dim1)  
  ((-int-) dim2)  
  (gptr #{ ((Torch::Vec *)$p)->subVec($dim1  ,$dim2)  #} ))        ;; Vec *  -> gptr

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




;;class XFile : public Object
(defclass  torch_XFile   torch_Object)

(defmethod  torch_XFile  torch_XFile ( flag )
  ((-bool-) flag)
  
;;  #{ if($flag == 0) {
;;            $shell_flag = 0;
;;            $p = new Torch::XFile(); 
;;     }
;;  #} 
  ())

(defmethod  torch_XFile  taggedRead (ptr  block_size  n_blocks  tag )
  
  ((-gptr-) ptr)  
  ((-int-) block_size)  
  ((-int-) n_blocks)  
  ((-gptr- "const char *") tag)  
  (int #{ ((Torch::XFile *)$p)->taggedRead($ptr  ,$block_size  ,$n_blocks  ,$tag)  #} ))

(defmethod  torch_XFile  taggedWrite (ptr  block_size  n_blocks  tag )
  
  ((-gptr-) ptr)  
  ((-int-) block_size)  
  ((-int-) n_blocks)  
  ((-gptr- "const char *") tag)  
  (int #{ ((Torch::XFile *)$p)->taggedWrite($ptr  ,$block_size  ,$n_blocks  ,$tag)  #} ))

(defmethod  torch_XFile  -destructor  ()
  
;;  #{ if ( $shell_flag == 0 )  delete  ((Torch::XFile *)$p);   #} 
  ())


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

(dhc-make-with-c++ () (list torch-libtorch) 
  dummy_level1
  (torch_classformat  -destructor  torch_classformat  set_class_labels  get_class_labels  set_n_classes  get_n_classes)
;; overloaded: torch_sequence torch_sequence
  (torch_sequence  -destructor  loadxfile  savexfile  clone  getframesspace  getsequencespace  copyto  copyfrom  copy  add  addframe  resize frames_getval frames_setval  torch_sequence  set_frame_size  get_frame_size  set_n_frames  get_n_frames  set_frames  get_frames  set_n_real_frames  get_n_real_frames)
  (torch_dataset  -destructor  popsubset  pushsubset  setexample  init  torch_dataset  set_n_real_examples  get_n_real_examples  set_n_examples  get_n_examples  set_targets  get_targets  set_inputs  get_inputs  set_real_current_example_index  get_real_current_example_index  set_n_targets  get_n_targets  set_n_inputs  get_n_inputs  set_selected_examples  get_selected_examples  set_select_examples  get_select_examples  set_pushed_examples  get_pushed_examples  set_n_subsets  get_n_subsets  set_n_examples_subsets  get_n_examples_subsets  set_subsets  get_subsets)
  (torch_editdistance  -destructor  reset  printratio  print  add  distance  setcosts  torch_editdistance  set_des_size  get_des_size  set_desired  get_desired  set_obt_size  get_obt_size  set_obtained  get_obtained  set_subst_cost  get_subst_cost  set_delete_cost  get_delete_cost  set_insert_cost  get_insert_cost  set_n_seq  get_n_seq  set_n_subst  get_n_subst  set_n_delete  get_n_delete  set_n_insert  get_n_insert  set_accuracy  get_accuracy)
  (torch_iosequence  -destructor  torch_iosequence  set_frame_size  get_frame_size  set_n_sequences  get_n_sequences)
  (torch_iosequencearray  -destructor  write  read  torch_iosequencearray)
  (torch_kfold  -destructor  sample  crossvalidate  torch_kfold  set_kfold  get_kfold  set_trainer  get_trainer  set_n_test_subsets  get_n_test_subsets  set_n_train_subsets  get_n_train_subsets  set_test_subsets  get_test_subsets  set_train_subsets  get_train_subsets)
  (torch_kernel  -destructor  torch_kernel)
  (torch_machine  -destructor  setdataset  reset  torch_machine  set_outputs  get_outputs)
;; overloaded : torch_mat
  (torch_mat  -destructor  submat  setcol  setrow  getcol  getrow  norminf  normfrobenius  norm1  zero  copy  torch_mat  set_base  get_base  set_ptr  get_ptr  set_m  get_m  set_n  get_n)
  (torch_measurer  -destructor  reset  measureend  measureiteration  measureexample  torch_measurer  set_binary_mode  get_binary_mode  set_data  get_data  set_file  get_file)
;; overloaded : torch_parameters
  (torch_parameters  -destructor  loadxfile  savexfile  copyto  copyfrom  copy  add  addparameters  torch_parameters  set_n_params  get_n_params  set_size  get_size  set_n_data  get_n_data  set_data  get_data)
  (torch_perm  -destructor  copy  torch_perm  set_ptr  get_ptr  set_n  get_n)
  (torch_preprocessing  -destructor  torch_preprocessing)
  (torch_qccache  -destructor  torch_qccache)
  (torch_stack  -destructor  pop  push  torch_stack  set_n_stacked_objects  get_n_stacked_objects  set_stack  get_stack)
  (torch_timer  -destructor  getruntime  gettime  resume  stop  reset  torch_timer  set_start_time  get_start_time  set_total_time  get_total_time  set_is_running  get_is_running)
  (torch_trainer  -destructor  savexfile  loadxfile  extractmeasurers  test  torch_trainer  set_machine  get_machine)
;; overloaded : torch_vec
  (torch_vec  -destructor  subvec  ip  norminf  norm2  norm1  zero  copy  torch_vec  set_ptr  get_ptr  set_n  get_n)
  (torch_xfile  -destructor  taggedwrite  taggedread  torch_xfile)
)
