Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 22053 | Differences between
and this patch

Collapse All | Expand All

(-)sp/base_class/vec_mat_aux.cc (-3 / +3 lines)
Lines 453-467 Link Here
453
	return (a.a_no_check(0,0) * a.a_no_check(1,1)) - 
453
	return (a.a_no_check(0,0) * a.a_no_check(1,1)) - 
454
	    (a.a_no_check(0,1) * a.a_no_check(1,0));
454
	    (a.a_no_check(0,1) * a.a_no_check(1,0));
455
    
455
    
456
    float p;
456
    double p;
457
    
457
    
458
    // create cofactor matrix
458
    // create cofactor matrix
459
    j = 1;
459
    j = 1;
460
    for (i = 0; i < n; ++i)
460
    for (i = 0; i < n; ++i)
461
    {
461
    {
462
	p = (float)(i + j + 2);	// because i & j should start at 1
462
	p = (double)(i + j + 2);	// because i & j should start at 1
463
	//	cout << "power " <<p << endl;
463
	//	cout << "power " <<p << endl;
464
	A[i] = pow(-1.0, p) * determinant(sub(a, i, j));
464
	A[i] = pow((double)-1.0, p) * determinant(sub(a, i, j));
465
    }
465
    }
466
    //    cout << "cofactor " << A;
466
    //    cout << "cofactor " << A;
467
    
467
    
(-)sp/config/compilers/gcc_defaults.mak (-1 / +1 lines)
Lines 45-51 Link Here
45
COMPILER_VERSION_COMMAND=$(CXX) -v 2>&1 | tail -1 | sed -e 's/^....//'
45
COMPILER_VERSION_COMMAND=$(CXX) -v 2>&1 | tail -1 | sed -e 's/^....//'
46
46
47
CFLAGS  = $(GCC_SYSTEM_OPTIONS) $(CC_OTHER_FLAGS)
47
CFLAGS  = $(GCC_SYSTEM_OPTIONS) $(CC_OTHER_FLAGS)
48
CXXFLAGS  =  $(GCC_SYSTEM_OPTIONS) -fno-implicit-templates $(CC_OTHER_FLAGS)
48
CXXFLAGS  =  $(GCC_SYSTEM_OPTIONS) $(CC_OTHER_FLAGS)
49
49
50
DEBUG_CCFLAGS   = -g
50
DEBUG_CCFLAGS   = -g
51
DEBUG_CXXFLAGS  = -g
51
DEBUG_CXXFLAGS  = -g
(-)sp/config/config.in (-1 / +1 lines)
Lines 61-67 Link Here
61
# VERBOSE=1
61
# VERBOSE=1
62
# DEBUG=1
62
# DEBUG=1
63
# PROFILE=gprof
63
# PROFILE=gprof
64
# SHARED=1
64
SHARED=1
65
65
66
## Directory specific selections which override the above
66
## Directory specific selections which override the above
67
67
(-)sp/grammar/ngram/EST_Ngrammar.cc (-2 / +2 lines)
Lines 579-585 Link Here
579
	return false;
579
	return false;
580
    }
580
    }
581
    
581
    
582
    p_num_states = (int)pow(vocab->length(),p_order-1);
582
    p_num_states = (int)pow((double)vocab->length(),(double)p_order-1);
583
    p_states = new EST_NgrammarState[p_num_states];
583
    p_states = new EST_NgrammarState[p_num_states];
584
    for (i=0; i < p_num_states; i++)
584
    for (i=0; i < p_num_states; i++)
585
	p_states[i].init(i,pred_vocab);
585
	p_states[i].init(i,pred_vocab);
Lines 597-603 Link Here
597
	return false;
597
	return false;
598
    }
598
    }
599
    
599
    
600
    p_num_states = (int)pow(vocab->length(),p_order-1);
600
    p_num_states = (int)pow((double)vocab->length(),(double)p_order-1);
601
    p_states = new EST_NgrammarState[p_num_states];
601
    p_states = new EST_NgrammarState[p_num_states];
602
    
602
    
603
    return (bool)(p_states != NULL);
603
    return (bool)(p_states != NULL);
(-)sp/grammar/ngram/ngrammar_aux.cc (-3 / +3 lines)
Lines 110-116 Link Here
110
    }
110
    }
111
  
111
  
112
  for(int r=first;r<=last;r++)
112
  for(int r=first;r<=last;r++)
113
    N[r] = exp(a)* pow((float)r, b);
113
    N[r] = exp(a)* pow((double)r, (double)b);
114
  
114
  
115
  return true;
115
  return true;
116
}
116
}
Lines 252-258 Link Here
252
		  for (i=1;i<ff.n();i++)
252
		  for (i=1;i<ff.n();i++)
253
		    total += ff(i);
253
		    total += ff(i);
254
		  
254
		  
255
		  ff[0] = pow(n.get_vocab_length(),n.order()) - total;
255
		  ff[0] = pow((double)n.get_vocab_length(),(double)n.order()) - total;
256
	      }
256
	      }
257
	}
257
	}
258
	break;
258
	break;
Lines 285-291 Link Here
285
		  double total=0;
285
		  double total=0;
286
		  for (i=1;i<ff.n();i++)
286
		  for (i=1;i<ff.n();i++)
287
		    total += ff(i);
287
		    total += ff(i);
288
		  ff[0] = pow(n.get_vocab_length(),this_order) - total;
288
		  ff[0] = pow((double)n.get_vocab_length(),(double)this_order) - total;
289
289
290
290
291
291
(-)sp/grammar/ngram/ngrammar_io.cc (-2 / +2 lines)
Lines 756-762 Link Here
756
	n.print_freqs(*ost,floor);
756
	n.print_freqs(*ost,floor);
757
    else if (n.representation() == EST_Ngrammar::backoff)
757
    else if (n.representation() == EST_Ngrammar::backoff)
758
    {
758
    {
759
	int total_ngrams = (int)pow(n.get_vocab_length(),n.order()-1);
759
	int total_ngrams = (int)pow((double)n.get_vocab_length(),(double)n.order()-1);
760
	
760
	
761
	for(i=0;i<total_ngrams;i++)
761
	for(i=0;i<total_ngrams;i++)
762
	{
762
	{
Lines 903-909 Link Here
903
	// word in the ngram is the least significant 'bit'
903
	// word in the ngram is the least significant 'bit'
904
	
904
	
905
	// number of ngrams, excluding last word, is
905
	// number of ngrams, excluding last word, is
906
	int total_ngrams = (int)pow(n.get_vocab_length(),n.order()-1);
906
	int total_ngrams = (int)pow((double)n.get_vocab_length(),(double)n.order()-1);
907
	
907
	
908
	for(i=0;i<total_ngrams;i++)
908
	for(i=0;i<total_ngrams;i++)
909
	{
909
	{
(-)sp/grammar/wfst/wfst_train.cc (-1 / +1 lines)
Lines 95-101 Link Here
95
	LISP s = NIL;
95
	LISP s = NIL;
96
	do
96
	do
97
	{
97
	{
98
	    t = ts.get();
98
	    t = (EST_String)ts.get();
99
	    id = wfst.in_symbol(t);
99
	    id = wfst.in_symbol(t);
100
	    if (id == -1)
100
	    if (id == -1)
101
	    {
101
	    {
(-)sp/include/EST_Chunk.h (-1 / +3 lines)
Lines 49-55 Link Here
49
#    define HAVE_WALLOC_H (1)
49
#    define HAVE_WALLOC_H (1)
50
#endif
50
#endif
51
51
52
#include <iostream.h>
52
using namespace std;
53
54
#include <iostream>
53
#include <limits.h>
55
#include <limits.h>
54
#include <sys/types.h>
56
#include <sys/types.h>
55
57
(-)sp/include/EST_Complex.h (-1 / +1 lines)
Lines 39-45 Link Here
39
39
40
#ifndef __EST_COMPLEX_H__
40
#ifndef __EST_COMPLEX_H__
41
#define __EST_COMPLEX_H__
41
#define __EST_COMPLEX_H__
42
42
using namespace std;
43
#include "EST_iostream.h"
43
#include "EST_iostream.h"
44
#include <math.h>
44
#include <math.h>
45
45
(-)sp/include/EST_dynamic_model.h (-1 / +1 lines)
Lines 39-45 Link Here
39
39
40
#include <stdlib.h>
40
#include <stdlib.h>
41
#include <stdio.h>
41
#include <stdio.h>
42
#include <fstream.h>
42
#include <fstream>
43
#include "EST.h"
43
#include "EST.h"
44
#include "EST_model_types.h"
44
#include "EST_model_types.h"
45
45
(-)sp/include/EST_iostream.h (-2 / +2 lines)
Lines 50-57 Link Here
50
#   include <iostream.h>
50
#   include <iostream.h>
51
#   include <strstrea.h>
51
#   include <strstrea.h>
52
#elif defined(SYSTEM_IS_UNIX)
52
#elif defined(SYSTEM_IS_UNIX)
53
#   include <iostream.h>
53
#   include <iostream>
54
#   include <strstream.h>
54
#   include <strstream>
55
#elif defined(SYSTEM_IS_WIN32)
55
#elif defined(SYSTEM_IS_WIN32)
56
#   include "win32/EST_iostream_win32.h"
56
#   include "win32/EST_iostream_win32.h"
57
#   include <strstrea.h>
57
#   include <strstrea.h>
(-)sp/include/EST_lattice_io.h (-2 / +2 lines)
Lines 40-47 Link Here
40
#ifndef __EST_LATTICE_IO_H__
40
#ifndef __EST_LATTICE_IO_H__
41
#define __EST_LATTICE_IO_H__
41
#define __EST_LATTICE_IO_H__
42
42
43
#include <String.h>
43
#include <String>
44
#include <ostream.h>
44
#include <ostream>
45
#include "sp_common_types.h"
45
#include "sp_common_types.h"
46
#include "wp_grammar.h"
46
#include "wp_grammar.h"
47
#include "EST_lattice.h"
47
#include "EST_lattice.h"
(-)sp/include/EST_model_types.h (-1 / +1 lines)
Lines 39-45 Link Here
39
39
40
#include <stdlib.h>
40
#include <stdlib.h>
41
#include <stdio.h>
41
#include <stdio.h>
42
#include <fstream.h>
42
#include <fstream>
43
#include "EST.h"
43
#include "EST.h"
44
#include "EST_Handleable.h"
44
#include "EST_Handleable.h"
45
#include "EST_THandle.h"
45
#include "EST_THandle.h"
(-)sp/include/EST_String.h (-3 / +3 lines)
Lines 37-51 Link Here
37
#ifdef HAVE_CONFIG_H
37
#ifdef HAVE_CONFIG_H
38
#    include "est_string_config.h"
38
#    include "est_string_config.h"
39
#endif
39
#endif
40
40
using namespace std;
41
class EST_String;
41
class EST_String;
42
class EST_Regex;
42
class EST_Regex;
43
43
44
#define EST_Regex_max_subexpressions 10
44
#define EST_Regex_max_subexpressions 10
45
45
46
#include <string.h>
46
#include <string>
47
#ifdef NO_EST
47
#ifdef NO_EST
48
#    include <iostream.h>
48
#    include <iostream>
49
#else
49
#else
50
#    include "EST_iostream.h"
50
#    include "EST_iostream.h"
51
#endif
51
#endif
(-)sp/include/EST_THash.h (-17 / +59 lines)
Lines 35-42 Link Here
35
35
36
#ifndef __EST_THASH_H__
36
#ifndef __EST_THASH_H__
37
#define __EST_THASH_H__
37
#define __EST_THASH_H__
38
38
using namespace std;
39
#include <iostream.h>
39
#include <iostream>
40
#include "EST_String.h"
40
#include "EST_String.h"
41
#include "EST_system.h"
41
#include "EST_system.h"
42
#include "EST_bool.h"
42
#include "EST_bool.h"
Lines 274-307 Link Here
274
  * has a different default hash function.
274
  * has a different default hash function.
275
  */
275
  */
276
276
277
template<class V>  class EST_TStringHash;
278
277
template<class V>
279
template<class V>
278
class EST_TStringHash : public EST_THash<EST_String, V> {
280
class EST_StringHash_Pair {
279
public:
281
public:
282
  EST_String k;
283
  V v;
284
private:
285
  EST_StringHash_Pair<V> *next;
286
  friend class EST_TStringHash<V>;
287
};
288
289
template<class V>
290
class EST_TStringHash : public EST_THash<EST_String, V> {
291
private:
292
  static V Dummy_Value;
293
  unsigned int p_num_entries;
294
  unsigned int p_num_buckets;
295
  EST_StringHash_Pair<V> **p_buckets;
296
  unsigned int (*p_hash_function)(const EST_String &key, unsigned int size);
297
298
protected:
299
  struct IPointer_s {  unsigned int b; EST_StringHash_Pair<V> *p; };
300
  typedef struct IPointer_s IPointer;
301
  void skip_blank(IPointer &ip) const 
302
    {
303
      while (ip.p==NULL && ip.b<p_num_buckets)
304
	{ip.b++; ip.p = ip.b<p_num_buckets?p_buckets[ip.b]:0; } 
305
    }
306
  
307
  void point_to_first(IPointer &ip) const 
308
    { ip.b=0; ip.p = ip.b<p_num_buckets?p_buckets[ip.b]:0; 
309
    skip_blank(ip);}
310
311
  void move_pointer_forwards(IPointer &ip) const 
312
    { 
313
      ip.p = ip.p->next; 
314
      skip_blank(ip);
315
    }
316
317
  bool points_to_something(const IPointer &ip) const { return ip.b<p_num_buckets; }
318
319
  EST_StringHash_Pair<V> &points_at(const IPointer &ip) { return *(ip.p); }
280
320
321
  friend class EST_TStructIterator< EST_TStringHash<V>, IPointer, EST_StringHash_Pair<V> >;
322
  friend class EST_TRwStructIterator< EST_TStringHash<V>, IPointer, EST_StringHash_Pair<V> >;
323
  friend class EST_TIterator< EST_TStringHash<V>, IPointer, EST_StringHash_Pair<V> >;
324
  friend class EST_TRwIterator< EST_TStringHash<V>, IPointer, EST_StringHash_Pair<V> >;
325
326
public:
281
  /// Create a string hash table of <parameter>size</parameter> buckets.
327
  /// Create a string hash table of <parameter>size</parameter> buckets.
282
  EST_TStringHash(int size) : EST_THash<EST_String, V>(size, StringHash) {};
328
  EST_TStringHash(int size) : EST_THash<EST_String, V>(size, StringHash) {};
283
329
284
  /// An entry returned by the iterator is a key value pair.
330
  /// An entry returned by the iterator is a key value pair.
285
  typedef EST_Hash_Pair<EST_String, V> Entry;
331
  typedef EST_StringHash_Pair<V> Entry;
286
287
/*    struct IPointer_s{  unsigned int b; Entry *p; };
288
      typedef struct IPointer_s IPointer; */
289
290
332
291
  /// Give the iterator a sensible name.
333
  /// Give the iterator a sensible name.
292
  typedef EST_TStructIterator< EST_THash<EST_String, V>, IPointer, EST_Hash_Pair<EST_String, V> > Entries;
334
  typedef EST_TStructIterator< EST_TStringHash<V>, IPointer, EST_StringHash_Pair<V> > Entries;
293
335
  typedef EST_TRwStructIterator< EST_TStringHash<V>, IPointer, EST_StringHash_Pair<V> > RwEntries;
294
  typedef EST_TRwStructIterator< EST_THash<EST_String, V>, IPointer, EST_Hash_Pair<EST_String, V> > RwEntries;
295
  //@}
296
336
337
protected:
338
  struct IPointer_k_s {  unsigned int b; EST_StringHash_Pair<V> *p; };
339
  typedef struct IPointer_k_s IPointer_k;
340
  
341
public:
297
  typedef EST_String KeyEntry;
342
  typedef EST_String KeyEntry;
298
343
299
/*  struct IPointer_k_s {  unsigned int b; EST_Hash_Pair<EST_String, V> *p; };
300
    typedef struct IPointer_k_s IPointer_k; */
301
302
  /// Give the iterator a sensible name.
344
  /// Give the iterator a sensible name.
303
  typedef EST_TIterator< EST_THash<EST_String, V>, IPointer_k, EST_String > KeyEntries;
345
  typedef EST_TIterator< EST_TStringHash<V>, IPointer_k, EST_String > KeyEntries;
304
  typedef EST_TRwIterator< EST_THash<EST_String, V>, IPointer_k, EST_String > KeyRwEntries;
346
  typedef EST_TRwIterator< EST_TStringHash<V>, IPointer_k, EST_String > KeyRwEntries;
305
};
347
};
306
348
307
349
(-)sp/include/EST_TList.h (-1 / +1 lines)
Lines 43-49 Link Here
43
#ifndef __Tlist_H__
43
#ifndef __Tlist_H__
44
#define __Tlist_H__
44
#define __Tlist_H__
45
45
46
#include <iostream.h>
46
#include <iostream>
47
#include "EST_common.h"
47
#include "EST_common.h"
48
#include "EST_UList.h"
48
#include "EST_UList.h"
49
#include "EST_TSortable.h"
49
#include "EST_TSortable.h"
(-)sp/include/EST_TMatrix.h (-1 / +2 lines)
Lines 41-47 Link Here
41
#ifndef __TMatrix_H__
41
#ifndef __TMatrix_H__
42
#define __TMatrix_H__
42
#define __TMatrix_H__
43
43
44
#include <iostream.h>
44
using namespace std;
45
#include <iostream>
45
#include "EST_rw_status.h"
46
#include "EST_rw_status.h"
46
#include "EST_TVector.h"
47
#include "EST_TVector.h"
47
#include "instantiate/EST_TMatrixI.h"
48
#include "instantiate/EST_TMatrixI.h"
(-)sp/include/EST_TTimeIndex.h (-1 / +1 lines)
Lines 35-41 Link Here
35
#ifndef __EST_TTIMEINDEX_H__
35
#ifndef __EST_TTIMEINDEX_H__
36
#define __EST_TTIMEINDEX_H__
36
#define __EST_TTIMEINDEX_H__
37
37
38
#include <iostream.h>
38
#include <iostream>
39
39
40
/** A time index for a container. The container defines how to get an
40
/** A time index for a container. The container defines how to get an
41
  * object and so on, this lets you find a point in the container not
41
  * object and so on, this lets you find a point in the container not
(-)sp/include/EST_TVector.h (-1 / +2 lines)
Lines 40-46 Link Here
40
#ifndef __EST_TVector_H__
40
#ifndef __EST_TVector_H__
41
#define __EST_TVector_H__
41
#define __EST_TVector_H__
42
42
43
#include <iostream.h>
43
using namespace std;
44
#include <iostream>
44
#include "EST_bool.h"
45
#include "EST_bool.h"
45
#include "EST_rw_status.h"
46
#include "EST_rw_status.h"
46
47
(-)sp/include/EST_UList.h (-1 / +1 lines)
Lines 41-47 Link Here
41
#ifndef __EST_ULIST_H__
41
#ifndef __EST_ULIST_H__
42
#define __EST_ULIST_H__
42
#define __EST_ULIST_H__
43
43
44
#include <iostream.h>
44
#include <iostream>
45
#include "EST_common.h"
45
#include "EST_common.h"
46
#include "EST_String.h"
46
#include "EST_String.h"
47
47
(-)sp/intonation/tilt/tilt_utils.cc (-4 / +4 lines)
Lines 378-386 Link Here
378
378
379
    x = (t / (dur)) * 2.0;
379
    x = (t / (dur)) * 2.0;
380
    if (x < 1.0)
380
    if (x < 1.0)
381
	val = pow(x, 2.0);
381
	val = pow((double)x, 2.0);
382
    else
382
    else
383
	val = 2 - pow((2 - x), 2.0);
383
	val = 2 - pow((double)(2.0 - x), 2.0);
384
	
384
	
385
    val = (val / 2.0);
385
    val = (val / 2.0);
386
	
386
	
Lines 398-406 Link Here
398
    x = (t / length) * 2.0;
398
    x = (t / length) * 2.0;
399
    
399
    
400
    if (x < 1.0)
400
    if (x < 1.0)
401
	val = pow(x, curve);
401
	val = pow((double)x, (double)curve);
402
    else
402
    else
403
	val = 2 - pow((2 - x), curve);
403
	val = 2 - pow((double)(2.0 - x), (double)curve);
404
    
404
    
405
    val = val / 2.0;
405
    val = val / 2.0;
406
    
406
    
(-)sp/ling_class/EST_relation_aux.cc (-2 / +2 lines)
Lines 416-422 Link Here
416
	if (k->F("end") > lab.head()->F("end"))
416
	if (k->F("end") > lab.head()->F("end"))
417
	    break;
417
	    break;
418
418
419
    filename = k->f("file");
419
    filename = (EST_String)k->f("file");
420
    a.f.set("name", (filename + ext));
420
    a.f.set("name", (filename + ext));
421
    kstart = 0.0;
421
    kstart = 0.0;
422
    
422
    
Lines 454-460 Link Here
454
	    k = next(k);
454
	    k = next(k);
455
	    kstart = start(k);
455
	    kstart = start(k);
456
	    a.clear();
456
	    a.clear();
457
	    filename = k->f("file");
457
	    filename = (EST_String)k->f("file");
458
	    a.f.set("name", (filename + ext));
458
	    a.f.set("name", (filename + ext));
459
	}
459
	}
460
	else
460
	else
(-)sp/main/wfst_run_main.cc (-1 / +1 lines)
Lines 213-219 Link Here
213
	   (int)R.samples(),R.mean()*100,(1-R.mean())*100);
213
	   (int)R.samples(),R.mean()*100,(1-R.mean())*100);
214
    if (al.present("-perplexity"))
214
    if (al.present("-perplexity"))
215
    {
215
    {
216
	printf("perplexity is %f\n", pow(2.0,(-1 * (sumlogp/count))));
216
	printf("perplexity is %f\n", pow(2.0,(double)(-1 * (sumlogp/count))));
217
    }
217
    }
218
218
219
    if (ofd != stdout)
219
    if (ofd != stdout)
(-)sp/sigpr/filter.cc (-3 / +3 lines)
Lines 419-425 Link Here
419
	
419
	
420
    // check frequency_response has dimension 2^N
420
    // check frequency_response has dimension 2^N
421
    int N = fastlog2(frequency_response.n());
421
    int N = fastlog2(frequency_response.n());
422
    if(frequency_response.n() !=  (int)pow(2,(float)N)){
422
    if(frequency_response.n() !=  (int)pow(2,(double)N)){
423
	cerr << "Desired frequency response must have dimension 2^N" << endl;
423
	cerr << "Desired frequency response must have dimension 2^N" << endl;
424
	return EST_FVector(0);
424
	return EST_FVector(0);
425
    }
425
    }
Lines 470-479 Link Here
470
    int i;
470
    int i;
471
    int N=10;			// good minimum size
471
    int N=10;			// good minimum size
472
    
472
    
473
    int fft_size = (int)pow(2, N);
473
    int fft_size = (int)pow(2.0, (double)N);
474
    while(fft_size < order*4){	// rule of thumb !?
474
    while(fft_size < order*4){	// rule of thumb !?
475
	N++;
475
	N++;
476
	fft_size = (int)pow(2, N);
476
	fft_size = (int)pow(2.0, (double)N);
477
    }
477
    }
478
    
478
    
479
    // freq response is from 0 to sampling freq and therefore
479
    // freq response is from 0 to sampling freq and therefore
(-)sp/sigpr/sigpr_frame.cc (-1 / +1 lines)
Lines 499-505 Link Here
499
{
499
{
500
    power = 0.0;
500
    power = 0.0;
501
    for (int i = 0; i < frame.length(); i++)
501
    for (int i = 0; i < frame.length(); i++)
502
	power += pow(frame(i), 2.0);
502
	power += pow((double)frame(i), 2.0);
503
503
504
    power /= frame.length();
504
    power /= frame.length();
505
}
505
}
(-)sp/siod/slib_math.cc (-4 / +3 lines)
Lines 14-27 Link Here
14
14
15
LISP numberp(LISP x)
15
LISP numberp(LISP x)
16
{if FLONUMP(x) return(truth); else return(NIL);}
16
{if FLONUMP(x) return(truth); else return(NIL);}
17
17
static LISP lplus(LISP args)
18
static LISP plus(LISP args)
19
{
18
{
20
    LISP l;
19
    LISP l;
21
    double sum;
20
    double sum;
22
    for (sum=0.0,l=args; l != NIL; l=cdr(l))
21
    for (sum=0.0,l=args; l != NIL; l=cdr(l))
23
    {
22
    {
24
	if (NFLONUMP(car(l))) err("wrong type of argument to plus",car(l));
23
	if (NFLONUMP(car(l))) err("wrong type of argument to lplus",car(l));
25
	sum += FLONM(car(l));
24
	sum += FLONM(car(l));
26
    }
25
    }
27
    return flocons(sum);
26
    return flocons(sum);
Lines 138-144 Link Here
138
 init_subr_1("number?",numberp,
137
 init_subr_1("number?",numberp,
139
 "(number? DATA)\n\
138
 "(number? DATA)\n\
140
  Returns t if DATA is a number, nil otherwise.");
139
  Returns t if DATA is a number, nil otherwise.");
141
 init_lsubr("+",plus,
140
 init_lsubr("+",lplus,
142
 "(+ NUM1 NUM2 ...)\n\
141
 "(+ NUM1 NUM2 ...)\n\
143
  Returns the sum of NUM1 and NUM2 ...  An error is given is any argument\n\
142
  Returns the sum of NUM1 and NUM2 ...  An error is given is any argument\n\
144
  is not a number.");
143
  is not a number.");
(-)sp/speech_class/EST_track_aux.cc (-3 / +3 lines)
Lines 351-357 Link Here
351
    mean /= n;
351
    mean /= n;
352
    
352
    
353
    for (i = 0, var = 0.0; i < tr.num_frames(); ++i)
353
    for (i = 0, var = 0.0; i < tr.num_frames(); ++i)
354
	var += tr.track_break(i) ? 0.0 : pow(tr.a(i, channel) - mean, 2.0);
354
	var += tr.track_break(i) ? 0.0 : pow((double)(tr.a(i, channel) - mean), 2.0);
355
    
355
    
356
    var /= n;
356
    var /= n;
357
    sd = sqrt(var);
357
    sd = sqrt(var);
Lines 369-375 Link Here
369
    
369
    
370
    for (i = 0; i < size; ++i)
370
    for (i = 0; i < size; ++i)
371
	if (a.val(i) && b.val(i))
371
	if (a.val(i) && b.val(i))
372
	    sum += pow((a.a(i, channel) - b.a(i, channel)), 2.0);
372
	    sum += pow((double)(a.a(i, channel) - b.a(i, channel)), 2.0);
373
    
373
    
374
    sum = sqrt(sum / size);
374
    sum = sqrt(sum / size);
375
    return sum;
375
    return sum;
Lines 461-467 Link Here
461
    for (p = tl.head(); p; p = next(p))
461
    for (p = tl.head(); p; p = next(p))
462
	for (i = 0; i < tl(p).num_frames(); ++i)
462
	for (i = 0; i < tl(p).num_frames(); ++i)
463
	    if (!tl(p).track_break(i))
463
	    if (!tl(p).track_break(i))
464
		var +=  pow(tl(p).a(i, channel) - mean, 2.0);
464
		var +=  pow((double)(tl(p).a(i, channel) - mean), 2.0);
465
465
466
    var /= n;
466
    var /= n;
467
    sd = sqrt(var);
467
    sd = sqrt(var);
(-)sp/speech_class/EST_TrackFile.cc (-3 / +3 lines)
Lines 570-584 Link Here
570
    
570
    
571
    while (1)
571
    while (1)
572
    {
572
    {
573
	t = ts.get_upto_eoln();
573
	t = (EST_String)ts.get_upto_eoln();
574
	//	cout << "t=" << t << endl;
574
	//	cout << "t=" << t << endl;
575
	if (t.contains("teaching output included"))
575
	if (t.contains("teaching output included"))
576
	    teaching = 1;
576
	    teaching = 1;
577
	if (!t.contains(":"))
577
	if (!t.contains(":"))
578
	    break;
578
	    break;
579
	str.open_string(t);
579
	str.open_string(t);
580
	k = str.get_upto(":");
580
	k = (EST_String)str.get_upto(":");
581
	v = str.get_upto_eoln();
581
	v = (EST_String)str.get_upto_eoln();
582
	if (k == "No. of output units")
582
	if (k == "No. of output units")
583
	    num_channels = v.Int();
583
	    num_channels = v.Int();
584
	if (k == "No. of patterns")
584
	if (k == "No. of patterns")
(-)sp/speech_class/EST_wave_cuts.cc (-2 / +2 lines)
Lines 67-73 Link Here
67
	if (end < start)
67
	if (end < start)
68
	    continue;
68
	    continue;
69
	wave_subwave(a, sig, start, end-start);
69
	wave_subwave(a, sig, start, end-start);
70
	filename = k->f("file");
70
	filename = (EST_String)k->f("file");
71
	a.set_name(filename + ext);
71
	a.set_name(filename + ext);
72
	wl.append(a);
72
	wl.append(a);
73
	start = end;
73
	start = end;
Lines 87-93 Link Here
87
    for (k = keylab.head(); k; k = next(k))
87
    for (k = keylab.head(); k; k = next(k))
88
    {
88
    {
89
	end = k->F("end",0);
89
	end = k->F("end",0);
90
	key_file_name = k->f("file");
90
	key_file_name = (EST_String)k->f("file");
91
	if (key_file_name == file)
91
	if (key_file_name == file)
92
	{
92
	{
93
	    wave_subwave(part, sig, start, end-start);
93
	    wave_subwave(part, sig, start, end-start);
(-)sp/speech_class/EST_wave_temp.cc (-3 / +3 lines)
Lines 83-89 Link Here
83
    mean /= n;
83
    mean /= n;
84
    
84
    
85
    for (i = 0, mean = 0.0; i < tr.num_samples(); ++i)
85
    for (i = 0, mean = 0.0; i < tr.num_samples(); ++i)
86
	var += pow(tr.a(i, channel) - mean, 2.0);
86
	var += pow((double)(tr.a(i, channel) - mean), 2.0);
87
    
87
    
88
    var /= n;
88
    var /= n;
89
    sd = sqrt(var);
89
    sd = sqrt(var);
Lines 96-102 Link Here
96
    float sum = 0;
96
    float sum = 0;
97
    
97
    
98
    for (i = 0; i < size; ++i)
98
    for (i = 0; i < size; ++i)
99
      sum += pow((a.a(i, channel) - b.a(i, channel)), 2.0);
99
      sum += pow((double)(a.a(i, channel) - b.a(i, channel)), 2.0);
100
    
100
    
101
    sum = sqrt(sum / size);
101
    sum = sqrt(sum / size);
102
    return sum;
102
    return sum;
Lines 110-116 Link Here
110
    for (i = 0; i < size; ++i)
110
    for (i = 0; i < size; ++i)
111
    {
111
    {
112
      // cout << i << " " << a.a(i, channel) << " " << b.a(i, channel) << endl;
112
      // cout << i << " " << a.a(i, channel) << " " << b.a(i, channel) << endl;
113
	sum += fabs(a.a(i, channel) - b.a(i, channel));
113
	sum += fabs((double)(a.a(i, channel) - b.a(i, channel)));
114
    }
114
    }
115
    return sum / size;
115
    return sum / size;
116
}
116
}
(-)sp/speech_class/ssff.cc (-5 / +5 lines)
Lines 99-105 Link Here
99
    
99
    
100
    while (ts.peek() != "-----------------")
100
    while (ts.peek() != "-----------------")
101
    {
101
    {
102
	c = ts.get();
102
	c = (EST_String)ts.get();
103
	if (c == "Comment")
103
	if (c == "Comment")
104
	    ts.get_upto_eoln();
104
	    ts.get_upto_eoln();
105
	else if (c == "Start_Time")
105
	else if (c == "Start_Time")
Lines 124-132 Link Here
124
	}
124
	}
125
	else if (c == "Column")
125
	else if (c == "Column")
126
	{
126
	{
127
	    name = ts.get();
127
	    name = (EST_String)ts.get();
128
	    type = ts.get();
128
	    type = (EST_String)ts.get();
129
	    size = ts.get();
129
	    size = (EST_String)ts.get();
130
	    cname = EST_String("Channel_")+itoString(num_channels);
130
	    cname = EST_String("Channel_")+itoString(num_channels);
131
	    channels.set(cname+".name",name);
131
	    channels.set(cname+".name",name);
132
	    channels.set(cname+".type",type);
132
	    channels.set(cname+".type",type);
Lines 141-147 Link Here
141
		 (c == "preemphasis") ||
141
		 (c == "preemphasis") ||
142
		 (c == "frame_duration"))
142
		 (c == "frame_duration"))
143
	{
143
	{
144
		type = ts.get();
144
		type = (EST_String)ts.get();
145
		if (type == "SHORT")
145
		if (type == "SHORT")
146
		    tr.f_set(c,atoi(ts.get().string()));
146
		    tr.f_set(c,atoi(ts.get().string()));
147
		else if (type == "DOUBLE")
147
		else if (type == "DOUBLE")
(-)sp/stats/EST_multistats.cc (-3 / +3 lines)
Lines 89-95 Link Here
89
    {
89
    {
90
	v[j] = 0.0;
90
	v[j] = 0.0;
91
	for (i = 0; i < m.num_rows(); ++i)
91
	for (i = 0; i < m.num_rows(); ++i)
92
	    v[j] += pow(m(i, j) - u(j), 2.0);
92
	    v[j] += pow((double)(m(i, j) - u(j)), 2.0);
93
	v[j] /= m.num_rows() - 1; // sample variance
93
	v[j] /= m.num_rows() - 1; // sample variance
94
    }
94
    }
95
    
95
    
Lines 183-189 Link Here
183
	{
183
	{
184
	    P(i, j) = 0.0;
184
	    P(i, j) = 0.0;
185
	    for (k = 0; k < p; ++k)
185
	    for (k = 0; k < p; ++k)
186
		P(i, j) += pow(gu(i, k) - gu(j, k), 2.0) / gv(k);
186
		P(i, j) += pow((double)(gu(i, k) - gu(j, k)), 2.0) / gv(k);
187
	    P(i, j) /= p;
187
	    P(i, j) /= p;
188
	}
188
	}
189
    return P;
189
    return P;
Lines 228-234 Link Here
228
    float P = 0.0;
228
    float P = 0.0;
229
    
229
    
230
    for (k = 0; k < n; ++k)
230
    for (k = 0; k < n; ++k)
231
	P += pow(ui(k) - uj(k), 2.0) / v(k);
231
	P += pow((double)(ui(k) - uj(k)), 2.0) / v(k);
232
    P /= n;
232
    P /= n;
233
    
233
    
234
    return P;
234
    return P;
(-)sp/stats/wagon/dlist.cc (-1 / +1 lines)
Lines 83-89 Link Here
83
83
84
    for (p=dataset.head(); p != 0; p=next(p))
84
    for (p=dataset.head(); p != 0; p=next(p))
85
    {
85
    {
86
	predict = dlist->predict(*dataset(p));
86
	predict = (EST_String)dlist->predict(*dataset(p));
87
	type = dataset.ftype(0);
87
	type = dataset.ftype(0);
88
	real = wgn_discretes[type].name(dataset(p)->get_int_val(0));
88
	real = wgn_discretes[type].name(dataset(p)->get_int_val(0));
89
	pairs.add_item(real,predict,1);
89
	pairs.add_item(real,predict,1);
(-)sp/stats/wagon/wagon.cc (-1 / +1 lines)
Lines 276-282 Link Here
276
    for (p=dataset.head(); p != 0; p=next(p))
276
    for (p=dataset.head(); p != 0; p=next(p))
277
    {
277
    {
278
	pnode = tree.predict_node((*dataset(p)));
278
	pnode = tree.predict_node((*dataset(p)));
279
	predict = pnode->get_impurity().value();
279
	predict = (EST_String)pnode->get_impurity().value();
280
	if (wgn_count_field == -1)
280
	if (wgn_count_field == -1)
281
	    count = 1.0;
281
	    count = 1.0;
282
	else
282
	else
(-)sp/testsuite/hash_example.cc (-2 / +2 lines)
Lines 71-78 Link Here
71
71
72
EST_THash<int,float> logs(100);
72
EST_THash<int,float> logs(100);
73
73
74
logs.add_item(12, log(12));
74
logs.add_item(12, log(12.0));
75
logs.add_item(34, log(34));
75
logs.add_item(34, log(34.0));
76
76
77
cout << "length of `fred' = " << lengths.val("fred") << "\n";
77
cout << "length of `fred' = " << lengths.val("fred") << "\n";
78
cout << "log of 34' = " << logs.val(34) << "\n";
78
cout << "log of 34' = " << logs.val(34) << "\n";
(-)sp/testsuite/hash_regression.cc (-1 / +1 lines)
Lines 71-77 Link Here
71
  {
71
  {
72
    EST_String line;
72
    EST_String line;
73
73
74
    line = file.get();
74
    line = (EST_String)file.get();
75
75
76
    if (file.eof())
76
    if (file.eof())
77
      break;
77
      break;
(-)sp/utils/EST_ServiceTable.cc (-4 / +4 lines)
Lines 42-49 Link Here
42
#include "EST_error.h"
42
#include "EST_error.h"
43
#include "EST_Token.h"
43
#include "EST_Token.h"
44
#include "EST_ServiceTable.h"
44
#include "EST_ServiceTable.h"
45
#include <iomanip.h>
45
#include <iomanip>
46
#include <iostream.h>
46
#include <iostream>
47
#include <time.h>
47
#include <time.h>
48
48
49
#if defined(SYSTEM_IS_WIN32)
49
#if defined(SYSTEM_IS_WIN32)
Lines 142-148 Link Here
142
142
143
      str.must_get("=");
143
      str.must_get("=");
144
144
145
      EST_Token val = str.get_upto_eoln();
145
      EST_String val = str.get_upto_eoln();
146
146
147
      if (!entries.t.present(name))
147
      if (!entries.t.present(name))
148
	{
148
	{
Lines 160-166 Link Here
160
      else if (type=="type")
160
      else if (type=="type")
161
	entry.type=val;
161
	entry.type=val;
162
      else if (type=="port")
162
      else if (type=="port")
163
	entry.port=val;
163
	entry.port=strtol(val, NULL, 10);
164
      else if (type=="cookie")
164
      else if (type=="cookie")
165
	entry.cookie=val;
165
	entry.cookie=val;
166
      else
166
      else

Return to bug 22053