Source
zabbix_log(LOG_LEVEL_DEBUG, "fitted expression is: x = (" ZBX_FS_DBL ") * exp( (" ZBX_FS_DBL ") * (" ZBX_FS_DBL " + t) )",
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** 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 2 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, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
typedef struct
{
int rows;
int columns;
double *elements;
}
zbx_matrix_t;
static void zbx_matrix_struct_alloc(zbx_matrix_t **pm)
{
*pm = (zbx_matrix_t *)zbx_malloc(*pm, sizeof(zbx_matrix_t));
(*pm)->rows = 0;
(*pm)->columns = 0;
(*pm)->elements = NULL;
}
static int zbx_matrix_alloc(zbx_matrix_t *m, int rows, int columns)
{
if (0 >= rows || 0 >= columns)
goto error;
m->rows = rows;
m->columns = columns;
m->elements = (double *)zbx_malloc(m->elements, sizeof(double) * rows * columns);
return SUCCEED;
error: