File: util.h

package info (click to toggle)
mldemos 0.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 32,224 kB
  • ctags: 46,525
  • sloc: cpp: 306,887; ansic: 167,718; ml: 126; sh: 109; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 790 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef _util_H_
#define _util_H_

#include <math.h>
#include <string.h>
#include <iostream>

#ifndef KILL
#define KILL(a) {if(a!=0) {delete [] a; a = 0;}}
#endif

double getkernel(double *x1, double *x2, double lambda, const char* type, int n);
bool getfirstkernelderivative(double *x1, double *x2, double lambda, const char* type, int der_wrt, double* der_val, int n);
bool getsecondkernelderivative(double *x1, double *x2, int n, double lambda, const char *type, double **hesval);


void VectorMatrixMultipy(double *VectorA, double **MatrixB, double *Result, int n, int p);
void MatrixVectorMultipy(double **MatrixB, double *VectorA, double *Result, int cols, int rows);
double arraydot(double *x, double *y, int m);
double norm(double *x, int m);
double norm2(double *x, int m);
#endif