Open Qmin  0.8.0
GPU-accelerated Q-tensor-based liquid crystal simulations
Public Member Functions | Public Attributes | Friends | List of all members
Matrix2x2 Struct Reference

contains a {{x11,x12},{x21,x22}} set, a (3x3) structure, and a (d x d) structure (and matrix manipulations) More...

#include <matrix.h>

Public Member Functions

HOSTDEVICE Matrix2x2 ()
 Default constructor is the identity matrix. More...
 
HOSTDEVICE Matrix2x2 (scalar y11, scalar y12, scalar y21, scalar y22)
 Generic constructor is whatever you wnat it to be. More...
 
HOSTDEVICE void set (scalar y11, scalar y12, scalar y21, scalar y22)
 Set the values to some desired set. More...
 
HOSTDEVICE void transpose ()
 Transpose. More...
 
HOSTDEVICE void operator= (const Matrix2x2 &m2)
 assignment operator More...
 
HOSTDEVICE void operator *= (const Matrix2x2 &m2)
 matrix multiplication operator More...
 
HOSTDEVICE void operator *= (scalar a)
 scalar multiplication operator More...
 
HOSTDEVICE void operator+= (const Matrix2x2 &m2)
 Matrix addition operator. More...
 
HOSTDEVICE void operator-= (const Matrix2x2 &m2)
 Matrix subtraction operator. More...
 

Public Attributes

scalar x11
 The entries of the matrix. More...
 
scalar x12
 
scalar x21
 
scalar x22
 

Friends

HOSTDEVICE friend Matrix2x2 operator * (const Matrix2x2 &m1, const Matrix2x2 &m2)
 matrix multiplication operator More...
 
HOSTDEVICE friend Matrix2x2 operator * (const Matrix2x2 &m, const scalar a)
 scalar right multiplication operator More...
 
HOSTDEVICE friend Matrix2x2 operator * (const scalar a, const Matrix2x2 &m)
 scalar left multiplication operator More...
 
HOSTDEVICE friend Matrix2x2 operator+ (const Matrix2x2 &m1, const Matrix2x2 &m2)
 Matrix addition operator. More...
 
HOSTDEVICE friend Matrix2x2 operator- (const Matrix2x2 &m1, const Matrix2x2 &m2)
 matrix subtraction operator More...
 
HOSTDEVICE friend scalar2 operator * (const scalar2 &v, const Matrix2x2 &m)
 matrix-vector multiplication operator More...
 
HOSTDEVICE friend scalar2 operator * (const Matrix2x2 &m, const scalar2 &v)
 matrix-vector multiplication operator More...
 

Detailed Description

contains a {{x11,x12},{x21,x22}} set, a (3x3) structure, and a (d x d) structure (and matrix manipulations)

Matrix2x2 provides a simple interface for operations using 2x2 matrices. In particular, it implement matrix-maxtrix multiplication, and has specialized matrix-vector and vector-matrix multiplication in which scalar2 variables take the place of vectors. A dyadic product is implemented which takes two scalar2s and returns a Matrix2x2

Constructor & Destructor Documentation

◆ Matrix2x2() [1/2]

HOSTDEVICE Matrix2x2::Matrix2x2 ( )
inline

Default constructor is the identity matrix.

◆ Matrix2x2() [2/2]

HOSTDEVICE Matrix2x2::Matrix2x2 ( scalar  y11,
scalar  y12,
scalar  y21,
scalar  y22 
)
inline

Generic constructor is whatever you wnat it to be.

Member Function Documentation

◆ set()

HOSTDEVICE void Matrix2x2::set ( scalar  y11,
scalar  y12,
scalar  y21,
scalar  y22 
)
inline

Set the values to some desired set.

References x11, x12, x21, and x22.

Referenced by operator *=(), operator+=(), operator-=(), and operator=().

◆ transpose()

HOSTDEVICE void Matrix2x2::transpose ( )
inline

Transpose.

References scalar, x12, and x21.

◆ operator=()

HOSTDEVICE void Matrix2x2::operator= ( const Matrix2x2 m2)
inline

assignment operator

References set(), x11, x12, x21, and x22.

◆ operator *=() [1/2]

HOSTDEVICE void Matrix2x2::operator *= ( const Matrix2x2 m2)
inline

matrix multiplication operator

References set(), x11, x12, x21, and x22.

◆ operator *=() [2/2]

HOSTDEVICE void Matrix2x2::operator *= ( scalar  a)
inline

scalar multiplication operator

References set(), x11, x12, x21, and x22.

◆ operator+=()

HOSTDEVICE void Matrix2x2::operator+= ( const Matrix2x2 m2)
inline

Matrix addition operator.

References set(), x11, x12, x21, and x22.

◆ operator-=()

HOSTDEVICE void Matrix2x2::operator-= ( const Matrix2x2 m2)
inline

Matrix subtraction operator.

References set(), x11, x12, x21, and x22.

Friends And Related Function Documentation

◆ operator * [1/5]

HOSTDEVICE friend Matrix2x2 operator * ( const Matrix2x2 m1,
const Matrix2x2 m2 
)
friend

matrix multiplication operator

◆ operator * [2/5]

HOSTDEVICE friend Matrix2x2 operator * ( const Matrix2x2 m,
const scalar  a 
)
friend

scalar right multiplication operator

◆ operator * [3/5]

HOSTDEVICE friend Matrix2x2 operator * ( const scalar  a,
const Matrix2x2 m 
)
friend

scalar left multiplication operator

◆ operator+

HOSTDEVICE friend Matrix2x2 operator+ ( const Matrix2x2 m1,
const Matrix2x2 m2 
)
friend

Matrix addition operator.

◆ operator-

HOSTDEVICE friend Matrix2x2 operator- ( const Matrix2x2 m1,
const Matrix2x2 m2 
)
friend

matrix subtraction operator

◆ operator * [4/5]

HOSTDEVICE friend scalar2 operator * ( const scalar2 v,
const Matrix2x2 m 
)
friend

matrix-vector multiplication operator

◆ operator * [5/5]

HOSTDEVICE friend scalar2 operator * ( const Matrix2x2 m,
const scalar2 v 
)
friend

matrix-vector multiplication operator

Member Data Documentation

◆ x11

scalar Matrix2x2::x11

The entries of the matrix.

Referenced by operator *=(), operator+=(), operator-=(), operator=(), printMatrix(), and set().

◆ x12

scalar Matrix2x2::x12

◆ x21

scalar Matrix2x2::x21

◆ x22

scalar Matrix2x2::x22

The documentation for this struct was generated from the following file: