File: smat.meal.h

package info (click to toggle)
r-cran-pcapp 1.9-73-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 800 kB
  • sloc: cpp: 5,961; ansic: 917; sh: 13; makefile: 2
file content (109 lines) | stat: -rw-r--r-- 3,840 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
    SMat - Simple Matrix Classes v0.1beta
    Copyright (C) 2011 by Heinrich Fritz (heinrich_fritz@hotmail.com)

    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 3 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, see <http://www.gnu.org/licenses/>.
*/

//	smat.meal.h
//	Mathematical Environment Abstraction Layer

#ifndef SMAT_MEAL_H
#define SMAT_MEAL_H


////////////
//  BLAS  //
////////////

//	Level 1
	double meal_dot (const int *n, const double *dx, const int *incx, const double *dy, const int *incy);
	double meal_nrm2 (const int *n, const double *dx, const int *incx);
	void meal_scal (const int *n, const double *alpha, double *dx, const int *incx) ;
	void meal_axpy(const int *n, const double *alpha, const double *dx, const int *incx, double *dy, const int *incy) ;

//	Level 2

#ifdef IMPL_BLAS_R_CONST_ERROR
	void meal_ger (const int *m, const int *n, const double *alpha, double *x, const int *incx, double *y, const int *incy, double *a, const int *lda) ;
#else
	void meal_ger (const int *m, const int *n, const double *alpha, const double *x, const int *incx, const double *y, const int *incy, double *a, const int *lda) ;
#endif

//	Level 3
	void meal_gemm (const char *transa, const char *transb, const int *m, const int *n, const int *k, const double *alpha, const double *a, const int *lda, const double *b, const int *ldb, const double *beta, double *c, const int *ldc) ;

//////////////
//  LAPACK  //
//////////////

//svd
	void meal_gesv (const int* n, const int* nrhs, double* a, const int* lda, int* ipiv, double* b, const int* ldb, int* info) ;
	void meal_gesvd (const char* jobu, const char* jobvt, const int* m, const int* n, double* a, const int* lda, double* s, double* u, const int* ldu, double* vt, const int* ldvt, double* work, const int* lwork, int* info) ;

//invert
	void meal_geev(const char* jobvl, const char* jobvr, const int* n, double* a, const int* lda, double* wr, double* wi, double* vl, const int* ldvl, double* vr, const int* ldvr, double* work, const int* lwork, int* info) ;

/////////////////////
//	Sort Routines  //
/////////////////////

	void meal_sort (double *d, int l) ;
	void meal_sort_order (double *, int *, int) ;
	void meal_sort_order_rev (double *d, int *o, int l) ;

///////////////////////////////
//  Random Number Generator  //
///////////////////////////////

	void meal_PutRNGstate () ;
	void meal_GetRNGstate () ;

	double meal_unif_rand () ;
	double meal_norm_rand ();
	double meal_exp_rand  ();

//	void meal_runif (double *d, int l) ;
//	void meal_runif (double *d, int l, double dL, double dU) ;
//	void meal_runif_r (double *d, int l) ;
//	void meal_SampleNoReplace(int k, int n, int *y, int *x) ;

////////////////////////////////////
//	special values and constants  //
////////////////////////////////////

	double	meal_NaN	() ;
	double	meal_PosInf	() ;
	double	meal_NegInf	() ;
	double	meal_NaReal	() ;
	int		meal_NaInt	() ;

	double  meal_PI () ;

//////////////////////////
//	printing functions  //
//////////////////////////

	void meal_printf (const char *, ...) ;
	void meal_warning (const char *) ;
	void meal_error (const char *) ;

//////////////////
//	Exceptions  //
//////////////////

	void meal_OnException (const char * szDate, const char * szFile, int nLine) ;
	void meal_OnUException () ;

#endif	//	#ifndef SMAT_MEAL_H