~ubuntu-branches/ubuntu/maverick/speech-tools/maverick

« back to all changes in this revision

Viewing changes to wrappers/interface/EST_TVector.i

  • Committer: Bazaar Package Importer
  • Author(s): Kumar Appaiah, Kartik Mistry, Kumar Appaiah
  • Date: 2010-07-17 11:32:04 UTC
  • mfrom: (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100717113204-mnse3jo236j107q8
Tags: 1:2.0.95~beta-1
[ Kartik Mistry ]
* debian/control:
  + [Lintian] Added missing ${misc:Depends}
  + Updated Standards-Version to 3.8.4 (no changes needed)
* debian/patches/const_char.diff:
  + Added missing patch header
* Removed unused patch invalid_const_char_conversion_fixes.diff

[ Kumar Appaiah ]
* New upstream release.
* Standards Version is now 3.9.0 (No changes needed)
* Update debian/rules to specify version numbers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*************************************************************************/
 
2
/*                                                                       */
 
3
/*                Centre for Speech Technology Research                  */
 
4
/*                 (University of Edinburgh, UK) and                     */
 
5
/*                           Korin Richmond                              */
 
6
/*                         Copyright (c) 2003                            */
 
7
/*                         All Rights Reserved.                          */
 
8
/*                                                                       */
 
9
/*  Permission is hereby granted, free of charge, to use and distribute  */
 
10
/*  this software and its documentation without restriction, including   */
 
11
/*  without limitation the rights to use, copy, modify, merge, publish,  */
 
12
/*  distribute, sublicense, and/or sell copies of this work, and to      */
 
13
/*  permit persons to whom this work is furnished to do so, subject to   */
 
14
/*  the following conditions:                                            */
 
15
/*                                                                       */
 
16
/*   1. The code must retain the above copyright notice, this list of    */
 
17
/*      conditions and the following disclaimer.                         */
 
18
/*   2. Any modifications must be clearly marked as such.                */
 
19
/*   3. Original authors' names are not deleted.                         */
 
20
/*   4. The authors' names are not used to endorse or promote products   */
 
21
/*      derived from this software without specific prior written        */
 
22
/*      permission.                                                      */
 
23
/*                                                                       */
 
24
/*  THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK        */
 
25
/*  DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING      */
 
26
/*  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT   */
 
27
/*  SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE     */
 
28
/*  FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES    */
 
29
/*  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN   */
 
30
/*  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,          */
 
31
/*  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF       */
 
32
/*  THIS SOFTWARE.                                                       */
 
33
/*                                                                       */
 
34
/*************************************************************************/
 
35
/*                                                                       */
 
36
/*                   Author :  Korin Richmond                            */
 
37
/*                     Date :  28 August 2003                            */
 
38
/* -------------------------------------------------------------------   */
 
39
/* SWIG interface file for EST_TVector template class                    */
 
40
/* (Primarily meant to be included in other interface files where        */
 
41
/* instantiation and/or inheritance take place)                          */
 
42
/*                                                                       */
 
43
/*************************************************************************/
 
44
 
 
45
%{
 
46
#include "EST_TVector.h"
 
47
%}
 
48
 
 
49
template <class T> 
 
50
class EST_TVector 
 
51
{
 
52
public:
 
53
  EST_TVector(); 
 
54
  EST_TVector(const EST_TVector<T> &v); 
 
55
 
 
56
  // "size" constructor - make vector of size n.
 
57
  EST_TVector(int n); 
 
58
 
 
59
  // construct from memory supplied by caller
 
60
  EST_TVector(int, T *memory, int offset=0, int free_when_destroyed=0);
 
61
 
 
62
  ~EST_TVector();
 
63
 
 
64
  void resize(int n, int set=1); 
 
65
 
 
66
  // number of items in vector.
 
67
  int num_columns() const;
 
68
  int length() const;
 
69
  int n() const;
 
70
 
 
71
  // access without bounds checking
 
72
  const T &a_no_check(int n);
 
73
  const T &a_no_check_1(int n);
 
74
 
 
75
  // access with bounds checking
 
76
  const T &a_check(int n);
 
77
  const T &a(int n);
 
78
 
 
79
  // assignment operator
 
80
  //EST_TVector &operator=(const EST_TVector &s);
 
81
 
 
82
  // Fill with value v
 
83
  void fill(const T &v);
 
84
 
 
85
  // Fill with default value
 
86
  void empty();
 
87
 
 
88
  // true if equal size and all elements are equal.
 
89
  int operator == (const EST_TVector &v) const;
 
90
  // true if not equal size or a single elements isn't equal.
 
91
  int operator != (const EST_TVector &v) const;
 
92
 
 
93
 
 
94
#if defined(SWIGPYTHON)
 
95
  %rename (__setitem__) setitem;
 
96
  %rename (__getitem__) getitem;
 
97
#endif //SWIGPYTHON
 
98
 
 
99
  %extend {
 
100
    void setitem( int i, const T& val ){
 
101
      self->a_check(i) = val;
 
102
    }
 
103
    
 
104
    const T& getitem( int i ){
 
105
      return self->a_check(i);
 
106
    }
 
107
  }
 
108
 
 
109
  // Copy data in and out. Subclassed by SimpleVector for speed.
 
110
  void copy_section(T* dest, int offset=0, int num=-1) const;
 
111
  void set_section(const T* src, int offset=0, int num=-1);
 
112
};
 
113
 
 
114
template<class T>
 
115
extern ostream& operator << (ostream &st, const EST_TVector< T > &a);