Mimetic Operators Library Enhanced 4.0
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1/*
2* SPDX-License-Identifier: GPL-3.0-or-later
3* © 2008-2024 San Diego State University Research Foundation (SDSURF).
4* See LICENSE file or https://www.gnu.org/licenses/gpl-3.0.html for details.
5*/
6
7/*
8 * @file utils.h
9 * @brief Helpers for sparse operations and MATLAB analogs
10 * @date 2024/10/15
11 *
12 */
13
14#pragma once
15
16#ifndef UTILS_H
17#define UTILS_H
18
19#include <armadillo>
20
21using Real = double;
22using namespace arma;
23
28class Utils {
29public:
30
39 static sp_mat spkron(const sp_mat &A, const sp_mat &B);
40
49 static sp_mat spjoin_rows(const sp_mat &A, const sp_mat &B);
50
59 static sp_mat spjoin_cols(const sp_mat &A, const sp_mat &B);
60
69 static vec spsolve_eigen(const sp_mat &A, const vec &b);
70
87 void meshgrid(const vec &x, const vec &y, mat &X, mat &Y);
88
104 void meshgrid(const vec &x, const vec &y, const vec &z, cube &X, cube &Y,
105 cube &Z);
106};
107
108#endif // UTILS_H
Utility Functions.
Definition utils.h:28
static sp_mat spjoin_cols(const sp_mat &A, const sp_mat &B)
An in place operation for joining two matrices by columns.
Definition utils.cpp:138
static sp_mat spjoin_rows(const sp_mat &A, const sp_mat &B)
An in place operation for joining two matrices by rows.
Definition utils.cpp:103
static vec spsolve_eigen(const sp_mat &A, const vec &b)
A wrappper for implementing a sparse solve using Eigen from SuperLU.
static sp_mat spkron(const sp_mat &A, const sp_mat &B)
A wrappper for implementing a sparse Kroenecker product.
Definition utils.cpp:70
void meshgrid(const vec &x, const vec &y, mat &X, mat &Y)
An analog to the MATLAB 2D meshgrid operation.
Definition utils.cpp:173
double Real
Definition utils.h:21