projects
/
morpheus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert to previous x_init settings in optimParams (keeping the initial one)
[morpheus.git]
/
pkg
/
src
/
functions.c
diff --git
a/pkg/src/functions.c
b/pkg/src/functions.c
index
e534c57
..
b634c98
100644
(file)
--- a/
pkg/src/functions.c
+++ b/
pkg/src/functions.c
@@
-1,16
+1,10
@@
#include <stdlib.h>
// Index matrix (by columns)
#include <stdlib.h>
// Index matrix (by columns)
-int mi(int i, int j, int d1, int d2)
-{
- return j*d1 + i;
-}
+#define mi(i, j, d1, d2) (j*d1 + i)
// Index 3-tensor (by columns, matrices ordered by last dim)
// Index 3-tensor (by columns, matrices ordered by last dim)
-int ti(int i, int j, int k, int d1, int d2, int d3)
-{
- return k*d1*d2 + j*d1 + i;
-}
+#define ti(i, j, k, d1, d2, d3) (k*d1*d2 + j*d1 + i)
// Empirical cross-moment of order 2 between X size nxd and Y size n
void Moments_M2(double* X, double* Y, int* pn, int* pd, double* M2)
// Empirical cross-moment of order 2 between X size nxd and Y size n
void Moments_M2(double* X, double* Y, int* pn, int* pd, double* M2)
@@
-56,7
+50,7
@@
void Moments_M3(double* X, double* Y, int* pn, int* pd, double* M3)
// W = 1/N sum( t(g(Zi,theta)) g(Zi,theta) )
// with g(Zi, theta) = i-th contribution to all moments (size dim) - real moments
// W = 1/N sum( t(g(Zi,theta)) g(Zi,theta) )
// with g(Zi, theta) = i-th contribution to all moments (size dim) - real moments
-void Compute_Omega(double* X,
double
* Y, double* M, int* pn, int* pd, double* W)
+void Compute_Omega(double* X,
int
* Y, double* M, int* pn, int* pd, double* W)
{
int n=*pn, d=*pd;
int dim = d + d*d + d*d*d;
{
int n=*pn, d=*pd;
int dim = d + d*d + d*d*d;