1
/*************************************************************************/
3
/* Centre for Speech Technology Research */
4
/* (University of Edinburgh, UK) and */
6
/* Copyright (c) 2003 */
7
/* All Rights Reserved. */
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: */
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 */
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 */
34
/*************************************************************************/
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) */
43
/*************************************************************************/
46
#include "EST_TVector.h"
54
EST_TVector(const EST_TVector<T> &v);
56
// "size" constructor - make vector of size n.
59
// construct from memory supplied by caller
60
EST_TVector(int, T *memory, int offset=0, int free_when_destroyed=0);
64
void resize(int n, int set=1);
66
// number of items in vector.
67
int num_columns() const;
71
// access without bounds checking
72
const T &a_no_check(int n);
73
const T &a_no_check_1(int n);
75
// access with bounds checking
76
const T &a_check(int n);
79
// assignment operator
80
//EST_TVector &operator=(const EST_TVector &s);
83
void fill(const T &v);
85
// Fill with default value
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;
94
#if defined(SWIGPYTHON)
95
%rename (__setitem__) setitem;
96
%rename (__getitem__) getitem;
100
void setitem( int i, const T& val ){
101
self->a_check(i) = val;
104
const T& getitem( int i ){
105
return self->a_check(i);
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);
115
extern ostream& operator << (ostream &st, const EST_TVector< T > &a);