commit 2e6a269: [Minor] Eugen -> eigen

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Aug 26 09:35:07 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-08-26 10:30:18 +0100
URL: https://github.com/rspamd/rspamd/commit/2e6a269af6c32c2dd288697994c849511d1f37af (HEAD -> master)

[Minor] Eugen -> eigen

---
 contrib/kann/kautodiff.c  |  6 +++---
 contrib/kann/kautodiff.h  |  8 ++++----
 lualib/lua_ffi/linalg.lua |  2 +-
 src/lua/lua_tensor.c      | 12 ++++++------
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/contrib/kann/kautodiff.c b/contrib/kann/kautodiff.c
index c8037d353..439485a0a 100644
--- a/contrib/kann/kautodiff.c
+++ b/contrib/kann/kautodiff.c
@@ -952,7 +952,7 @@ void kad_sgemm_simple(int trans_A, int trans_B, int M, int N, int K, const float
 }
 #endif
 
-bool kad_ssyev_simple(int N, float *A, float *eugenvals)
+bool kad_ssyev_simple(int N, float *A, float *eigenvals)
 {
 #ifndef HAVE_CBLAS
 	return false;
@@ -963,10 +963,10 @@ bool kad_ssyev_simple(int N, float *A, float *eugenvals)
 
 	/* Query and allocate the optimal workspace */
 	lwork = -1;
-	ssyev ("Vectors", "Upper", &n, A, &lda, eugenvals, &wkopt, &lwork, &info);
+	ssyev ("Vectors", "Upper", &n, A, &lda, eigenvals, &wkopt, &lwork, &info);
 	lwork = wkopt;
 	work = (float*) g_malloc(lwork * sizeof(double));
-	ssyev ("Vectors", "Upper", &n, A, &lda, eugenvals, work, &lwork, &info);
+	ssyev ("Vectors", "Upper", &n, A, &lda, eigenvals, work, &lwork, &info);
 	/* Check for convergence */
 	if (info > 0) {
 		g_free (work);
diff --git a/contrib/kann/kautodiff.h b/contrib/kann/kautodiff.h
index 8c797205c..d7e713304 100644
--- a/contrib/kann/kautodiff.h
+++ b/contrib/kann/kautodiff.h
@@ -246,11 +246,11 @@ static inline int kad_len(const kad_node_t *p) /* calculate the size of p->x */
 /* Additions by Rspamd */
 void kad_sgemm_simple (int trans_A, int trans_B, int M, int N, int K, const float *A, const float *B, float *C);
 /**
- * Calculate eugenvectors and eugenvalues
+ * Calculate eigenvectors and eigenvalues
  * @param N dimensions of A (must be NxN)
- * @param A input matrix (part of it will be destroyed, so copy if needed), on finish the first `nwork` columns will have eugenvectors
- * @param eugenvals eugenvalues, must be N elements vector
+ * @param A input matrix (part of it will be destroyed, so copy if needed), on finish the first `nwork` columns will have eigenvectors
+ * @param eigenvals eigenvalues, must be N elements vector
  */
-bool kad_ssyev_simple (int N, float *A, float *eugenvals);
+bool kad_ssyev_simple (int N, float *A, float *eigenvals);
 
 #endif
diff --git a/lualib/lua_ffi/linalg.lua b/lualib/lua_ffi/linalg.lua
index ae71fc08b..59ff577a2 100644
--- a/lualib/lua_ffi/linalg.lua
+++ b/lualib/lua_ffi/linalg.lua
@@ -65,7 +65,7 @@ exports.sgemm = function(a, m, b, n, k, trans_a, trans_b)
   return res
 end
 
-exports.eugen = function(a, n)
+exports.eigen = function(a, n)
   if type(a) == 'table' then
     -- Need to convert, slow!
     n = n or #a
diff --git a/src/lua/lua_tensor.c b/src/lua/lua_tensor.c
index f8386d6f3..b40ee6e71 100644
--- a/src/lua/lua_tensor.c
+++ b/src/lua/lua_tensor.c
@@ -35,7 +35,7 @@ LUA_FUNCTION_DEF (tensor, tostring);
 LUA_FUNCTION_DEF (tensor, index);
 LUA_FUNCTION_DEF (tensor, newindex);
 LUA_FUNCTION_DEF (tensor, len);
-LUA_FUNCTION_DEF (tensor, eugen);
+LUA_FUNCTION_DEF (tensor, eigen);
 LUA_FUNCTION_DEF (tensor, mean);
 LUA_FUNCTION_DEF (tensor, transpose);
 
@@ -56,7 +56,7 @@ static luaL_reg rspamd_tensor_m[] = {
 		{"__index", lua_tensor_index},
 		{"__newindex", lua_tensor_newindex},
 		{"__len", lua_tensor_len},
-		LUA_INTERFACE_DEF (tensor, eugen),
+		LUA_INTERFACE_DEF (tensor, eigen),
 		LUA_INTERFACE_DEF (tensor, mean),
 		LUA_INTERFACE_DEF (tensor, transpose),
 		{NULL, NULL},
@@ -604,9 +604,9 @@ lua_tensor_len (lua_State *L)
 }
 
 static gint
-lua_tensor_eugen (lua_State *L)
+lua_tensor_eigen (lua_State *L)
 {
-	struct rspamd_lua_tensor *t = lua_check_tensor (L, 1), *eugen;
+	struct rspamd_lua_tensor *t = lua_check_tensor (L, 1), *eigen;
 
 	if (t) {
 		if (t->ndims != 2 || t->dim[0] != t->dim[1]) {
@@ -614,9 +614,9 @@ lua_tensor_eugen (lua_State *L)
 					t->dim[0], t->dim[1]);
 		}
 
-		eugen = lua_newtensor (L, 1, &t->dim[0], true, true);
+		eigen = lua_newtensor (L, 1, &t->dim[0], true, true);
 
-		if (!kad_ssyev_simple (t->dim[0], t->data, eugen->data)) {
+		if (!kad_ssyev_simple (t->dim[0], t->data, eigen->data)) {
 			lua_pop (L, 1);
 			return luaL_error (L, "kad_ssyev_simple failed (no blas?)");
 		}


More information about the Commits mailing list