2
* This file is part of TISEAN
4
* Copyright (c) 1998-2007 Rainer Hegger, Holger Kantz, Thomas Schreiber
6
* TISEAN is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* TISEAN is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with TISEAN; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
/* Author: Rainer Hegger
21
* Modified: Piotr Held <pjheld@gmail.com> (2015).
24
#ifndef _TSA_ROUTINES_H
25
#define _TSA_ROUTINES_H
27
#include <octave/oct.h>
30
#include "tisean_cec.h"
34
#include "TISEAN_rand.h"
37
/* size of the string which reads the input data
38
if your lines are longer than some 500 reals, increase the value
40
#define INPUT_SIZE 1024
42
/* The possible names of the verbosity levels */
50
#define VER_FIRST_LINE 0x80
52
/* Uncomment the variable to get rid of the initial Version message */
53
/*#define OMIT_WHAT_I_DO*/
55
#define sqr(x) ((x)*(x))
57
extern void check_alloc(void *);
58
extern void variance(const NDArray &,octave_idx_type,double *,double *);
60
extern void rescale_data(Matrix &x,octave_idx_type,octave_idx_type,\
62
extern void rescale_data(NDArray &x,octave_idx_type, double *,double *);
64
extern octave_idx_type exclude_interval(octave_idx_type,long,long,
65
unsigned long*,octave_idx_type*);
67
extern octave_idx_type find_multi_neighbors(const Matrix &,
68
const MArray<octave_idx_type> &,
70
octave_idx_type, octave_idx_type,
71
octave_idx_type, octave_idx_type,
72
double,unsigned long *);
73
extern octave_idx_type find_multi_neighbors(const double **,
75
long *,const double **,
76
octave_idx_type, octave_idx_type,
77
octave_idx_type, octave_idx_type,
78
double,unsigned long *);
80
extern octave_idx_type find_neighbors(double *,octave_idx_type **,
81
octave_idx_type *, double *,
82
octave_idx_type, octave_idx_type,
83
octave_idx_type, octave_idx_type,
84
double eps, octave_idx_type *);
86
extern void make_box(double *,octave_idx_type **,octave_idx_type *,
87
octave_idx_type , octave_idx_type , octave_idx_type ,
88
octave_idx_type , double);
90
extern void make_multi_box(const Matrix &,MArray<octave_idx_type> &,
91
long *,octave_idx_type,octave_idx_type,
92
octave_idx_type,octave_idx_type,
93
octave_idx_type,double);
94
extern void make_multi_box(const double **,octave_idx_type **,
95
long *,octave_idx_type,octave_idx_type,
96
octave_idx_type,octave_idx_type,
97
octave_idx_type,double);
99
extern void solvele(double**,double *,octave_idx_type);
101
extern void invert_matrix(double**,double **,octave_idx_type);
102
/* routines from eigen.cc */
103
extern void eigen(double**,octave_idx_type,double*);
108
extern int scan_help(int,char**);
109
extern double *get_series(char *,unsigned long *,unsigned long,
110
unsigned int,unsigned int);
111
extern double **get_multi_series(char *,unsigned long *,unsigned long,
112
unsigned int *,char *,char,unsigned int);
114
extern char* search_datafile(int, char**,unsigned int*,unsigned int);
115
extern char* check_option(char**,int,int,int);
117
extern void test_outfile(char*);
120
extern unsigned int** make_multi_index(unsigned int,unsigned int,unsigned int);
121
/*only used for nrlazy. Will be removed with nrlazy */
122
extern void make_multi_box2(double **,long **,long *,unsigned long,
123
unsigned int,unsigned int,unsigned int,
124
unsigned int,double);
128
extern char* myfgets(char *,int *,FILE *,unsigned int);
129
extern void what_i_do(char *, char *);
130
extern double* rand_arb_dist(double *,unsigned long,unsigned long,
131
unsigned int,unsigned long);
133
/* routines from rand.c */
134
extern void rnd_init(unsigned long);
135
extern unsigned long rnd_long();
136
extern unsigned long rnd_1279();
137
extern unsigned long rnd69069();
138
extern double gaussian(double);