GemaCoreLib
The GeMA Core library
Classes | Macros | Typedefs | Functions
gmMatrix.h File Reference

Declaration of the GmMatrix class. More...

#include "gmCoreConfig.h"
#include <armadillo>
#include <QMetaType>
#include "gmMatrixUtils.h"
#include <assert.h>
Include dependency graph for gmMatrix.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  GmCRMatrix
 An auxiliary matrix WRAPPER that binds the matrix to a CONST memory area with data already inicialized and interpreted in COLUMN MAJOR FORMAT. More...
 

Macros

#define GM_MATRIX_DEFINED
 We are going to use an Armadillo matrix as our base matrix interface. More...
 
#define GM_MATRIX_IS_COLUMN_MAJOR
 
#define DECLARE_REF_MATRIX(x, ptr, lin, col)   GmMatrix x((ptr), (lin), (col), false, true)
 An auxiliary macro to help correctly define a matrix that binds itself to a memory area with data already initialized and interpreted in COLUMN MAJOR FORMAT. More...
 

Typedefs

typedef arma::mat GmMatrix
 The basic type for a GeMA matrix object. Currently based on an Armadillo matrix.
 
typedef arma::subview_col< double > GmMatrixCol
 A subcolumn view of a matrix.
 

Functions

 Q_DECLARE_METATYPE (GmMatrix)
 

Detailed Description

Declaration of the GmMatrix class.

Author
Carlos Augusto Teixeira Mendes
Date
april, 2015

Macro Definition Documentation

◆ DECLARE_REF_MATRIX

#define DECLARE_REF_MATRIX (   x,
  ptr,
  lin,
  col 
)    GmMatrix x((ptr), (lin), (col), false, true)

An auxiliary macro to help correctly define a matrix that binds itself to a memory area with data already initialized and interpreted in COLUMN MAJOR FORMAT.

This is a very fast option, that doesn't allocate any extra memory and is very usefull to use matrix operations over a previous allocated area.

This matrix cannot be resized in any way. The memory referenced by the matrix should be available through the entire lifetime of the matrix.

IMPORTANT: Any COPY of this matrix will make a COPY of the data and won't point to the original memory area anymore.

◆ GM_MATRIX_DEFINED

#define GM_MATRIX_DEFINED

We are going to use an Armadillo matrix as our base matrix interface.

The typedef GmMatrix is used to make life a little bit easier if we ever wish to exchange our base linear algebra package.