TDMS
Time Domain Maxwell Solver
All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
dimensions.h
Go to the documentation of this file.
1/**
2 * @file dimensions.h
3 * @brief Defines a class that serves as an explicit converter between MATLAB
4 * pointers and array dimensions
5 */
6#pragma once
7
8#include "mat_io.h"
9
11private:
12 int i = 0;//!< Extent of dimension 1
13 int j = 0;//!< Extent of dimension 2
14 int k = 0;//!< Extent of dimension 3
15
16 bool are_nd(int n) const { return (bool(i) + bool(j) + bool(k)) == n; }
17
18public:
19 int operator[](int value) const;
20
21 explicit Dimensions(const mxArray *ptr);
22
23 bool are_1d() const { return are_nd(1); }
24 bool are_2d() const { return are_nd(2); }
25};
Definition dimensions.h:10
int k
Extent of dimension 3.
Definition dimensions.h:14
int j
Extent of dimension 2.
Definition dimensions.h:13
int i
Extent of dimension 1.
Definition dimensions.h:12
Includes MATLAB headers for I/O.