![]() |
Mimetic Operators Library Enhanced 4.0
|
Utility Functions. More...
#include <utils.h>
Public Member Functions | |
void | meshgrid (const vec &x, const vec &y, mat &X, mat &Y) |
An analog to the MATLAB 2D meshgrid operation. | |
void | meshgrid (const vec &x, const vec &y, const vec &z, cube &X, cube &Y, cube &Z) |
An analog to the MATLAB 3D meshgrid operation. | |
Static Public Member Functions | |
static sp_mat | spkron (const sp_mat &A, const sp_mat &B) |
A wrappper for implementing a sparse Kroenecker product. | |
static sp_mat | spjoin_rows (const sp_mat &A, const sp_mat &B) |
An in place operation for joining two matrices by rows. | |
static sp_mat | spjoin_cols (const sp_mat &A, const sp_mat &B) |
An in place operation for joining two matrices by columns. | |
static vec | spsolve_eigen (const sp_mat &A, const vec &b) |
A wrappper for implementing a sparse solve using Eigen from SuperLU. | |
void Utils::meshgrid | ( | const vec & | x, |
const vec & | y, | ||
const vec & | z, | ||
cube & | X, | ||
cube & | Y, | ||
cube & | Z ) |
An analog to the MATLAB 3D meshgrid operation.
meshgrid(x,y,z,X,Y,Z) returns 3-D grid coordinates defined by the vectors x, y, and z. The grid represented by X, Y, and Z has size length(y)-by-length(x)-by-length(z).
x | a vector of x-indices |
y | a vector of y-indices |
z | a vector of z-indices |
X | a sparse matrix, will be filled by the function |
Y | a sparse matrix, will be filled by the function |
Z | a sparse matrix, will be filled by the function |
Definition at line 196 of file utils.cpp.
void Utils::meshgrid | ( | const vec & | x, |
const vec & | y, | ||
mat & | X, | ||
mat & | Y ) |
An analog to the MATLAB 2D meshgrid operation.
returns 2-D grid coordinates based on the coordinates contained in vectors x and y. X is a matrix where each row is a copy of x, and Y is a matrix where each column is a copy of y. The grid represented by the coordinates X and Y has length(y) rows and length(x) columns. Key here is the rows is the y-coordinate, and the columns are the x-coordinate.
x | a vector of x-indices |
y | a vector of y-indices |
X | a sparse matrix, will be filled by the function |
Y | a sparse matrix, will be filled by the function |
Definition at line 173 of file utils.cpp.
|
static |
An in place operation for joining two matrices by columns.
A | a sparse matrix |
B | a sparse matrix |
Definition at line 138 of file utils.cpp.
|
static |
An in place operation for joining two matrices by rows.
A | a sparse matrix |
B | a sparse matrix |
Definition at line 103 of file utils.cpp.
|
static |
A wrappper for implementing a sparse Kroenecker product.
A | a sparse matrix |
B | a sparse matrix |
Definition at line 70 of file utils.cpp.
|
static |
A wrappper for implementing a sparse solve using Eigen from SuperLU.
A | a sparse matrix LHS of Ax=b |
b | a vector for the RHS of Ax=b |