}
#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;
/* 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);
/* 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
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
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);
{"__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},
}
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]) {
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?)");
}